Retaining object linkage on dynamic objects
by Andy Schatz · in Torque Game Engine · 12/11/2008 (10:39 am) · 2 replies
I've got a game object (animal) that has a pointer (SimObjectPtr to be exact) to another object, its nest. When I save the game, I am just saving out the objects to a script file in the standard way. When I reload that save file, I want to make sure the animal retains its linkage to its nest.
The problem is that these objects are dynamic, so I can't just name them in the editor. And when I reload the objects, their id's will change. Is there a standard way for one object to keep track of another object without naming it or using its id?
I'm looking for a generic solution here, since this sort of problem happens in a number of cases (saving the camera state, etc). Any ideas?
The problem is that these objects are dynamic, so I can't just name them in the editor. And when I reload the objects, their id's will change. Is there a standard way for one object to keep track of another object without naming it or using its id?
I'm looking for a generic solution here, since this sort of problem happens in a number of cases (saving the camera state, etc). Any ideas?
#2
12/11/2008 (12:05 pm)
Wesley, thanks for the reply! I thought I knew a problem with this solution, but then I thought about it some more and I think you're right, this does work. Thanks!
Torque 3D Owner Wesley Hopson
Probably the absolute simplest way to do what your wanting.