Question about separate game files, and making doors...
Posted:
Wed Jul 28, 2010 10:37 pm
by pizbi
When making my game I was going to make it where there was a map(but as a separate game data then the levels) and I wanted to make where each time you finish a level it goes to the map and unlocks a new level but every time it loads wouldn't everything in the map reset? so how would I make it so the map would unlock another level after finishing a level if they're 2 separate games? I alos wanted to know how to make doors were you push the up key or something and change location (but in the same game) without having to make each door a different actor (if possible) -
Re: Question about separate game files, and making doors...
Posted:
Thu Jul 29, 2010 1:18 am
by Game A Gogo
There's two possible way to do this.
the first method would be using the SaveVars/LoadVars function with GE.
-Create a variable that will hold what level has been accomplished and make sure to place a save group
-at the end of the level, before loading the map,set your variable to the level number plus one (To say the next level will now be active), save your variables with saveVars("Filename",SaveGroup);
-On the map, make sure to create the exact same variable from your level file
-Make the level active depending on the variable and the level numbers, like with an if statement if(ActiveL>2)//Activate level2 script here
Note: This is like if it saves the game so the person can resume the game later when he loads the map file and the file containing the variable is present. To prevent this would be simply reseting the variable and saving it before exiting the map
the second method is more complex, which involves manually saving a file by creating a function to save/load files and set a variable. A longer detour
Re: Question about separate game files, and making doors...
Posted:
Thu Jul 29, 2010 5:05 pm
by pizbi
Game A Gogo wrote:There's two possible way to do this.
the first method would be using the SaveVars/LoadVars function with GE.
-Create a variable that will hold what level has been accomplished and make sure to place a save group
-at the end of the level, before loading the map,set your variable to the level number plus one (To say the next level will now be active), save your variables with saveVars("Filename",SaveGroup);
-On the map, make sure to create the exact same variable from your level file
-Make the level active depending on the variable and the level numbers, like with an if statement if(ActiveL>2)//Activate level2 script here
Note: This is like if it saves the game so the person can resume the game later when he loads the map file and the file containing the variable is present. To prevent this would be simply reseting the variable and saving it before exiting the map
the second method is more complex, which involves manually saving a file by creating a function to save/load files and set a variable. A longer detour
oh, okay! now that gives me a better idea of what I can do!
Re: Question about separate game files, and making doors...
Posted:
Thu Jul 29, 2010 5:36 pm
by Game A Gogo
if you stumble upon a problem along your way,don't hesitate to ask!