Goettsch wrote:you already made this question and lcl already asked it,it is impossible to do what you want
viewtopic.php?f=2&t=13134
knucklecrunchgames wrote:Goettsch If your so quick to reply lecturing me then explain how you do it.
skydereign wrote:knucklecrunchgames wrote:Goettsch If your so quick to reply lecturing me then explain how you do it.
All Goettsch is saying is If you already asked a question don't create another topic about it. It is okay to bump the other topic if you didn't get the answer you wanted. That being said if I understand your question, I don't think this is exactly a repeat (though I feel you should have posted it on the other topic). To answer your question you would have one save file (created via saveVars). In addition to saving the player's position, you also need to save which level file they are in. That means every time they transition to a new level file (the new .dat) you must save the name of that .dat, that way in the menu when you want to load a save file you can use LoadGame on that saved file name.
knucklecrunchgames wrote:I think I half understand it, but can you make it a bit more simple for me to understand,
skydereign wrote:knucklecrunchgames wrote:I think I half understand it, but can you make it a bit more simple for me to understand,
You understand how to save the player's position in a single .dat file already. All you do is save the variables, that way when you load up the dat file you can load the saved variables and update the player's position to the correct spot.
Now that you have multiple .dat files for the multiple levels, you need to also remember which level file the player is in. To do this you can have one more variable that you keep track while saving and loading. This variable holds the name of the .dat file the player is currently in.
The player starts a new game. As the game loads it saves the name of the file into your save file. If the player wants to take a break, they exit the game and you save their position within the level. Now the player starts the game and selects load game. In the menu it loads the save file and now has the name of the file it needs to load, and calls LoadGame on it. The player then beats the level and moves onto the next one. Just like with level one when the player enters the level it saves the name of the current level file into your save file. That's it.
knucklecrunchgames wrote:I'm so sorry to waste your time sky, but I still don't understand it.
Where and what codes do I put in, Again, so sorry for wasting your time
skydereign wrote:knucklecrunchgames wrote:I'm so sorry to waste your time sky, but I still don't understand it.
Where and what codes do I put in, Again, so sorry for wasting your time
What part don't you understand? The idea is almost exactly like saving the player's position in a file (something that you said you did understand). The only difference is to create one more variable that holds what game file the player is in.
knucklecrunchgames wrote:I there any ged that explains it or tutorial.
skydereign wrote:knucklecrunchgames wrote:I there any ged that explains it or tutorial.
No, because all it takes is one line. Do you know anything about strings?
knucklecrunchgames wrote:no. what do strings do?
strcpy(string_variable, "nameoffile.dat");
// now saveVars will save string_variable into the save file
// now saveVars will save string_variable into the save file
knucklecrunchgames wrote:Does this mean when you press load game it will load the dat the player saved on?
skydereign wrote:knucklecrunchgames wrote:Does this mean when you press load game it will load the dat the player saved on?
Think about it. When you call LoadGame you pass in a string holding the file name of the file you want to load. I told you how to store a string into a variable so that you can save it. To access that variable so you can use it for LoadGame, you'll have to call loadVars. You should reread my posts and see if you understand what I was telling you now.
Users browsing this forum: Google [Bot] and 1 guest