Savestate doesn't load correctly...

Talk about making games.

Savestate doesn't load correctly...

Postby StarFishDesign » Sat Dec 10, 2005 11:49 am

I create a savestat file for reloading the score and therefore the actual position in the game:

When level1 exists i run following script:
saveVars("save.dat", "Savestate");
LoadGame("level2.dat");

On the beginning of level2, when the counter is created i run the following script:
loadVars("save.dat", "Savestate"); element_Score.textNumber = ScoreCounter;

But the counter is always showing zeroes when loading the next level

* ScoreCounter is my integer var for the score, which will be saved in the group Savestate.


By the way:
Is there an "if exist" routine available in GE?
I remember "if exists filename" on amiga... But how does it work in GE?

The score and therefore the last finished level should be loaded only if file"save.dat" exists.

Any help?
Regards
--
www.starfishdesign.at | Webdesign & Gamestudio
ironfury | the menace | Space Shoot'em up for WindowsMobile
User avatar
StarFishDesign
 
Posts: 39
Joined: Sun Dec 04, 2005 7:27 pm
Location: Austria
Score: 0 Give a positive score

Postby Novice » Sat Dec 10, 2005 2:03 pm

When level1 exists i run following script:
saveVars("save.dat", "Savestate");
LoadGame("level2.dat");


If you ment "level1 exits" then i think that you should save vars before the game exits. If it is not a typo im afraid i cant help. :roll:
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score

Postby regine » Sat Dec 10, 2005 2:03 pm

Test this Script:

loadVars("save.dat", "Savestate");
textNumber = ScoreCounter;

Or:

saveVars("save.dat",, "Savestate");
LoadGame("level2.ged");
regine
 
Posts: 109
Joined: Mon Aug 15, 2005 7:19 pm
Location: Germany
Score: 1 Give a positive score

Postby StarFishDesign » Sat Dec 10, 2005 6:14 pm

Novice wrote:
When level1 exists i run following script:
saveVars("save.dat", "Savestate");
LoadGame("level2.dat");


If you ment "level1 exits" then i think that you should save vars before the game exits. If it is not a typo im afraid i cant help. :roll:


I've set a Timer... Level 1 exists after 1 Minute.
When the Timer reaches this limit, the Savestate will be saved as written above, after that level 2 will be loaded.

The file "save.dat" will be saved, but not loaded correctly on Level 2.
Regards
--
www.starfishdesign.at | Webdesign & Gamestudio
ironfury | the menace | Space Shoot'em up for WindowsMobile
User avatar
StarFishDesign
 
Posts: 39
Joined: Sun Dec 04, 2005 7:27 pm
Location: Austria
Score: 0 Give a positive score

Postby StarFishDesign » Sat Dec 10, 2005 6:15 pm

regine wrote:Test this Script:

loadVars("save.dat", "Savestate");
textNumber = ScoreCounter;


The variable name is missing in there - isn't it?
Regards
--
www.starfishdesign.at | Webdesign & Gamestudio
ironfury | the menace | Space Shoot'em up for WindowsMobile
User avatar
StarFishDesign
 
Posts: 39
Joined: Sun Dec 04, 2005 7:27 pm
Location: Austria
Score: 0 Give a positive score

Postby makslane » Mon Dec 12, 2005 12:20 pm

I have checked the saveVars and loadVars functions and I have found no errors.
Please, make sure are you using the correct variable to save and load, and call the loadVars in some action.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest