Game Development Community

Recurrent Enemies and Persistence

by Rich Wilson · in Torque X 2D · 10/28/2007 (7:53 am) · 1 replies

I have several levels in a game I'm working on, and they share enemies. I'm not entirely sure how persistence is supposed to work yet. If I check IsPersistent on a templated object, instances of the object placed in that scene crash the game with an error stating that the base Object doesn't include Persists in the CopyTo function.

Aside from that, I also don't see those objects appearing in other scenes I open up within that project. Can I only access persistent objects through code?

#1
10/29/2007 (3:13 pm)
Making an object persistant just means that it won't be removed when you unload the scene (ingame), you just have to load it once. So this method should work, I've never come across the problem you're describing with persistant object (the copyTo error). The other way you could do it is to have one txscene file that contains all your peristant objects, then just load that scene and never unload it.


As for viewing the persistant objects in TXB, right now there's no way of viewing multiple scene files at once. Would be nice if we could though...maybe drag and drop objects between them in the object tree? *hint to gg staff*