0
\$\begingroup\$

In my game there are variables that go through all rooms, so if the player leaves the "variable x" worth 10, and goes to another room, when he returns there is the "variable x" worth 10, same thing when he close the game by the button (exit) that I created in the main menu.

It turns out that if for some reason he closes the game by the "close button of windows", this variable is not saved.

enter image description here

This is clear because there is no command for it to happen, it happens that I did not find anything related to the "physical button close windows window" in the game maker.

Detail that my game is not full screen, but if there is no way to create an event in the game maker so that the "variable x" is saved before closing, tell me how do I delete the "physical buttons of the windows window ".

I'm sorry for the awful translation, I'm not an English speaker.

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

You can use the Game End event in the "Other" section.

The Game End event executes any action inside before the game is closed. You can use it to save the value of any variable and store it on the disk.

On the other hand, you can use the Game Start event to read such value and set it in your game before the player can actually start playing.

Alternatively, if you want to keep it simple, you can just use the built-in Save/Load Actions; you can save on Game End and load on Game Start.

In other words, what you need to implement is just an auto-save/load functionality for your game.

\$\endgroup\$
1
  • \$\begingroup\$ Thank you very much. Auto-save is something I plan to implement further. \$\endgroup\$ Mar 25, 2018 at 19:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .