Windows Preventing closing the game.

U

Untouch

Guest
Sounds like a weird request.
I'm making a mod editor for my game, and whenever there's unsaved changes and the game is closed, I want a prompt to save the mod.

It used to (GM7) be possible to make the game close when pressing escape, then make pressing escape do nothing, so you couldn't close the game normally. I assume this was a glitch though, and not a feature.

I haven't found anything that suggests that this is possible though, and I'm wondering if it is.
Thanks.

Edit: Making it borderless is an option but I'd rather not for several reasons.
 

RangerX

Member
You can create your own "exit the game" with any conditions you need with the function "game_end()".
You can execute that function after the player agreed to some "are you sure you wanna quit" message or something the likes.
 

Yal

šŸ§ *penguin noises*
GMC Elder
I think you could do something like this in the Game End event:
Code:
done = false;
while(not done){
  rep = show_question("Unsaved changes! Wanna save them first?")
  if(!rep){
    done = true;
  }
  else{
    //Ask for a filename or something and save the data to that
  }
}
 
Top