OnPluginSaveState() not firing upon world save

Posted by Madcatz on Mon 10 May 2010 06:40 PM — 3 posts, 12,786 views.

#0
If I'm not mistaken, a plugin saves its state when the world file is saved. Am I right there? I have the following in my plugin:

function OnPluginSaveState()
  Note("OnSaveState")
  require "serialize"
  SetVariable ("captures", "captures = " .. serialize.save_simple (captures))
  SetVariable ("capturesecho", "capturesecho = " .. serialize.save_simple (capturesecho))
  SetVariable ("capturesordernums", "capturesordernums = " .. serialize.save_simple (capturesordernums))
  SetVariable ("capturesordernames", "capturesordernames = " .. serialize.save_simple (capturesordernames))
end

When I save the world file (either by clicking on the disk icon, or by going to file->save world details, I'm expecting to see the note "OnSaveState", but I can never get that to show, so I'm assuming this block of code never runs. Am I just missing something here?
Australia Forum Administrator #1
In the plugin header, make sure "save_state" is set to "y". For example:


<muclient>
<plugin
   name="Sellall"
   author="NeoFryBoy(Tealos)"
   id="9b5d0352809c46c0900aec6f"
   language="VBscript"
   purpose="Since Aardwolf doesn't have a sell all feature I decided to add one."
   date_written="2006-06-25 01:45:49"
   save_state="y"
   requires="3.73"
   version="1.0"
   >

</plugin>

#2
Bah, knew it was something simple I was missing. I think I even found that the other day when I had the problem and forgot about it. Anyways, that did the trick. Thanks :)