Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Joe on Mon 04/05/2009 14:33:37

Title: SUGGESTION: on_close_game
Post by: Joe on Mon 04/05/2009 14:33:37
I've been searching and I think this has not been asked before. So I decided to post it.

I think this function is necesary because of Dynamic sprites created from existing images. Since you can close the game pressing a key combination like: Alt+F4 or Ctrl+Alt+Del->End process or any other way. And I can't control this in order to delete those dynamic sprites.

If there is any other possibility to delete the sprites please tell me.

Thanks.


Joe
Title: Re: SUGGESTION: on_close_game
Post by: GarageGothic on Mon 04/05/2009 15:09:30
The non-deleted sprites are not really an issue since your operating system takes care of freeing up the memory once the game closes. Also, the whole point of killing the program with keyboard shortcuts like Ctrl+Alt+Del, Alt+F4 and Alt+X is that it allows you to quit whenever the game freezes (usually because of a scripting error). In such cases an on_close_game event would never be run anyway. A better solution to the problem would be simply make the engine only generate the error log when running in debug mode. There's no reason to worry end-users with something that's not even an issue.
Title: Re: SUGGESTION: on_close_game
Post by: Pumaman on Mon 04/05/2009 15:55:45
These warnings should not be generated if you use Alt+X/Alt+F4 to exit.

However, I also appreciate the point about not bothering players with this, so I will change it to only generate these warnings if Debug Mode is turned on.
Title: Re: SUGGESTION: on_close_game
Post by: Trent R on Mon 04/05/2009 16:58:32
Both of these have been suggested in the Wishlist thread, but I'd fully support the addition of a on_close_game, or rather as KhrisMUC puts it:
Quote from: KhrisMUC on Fri 20/02/2009 18:59:11
How about adding eEventQuitGame to take care of deleting DynamicSprites used in modules?
an EventOption would work much better.

I've run into a point where I would like to change some things before I quit the game (not dynamic sprites)

~Trent
Title: Re: SUGGESTION: on_close_game
Post by: monkey0506 on Tue 05/05/2009 05:45:50
Or rather as KhrisMUC someone puts it:

Quote from: monkey_05_06 on Mon 19/12/2005 18:11:25I'm proposing that a new value be added to EventType, eEventQuitGame.

::)

Although a game_quit or game_end function would be more in-line with game_start. :P

For the record, I'm still in favor of this being implemented.