Game Development Community

Share templates to multiple levels

by M.B. · in Torque X 2D · 06/16/2010 (8:33 pm) · 5 replies

Hi,

I'm new to the forum. I've just started playing around with torque and am about to buy it. My only issue is I cant seem to find a way to share a template created with multiple levels. I searched the forum and have seen a few people asking for similar things but havent really seen an answer.

Essentially what I would like to do is create my player template and some object/enemy ones and be able to reuse them all on multiple levels and making a change to one would effect them all.

If anyone has an answer to this that would be awesome.

Thanks in advance.

#1
06/16/2010 (10:34 pm)
I'm not sure there are templates in the way you're explaining. However, you can load more than one scene at a time. For instance, with Zombie Sniper HD we are loading our "player" or the scope in a scene at the beginning of the game and we never actually unload it. That way we only had to make changes to the player in one location. We just load our level scenes on top of this scene.

Also, you can copy and paste objects from one scene to another - however you have to copy, close and open the scene you want to copy it into. It would be so nice if we could have more than one instance open at a time so we could copy and paste objects from one scene to another much easier.

Hope this helps.
#2
06/17/2010 (2:40 pm)
So its possible to create my enemies and such in one scene and then use them in another scene within the editor?
#3
06/17/2010 (6:49 pm)
Sadly I don't believe so. You can cheat it though. For example. You can create one scene with all your enemies. In your levels create an object named "enemySpawn". Then in code just spawn your enemies at the spawn objects.
#4
06/18/2010 (1:34 pm)
Well...
You can trade a bit of safety for ease-of-use.
You can use Matthew's trick BUT instead of using a normal spawner, you replace the normal drop-down by a string and test to make sure it is found in one of your scene before attempting to spawn it. This way, you keep your level designer's freedom and game/level relevant info in the xml while safely loading and using templates in your game :)
#5
06/19/2010 (9:51 am)
Awesome thanks guys I will play around with it and hopefully get everything working.