Game Development Community

TXScene and Games with Multiple 'scenes

by Josh Butterworth · in Torque X 2D · 01/29/2007 (7:23 am) · 6 replies

This is probably a stupid question but I'm sat at work obbsessing over it and I cant try anything till i get home.

The game I'm making has 7 or 8 stages, for each one the majority of the data needed is the same but there are some differences, namely the scrollers, tilelayers, enemies and some projectiles.

My question is, is there a way im supposed to do this with TXScene xml files?

I assume (though i havent tried yet) that i could have TXSceneStage1.xml TXSceneStage2.xml and just unload/load them between levels?

My problem with that is that it would mean I'd have the consistant objects like the players sprite defined in each file so if i ever needed to change it i'd have to go through each one.

Can I have TXPersistantData.xml with all the static stuff then load a stage specific one over the top of it?

#1
01/29/2007 (9:17 am)
I believe you can mark objects as persistant and only add them to the first level you add. You would then only change the non-persistant stuff. Will have to check it when I get home to be sure as I haven't tried this.




www.linkedin.com/img/webpromo/btn_viewmy_160x25.gif
#2
01/29/2007 (2:54 pm)
It is perfectly valid to load multiple txscene (xml) files in TX but TGBX doesn't support that at this time. So if you are comfortable not editing in TGBX you can totally leverage multiple xml files. Otherwise look into the persistent options Jonathan metntioned.

#3
01/29/2007 (11:12 pm)
Ok great thanks, thats a load off my mind ;)
#4
01/30/2007 (10:24 am)
@Ben - You can have multiple levels in one tgbx project however. Couldn't he just basically build them all seperately in TGBX and set the persistant ones in the first level and mark them as persistant? Is there a different way to achieve this that you are talking about?




www.linkedin.com/img/webpromo/btn_viewmy_160x25.gif
#5
01/30/2007 (5:45 pm)
Yes, you can have multiple .txscene in a project but you can't load multiple .txscene at once. The currently viable solution is to either leverage persistence options or load multiple .txscene files from within the code itself.

#6
01/30/2007 (6:23 pm)
OK. That's what I thought and was misunderstanding what you meant.



www.linkedin.com/img/webpromo/btn_viewmy_160x25.gif