Author Topic: Modification history  (Read 6918 times)

Offline Nullable

  • Bored
  • Member
  • **
  • Posts: 49
  • Reputation: 0
    • View Profile
    • Nullable.se
Re: Modification history
« Reply #15 on: July 21, 2012, 01:18:05 AM »
It's in a particular board that regular members can't view.

Here's the code snippet:
Code: [Select]
// Clone current object
function SimObject::clone(%this)
{
%class = %this.getClassName();
%name = %this.getName();
%tempName = "__CLONE_OBJECT_";
%this.setName(%tempName);
eval("%obj = new " @ %class @ "(%name : " @ %tempName @ "){class = \"" @ %this.class @ "\";superClass = \"" @ %this.superClass @ "\";};");
%this.setName(%name);
return %obj;
}
Isn't cloning, you know, supposed to actually involve copying?

Did I asked you Boom to repost my code? If it is restricted, it is restricted.

Anyway, I don't mind, but please think before posting, okay?
Why is it listed as released if it's in an off-limits forum?
Feel free to contact me at teo@nullable.se.

Offline McTwist

  • Programmer
  • Forum VIP
  • Exceptional Member
  • **
  • Posts: 842
  • Reputation: 20
  • Scrambled eggs
    • View Profile
  • Alias: Tyzaack
  • Blockland ID: 9845
Re: Modification history
« Reply #16 on: July 21, 2012, 01:28:39 AM »
It is a release. But I forgot that part of the forum were restricted. I was more pointing out that things written in a restricted forum should not leave that area. Yes, I am breaking that rule by pointing out that my method is in there.

And about the cloning, it is quite easy in fact. To clone an object you only need to insert the objects name in the second argument.
Code: [Select]
new ScriptObject(NewName : OldObject);The second argument contains an OldObject object that will be copied in the new object. This information is poorly documented, but I think I found it in the TorqueScript Appendix and found out that it worked. However, you cannot insert an object id, but only the name, and the name only. Not even a variable. This is why I use the very obscure name __CLONE_OBJECT__. I could as well add some extra letters and numbers to be sure that objects is unique.
"I did not bump this topic. I was just late replying."

Offline Nullable

  • Bored
  • Member
  • **
  • Posts: 49
  • Reputation: 0
    • View Profile
    • Nullable.se
Re: Modification history
« Reply #17 on: July 21, 2012, 01:34:31 AM »
Must have missed that part, haha.
Feel free to contact me at teo@nullable.se.

Offline Boom

  • Basement Dweller
  • Moderator
  • Jukebox Hero (Stars in their eyes)
  • ***
  • Posts: 5966
  • Reputation: 130
  • Changing the world one brick at a time.
    • View Profile
  • Alias: Deathwishez
  • Blockland ID: 9740
Re: Modification history
« Reply #18 on: July 21, 2012, 05:28:57 AM »
Did I asked you Boom to repost my code? If it is restricted, it is restricted.

Anyway, I don't mind, but please think before posting, okay?

It didn't seem like it was something super sensitive, and it wasn't an elaborate script.

I wasn't trying to offend you or anything, sorry if I overstepped my bounds.

Offline McTwist

  • Programmer
  • Forum VIP
  • Exceptional Member
  • **
  • Posts: 842
  • Reputation: 20
  • Scrambled eggs
    • View Profile
  • Alias: Tyzaack
  • Blockland ID: 9845
Re: Modification history
« Reply #19 on: July 21, 2012, 08:46:14 PM »
When I post something, it is free to distribute unless I state otherwise. It is giving out information from restricted areas that I am concerned about. Nothing is harmed though, as you copied only that piece of code. Feel free to use it, but please write that I wrote it as now it looks like you made it, even if I linked to it.
"I did not bump this topic. I was just late replying."

Offline Boom

  • Basement Dweller
  • Moderator
  • Jukebox Hero (Stars in their eyes)
  • ***
  • Posts: 5966
  • Reputation: 130
  • Changing the world one brick at a time.
    • View Profile
  • Alias: Deathwishez
  • Blockland ID: 9740
Re: Modification history
« Reply #20 on: July 21, 2012, 09:50:55 PM »
but please write that I wrote it as now it looks like you made it, even if I linked to it.

I thought that you were already implied as the author because of the link and it being listed already as yours. In no way did I intend to take credit for any part of it.

Offline McTwist

  • Programmer
  • Forum VIP
  • Exceptional Member
  • **
  • Posts: 842
  • Reputation: 20
  • Scrambled eggs
    • View Profile
  • Alias: Tyzaack
  • Blockland ID: 9845
Re: Modification history
« Reply #21 on: July 22, 2012, 12:47:09 AM »
Let us drop this. I know your intentions, and those are honorable.
"I did not bump this topic. I was just late replying."

Offline McTwist

  • Programmer
  • Forum VIP
  • Exceptional Member
  • **
  • Posts: 842
  • Reputation: 20
  • Scrambled eggs
    • View Profile
  • Alias: Tyzaack
  • Blockland ID: 9845
Re: Modification history
« Reply #22 on: December 28, 2013, 12:29:59 PM »
I added an another add-on I made into the list: Apartment.
"I did not bump this topic. I was just late replying."

Offline Shappeh

  • Moderator
  • Quad Poster
  • ***
  • Posts: 1318
  • Reputation: 40
    • View Profile
Re: Modification history
« Reply #23 on: March 28, 2014, 03:22:35 AM »
If you package SimSet::clone as well as SimObject::clone, could you allow it to clone nested objects?

Offline McTwist

  • Programmer
  • Forum VIP
  • Exceptional Member
  • **
  • Posts: 842
  • Reputation: 20
  • Scrambled eggs
    • View Profile
  • Alias: Tyzaack
  • Blockland ID: 9845
Re: Modification history
« Reply #24 on: March 28, 2014, 06:06:00 AM »
Iterate through the list and apply clone to them. Sure.
"I did not bump this topic. I was just late replying."

Offline McTwist

  • Programmer
  • Forum VIP
  • Exceptional Member
  • **
  • Posts: 842
  • Reputation: 20
  • Scrambled eggs
    • View Profile
  • Alias: Tyzaack
  • Blockland ID: 9845
Re: Modification history
« Reply #25 on: October 26, 2016, 09:24:19 AM »
I updated my list so the downloads works.
"I did not bump this topic. I was just late replying."

Offline McTwist

  • Programmer
  • Forum VIP
  • Exceptional Member
  • **
  • Posts: 842
  • Reputation: 20
  • Scrambled eggs
    • View Profile
  • Alias: Tyzaack
  • Blockland ID: 9845
Re: Modification history
« Reply #26 on: November 17, 2017, 11:14:33 AM »
I added my latest Add-On to my list.
"I did not bump this topic. I was just late replying."

Offline Gizmo

  • OG - Original Gizmo
  • Moderator
  • Exceptional Member
  • ***
  • Posts: 773
  • Reputation: 10
  • Blockland ID: 12815
    • View Profile
Re: Modification history
« Reply #27 on: November 20, 2017, 01:24:08 AM »
I added my latest Add-On to my list.

Looks dope