Clone/copy should include linkpoints
by Joe Rossi · in Torque Game Builder · 05/18/2008 (1:25 pm) · 5 replies
Unless I'm mistaken, clone and copy functions won't copy linkpoint data to the newly created objects. Would be nice in the future if TGB could do this for us. I'm having to manually recreate linkpoints in script to work around it.
#2
05/22/2008 (11:58 am)
CloneWithBehaviors unfortunately copies the data over in a completely custom way due to it's need to do things in a certain order to register behaviors and ensure they get the proper object callbacks when the new object is cloned. This unfortunately has created a gap in functionality and redundant code. This doesn't really help you though I thought you did deserve an explanation of why it was behaving the way it does :)
#3
To work around link points in my projects, I define a "t2dSceneObject::onSpawn(%sourceObject)" function in game.cs that I manually call after each clone/copy function. This onSpawn function is filled with whatever data I need copied from the source to the cloned object.
05/22/2008 (1:13 pm)
Joe, To work around link points in my projects, I define a "t2dSceneObject::onSpawn(%sourceObject)" function in game.cs that I manually call after each clone/copy function. This onSpawn function is filled with whatever data I need copied from the source to the cloned object.
#4
05/22/2008 (7:17 pm)
Thanks guys, I was able to do what I needed :)
#5
03/17/2012 (2:12 pm)
This is still a problem. CloneWithBehaviors still works fortunately!
Torque Owner Joe Rossi
Indri Games