Cloning and multiple levels?
by Jeremy Stieglitz · in Torque Game Builder · 07/14/2009 (12:03 am) · 2 replies
Hey intrepid TGB developers,
So the Cloning functionality in TGB seems quite useful, as it allows artists to visually setup "template" objects in the Editor composed of pre-described behaviors, and then in runtime code get them by unique name & clone them for dynamic gameplay.
Only trouble is, then all of the re-usable game objects would have to be placed on EVERY game level, which would make it troublesome when we want to change a particular object during the development process (we'd have to go through each level and change it on all of them).
So is it possible to load multiple levels in TGB (to use one as the real Gameplay level, and the other as a static non-visible "Template" level), and to Clone() an Object from the "Template" level but ADD it to the Gameplay Level's SceneGraph?
Sounds a little complex, but it would be very very useful!
Thanks so much for the help,
Jer
So the Cloning functionality in TGB seems quite useful, as it allows artists to visually setup "template" objects in the Editor composed of pre-described behaviors, and then in runtime code get them by unique name & clone them for dynamic gameplay.
Only trouble is, then all of the re-usable game objects would have to be placed on EVERY game level, which would make it troublesome when we want to change a particular object during the development process (we'd have to go through each level and change it on all of them).
So is it possible to load multiple levels in TGB (to use one as the real Gameplay level, and the other as a static non-visible "Template" level), and to Clone() an Object from the "Template" level but ADD it to the Gameplay Level's SceneGraph?
Sounds a little complex, but it would be very very useful!
Thanks so much for the help,
Jer
#2
Visual setup would seem to be important in case where, say, a complex convex Polygon collision setup is needed?
And while I can Clone() within a level currently, it means that all of my gameplay objects Clone library need to exist on all of my levels, which is a pain in case I want to modify any of them.
If there was some way to have an extra level in the background that wasn't actually used/processed for gameplay, but whose objects I could clone and then move to the primary game level, this would be solved! Any more ideas? :)
Cheers,
Jer
07/14/2009 (9:56 am)
That's cool, thanks Drethon, but the downside to config datablocks is that they still require hardcoding the values, whereas a Cloned object can be setup visually in the Editor. Visual setup would seem to be important in case where, say, a complex convex Polygon collision setup is needed?
And while I can Clone() within a level currently, it means that all of my gameplay objects Clone library need to exist on all of my levels, which is a pain in case I want to modify any of them.
If there was some way to have an extra level in the background that wasn't actually used/processed for gameplay, but whose objects I could clone and then move to the primary game level, this would be solved! Any more ideas? :)
Cheers,
Jer
Torque 3D Owner Drethon
Default Studio Name