Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Future Improvements (https://forums.graalonline.com/forums/forumdisplay.php?f=10)
-   -   Destructor Function (https://forums.graalonline.com/forums/showthread.php?t=78999)

Inverness 03-13-2008 02:49 AM

Destructor Function
 
I'd like it if there was a destruct() function that would be called before the engine destroys an object whether it be by destroy() or by garbage collection or anything else.

Naturally since its a function the engine would be waiting for destruct() to return before actually destroying the object.

Basically I want to do some cleanup for things that might have objects belonging solely to it.

At the moment I use a System.destroyobject(object/objectname); that is checking if the object exists before calling destroy() and also calling destruct() instead of destroy() where destruct() is cleaning up before destroying the object.

Admins 03-13-2008 12:07 PM

Or something like onDestroy?

Inverness 03-13-2008 02:18 PM

Quote:

Originally Posted by Stefan (Post 1379199)
Or something like onDestroy?

Thats what I had thought at first, and I would like it if the engine waited for it to finish before actually doing destroying the object.

Crow 03-13-2008 03:59 PM

I totally support this. Nice idea :D I dont have any use for it right now, but I'm almost 100% sure I will need that later.

Also, I know its off-topic, but please dont forget the 5 seconds delayed observer function Stefan :P

zokemon 03-13-2008 05:06 PM

Yeah, something like onDestroy would be good but it should be called, not triggered so that the object isn't destroyed until after the function execution.

Admins 03-13-2008 06:40 PM

Yes like the onPlayerLogout kind of, but would only work in the script of the object itself

zokemon 03-13-2008 09:09 PM

Quote:

Originally Posted by Stefan (Post 1379237)
Yes like the onPlayerLogout kind of, but would only work in the script of the object itself

But onPlayerLogout is triggered as it doesn't allow modification of the player with-in it (well and having the modifications be saved).

cbk1994 03-13-2008 10:15 PM

I totally support this idea, there are many practical uses.

Crow 06-17-2008 01:56 PM

BUMP!

I would like to have this feature added.

Programmer 06-22-2008 05:08 AM

Bump. So many practical uses for this!


All times are GMT +2. The time now is 05:55 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.