Why can't I run code on world close?

Posted by Poromenos on Wed 06 Nov 2002 03:26 PM — 5 posts, 20,217 views.

Greece #0
I tried to run some code to save an array into variables, but it won't work. When i run it manually, or even on world_disconnect, it works fine. Just not on world_close. What's wrong?
Canada #1
You are talking about your main world's script file, not a plugin, correct?

Have you configured the subroutine to call in your "World Details | Scripting" configuration?
Greece #2
Yes, i have, and it does nothing... The OnPluginClose works perfectly though, which is what i needed it for. I wrote a plugin to log equipment damage, and it's ready, apart from the help file and the MUSHClient crash when i try to color text.
Australia Forum Administrator #3
The world close script is executed after the world is saved, thus moving things to variables then is too late.

However in a plugin use OnPluginSaveState to do that before the plugin's state is saved.
Greece #4
OK, I did that and it works now :)