Game Development Community

IsPersistent Question

by Tim LaBonne · in Torque X 2D · 11/06/2007 (6:27 pm) · 2 replies

I've been designing a breakout clone to practice Torque X. I want to make several levels as .txscene files and fill them with various objects. Some of the objects, however, need to persist across all levels (namely the player's paddle and the ball). I saw the IsPersistent property on T2DSceneObject and it looks like what I need to make these objects not unload from a scene. However, this property doesn't seem to do anything. When I unload the first level and reload the second (via SceneLoader) the second level's specific objects load as expected, but the objects marked persistent in the first level disappear and are no longer in the TorqueDatabase. So, I'd like to know what I am doing wrong or if there is another good way of doing what I am describing.

#1
11/06/2007 (11:18 pm)
Persistant objects should not be removed from the scene when the level they came from is unloaded. If they are being removed it's a bug. :(
#2
11/07/2007 (5:50 am)
I don't think it is working as intended. How about this for a work around - tell me if this would work or not - put all of my objects that I want to persist across levels in a common txscene file, load that file at the start of the game and extract out the T2DSceneObjects I want to persist. Then unload the common scene file and load the next level. When the level is done loading, Register the common objects and set them up. Would that work or would the unload of the common scene kill the persistent objects?