Simple way to save some attribute...
by Andrea Farid Marsili · in Torque Game Builder · 08/09/2010 (8:13 pm) · 4 replies
In my game I'll need to save only some attribute.
So you know some tutorial which explain how to save and load attribute or/and share it through different level?
Thanks to all
So you know some tutorial which explain how to save and load attribute or/and share it through different level?
Thanks to all
#2
Example in pseudocode
if "player" collide with "door"
export all $mygame variable into a file named "gamevars.cs"
And if I want to load this variable I must write this in my "loadGame" button code:
exec("gamevars.cs")
then if $mygame variable have value 1 (for example) go to level two.
Wrong?
08/10/2010 (7:57 am)
So if i want to save and then load some variables I only need to do this:Example in pseudocode
if "player" collide with "door"
export all $mygame variable into a file named "gamevars.cs"
And if I want to load this variable I must write this in my "loadGame" button code:
exec("gamevars.cs")
then if $mygame variable have value 1 (for example) go to level two.
Wrong?
#3
Have a main menu with new game, load game etc. When the person loads a new game then execute gamevars.cs
08/10/2010 (9:38 am)
Yes that's correct, but a better way would be doing it the way below just in case the person wants to start a new game.Have a main menu with new game, load game etc. When the person loads a new game then execute gamevars.cs
#4
08/10/2010 (10:31 am)
Yes I was talking about the LoadGame button. The NewGameButton will reset all the variables.
Associate William Lee Sims
Machine Code Games
If you need to save it across different runs of the executable, you can use export().