Save games and INI files

For questions about using Classic.

Post » Sat Aug 28, 2010 12:40 am

Hi everyone!
I am having on hell of a time figuring out this save game thing. From what I have read others have had the same problem. I am have a simple system by which a player has 100 health, then once it reaches 0 the death sequence starts. At the end of the death sequence the program saves all the stats, including the loss of one life, to an INI file. All of this works fine.

My problem comes when trying to get the player back to the start of the level so they can try again.

So I have a savegame that saves right when the layout starts, then an INI file loads in the previous stats including the players previous score and number of lives left. When i get to the death sequence and i try to load the game, it seems like the savegame also saves the state of the INI file. This is killing me! Can i save the state of the game, and somehow save external variables elsewhere? Is there something else I am missing? Does anyone have a good save sequence that works?

I have tried NOT using save/load games and just teleporting the player back to the start with fresh and updated stats. This actually gave the effect that i wanted, except the level state does not reset (broken cubes are still broken, doors are closed and locked etc.) I am not trying to let the player save progress, i just want to use the save to get the player back to the start of the level and not have to manually reinstate each and every object that has been altered. It is super buggy if i do it that way.

Any ideas would be greatly appreciated!
Thanks!
Nate
B
2
G
2
Posts: 15
Reputation: 680

Post » Sat Aug 28, 2010 12:57 am

If would help plenty if you would post a cap.

Anyway,try this
System-Goto Layout LayoutNumber
Which should reset the layout and all private variables and so on.
B
51
S
10
G
7
Posts: 184
Reputation: 6,825

Post » Sat Aug 28, 2010 1:24 am

Beautiful! That works like a charm! It allows me to maintain data in my INI and still reset the level! Perfect!

i will post a cap soon, but I am trying to hold off until i really have a decent playable version, until then I will just try to explain my problems the best that i can. I knew I was just missing something obvious!
B
2
G
2
Posts: 15
Reputation: 680


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest