W
Wild_West
Guest
I took a break from my platformer game to work on something else for a bit but now I'm back at it and can't understand why my saving/loading setup isn't functioning right.
Specifically this part :
There'a a lot more that's included but it's just extra values to re initialize / load when I select to load the save data.
Which I haven't really been able to test because I can't get past this first part.
The way my game is setup you have to collect a treasure in each stage to proceed to unlocking the next stage, and there's a global score variable that keeps track of how many of these treasures you have so far.
So for example a treasure value of 1 will unlock stage 2, treasure value of 2 unlocks stage 3 and ect.
This value is supposed to of course reset any time a new game starts but it isn't.
I can tell because I look at the ini file and it says in the treasure section, the first key has a value of 1 already even though I initialize it to zero.
When I load the game save file however, I STILL can't get into stage 2 despite the treasure value variable being 1 already. So I don't know what's going on.
I read about the file system but just couldn't get what they meant by save area vs file directory since I checked my local app data folder and there wasn't any file there.
I put the game save file in that folder, and still no change.
The file is included in my resources tree also.
Specifically this part :
Code:
if(new_game_file == true)
{
//Overwrite saved file
show_message("Starting New Game");
file_delete("Game_info.ini");
//empty the collected treasures values
for(empty = 0; empty < array_length_1d(global.collection); empty ++)
{if(global.collection[empty] != 0)
global.collection[empty] = 0;}
Which I haven't really been able to test because I can't get past this first part.
The way my game is setup you have to collect a treasure in each stage to proceed to unlocking the next stage, and there's a global score variable that keeps track of how many of these treasures you have so far.
So for example a treasure value of 1 will unlock stage 2, treasure value of 2 unlocks stage 3 and ect.
This value is supposed to of course reset any time a new game starts but it isn't.
I can tell because I look at the ini file and it says in the treasure section, the first key has a value of 1 already even though I initialize it to zero.
When I load the game save file however, I STILL can't get into stage 2 despite the treasure value variable being 1 already. So I don't know what's going on.
I read about the file system but just couldn't get what they meant by save area vs file directory since I checked my local app data folder and there wasn't any file there.
I put the game save file in that folder, and still no change.
The file is included in my resources tree also.