SUGGESTION: on_close_game

Started by Joe, Mon 04/05/2009 14:33:37

Previous topic - Next topic

Joe

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
Copinstar © Oficial Site

GarageGothic

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.

Pumaman

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.

Trent R

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
To give back to the AGS community, I can get you free, full versions of commercial software. Recently, Paint Shop Pro X, and eXPert PDF Pro 6. Please PM me for details.


Current Project: The Wanderer
On Hold: Hero of the Rune

monkey0506

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.

SMF spam blocked by CleanTalk