Unable to create save state file

Posted by Rum Whiskers on Wed 29 Aug 2007 03:02 AM — 11 posts, 43,594 views.

#0
Now before you sigh and say "this has been discussed before", I did read the two previous topics that I found under SEARCH in relation to this topic but the solutions on those threads have not helped me so I thought I'd take a chance and discuss it here.

I'm brand new on Windows Vista and having problems saving my World on Achaea if I have absolutely any Plugins installed to the game. What I get is generally the same old:

Unable to create the plugin save state file: C:\Program Files\MUSHclient\worlds\plugins\state\8a5cbed3d63864419ff8caa4-c3fda3e0e77a5fbebf3c5e10-state.xml

The location its attempting to save does very much exist, I've tried moving it around and such but I'm never very savvy with MUSH yet to be trying any other tactics.

Is there something I'm forgetting to fiddle with or fix?

Thanks.
Australia Forum Administrator #1
You probably don't have write access to C:\Program Files\.

What I suggest you do is move (or copy) the plugins folder to somewhere else (if you want anything in it), such as My Documents, where you have write access, and then go to File -> Global Preferences -> Plugins, and change the Plugins Directory (click the button) to be the new location.
#2
Having the same problem as above, moved the plugins folder to my documents as suggested and still get the same error, even after changing the Global Preferences to the new folder. This has happened before when I reinstalled Mushclient after a crash and I have reinstalled it do a different drive, dont know if that is the problem or not, but it was originally on drive D: and now I moved it to C: and am getting this error as well.
USA #3
Try uninstalling, removing all the registry settings for MUSHclient, then re-installing within a user controlled folder. Some of Vista's security settings can prevent disc writing in certain non-user areas. Another option would be to have MUSHclient run with administrator privileges.
#4
I just started using Plugins and I discovered my variables within my Plugins have not been saving. I went through the forums here and this thread and tried what was suggested and now have the plugin and its saved state file (in the state folder) all on my desktop in a user folder, yet when I start up Mushclient, it doesnt seem to be loading the saved-state file.

I can open the saved state file and it has my variables, altered as I last had them, but I cant get the plugin to load the saved variables when I open the client again. I also moved a copy of the Constants.vbs file over to the folder also, since it asked for it when I tried to load the Plugins. Anything I can be forgetting? I have the plugin loaded into both the File > Plugins and also the Global preferences > Plugins section also.
Australia Forum Administrator #5
The save state file goes into the state subdirectory of the plugins directory (which is not necessarily where the plugins actually are). See Global Preferences -> Plugins for where this directory is defined.

Make sure it is a full pathname, otherwise if it is a relative path that may change, depending on where the current directory happens to be.

Is this a plugin you wrote? Perhaps the code for loading the data from the saved state file is not correct.
#6
Yes, it is a plugin I wrote using the wizard, this is it as follows, I cut out the triggers/aliases due to it being to long:


<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Monday, November 05, 2007, 6:46 PM -->
<!-- MuClient version 4.14 -->

<!-- Plugin "WhoAmI_Plugin" generated by Plugin Wizard -->

<muclient>
<plugin
   name="WhoAmI_Plugin"
   author="Jwild"
   id="029fd8fc54f3c5973ce312f8"
   language="VBscript"
   purpose="Allows color-coding of enemies and aliases and a search function."
   save_state="y"
   date_written="2007-11-05 18:43:09"
   requires="4.14"
   version="1.0"
   >

</plugin>


<!--  Get our standard constants -->

<include name="constants.vbs"/>

<!--  Triggers  -->

<triggers>
 <!-- trigger stuff here -->
</triggers>

<!--  Aliases  -->

<aliases>
<!-- Aliases stuff here -->
</aliases>

<!--  Variables  -->

<variables>
  <variable name="script_enemies"></variable>
  <variable name="script_allies"></variable>
</variables>

</muclient>



Also, the pathname was all correct, as when it saved out, it was writing the save file to the state folder.
Amended on Thu 08 Nov 2007 05:48 AM by Natasi
USA #7
well if the variables in question, that are not loading "properly" between sessions, are "script_enemies" and "script_allies" then I can see the problem right off the bat.

You are sure enough saving them in the state file, but when you re-import them again the empty ones located within the plugin file itself (not the state file) are clearing them.

You do not have to define the variables to be saved, ALL variables of "mushclient type" will be stored in the state file.

Remove the following lines...

<variables>
<variable name="script_enemies"></variable>
<variable name="script_allies"></variable>
</variables>

This should solve this issue.

-Onoitsu2
Amended on Thu 08 Nov 2007 06:57 AM by Onoitsu2
#8
Ahh, perfect, that fixed it, thank you! One question about that though, if I wanted a default variable, such as a colour that can be changed through an alias, but that color is referred to all the time, is there a way to set a default variable that over writes itself from the save state? Worried that if they never change the default color in the variable, it will not re-load itself. Not sure if that made sense
Australia Forum Administrator #9
I would do something like this in VBscript:


MessageColour = GetVariable ("MessageColour")

If IsEmpty (MessageColour) Then
  MessageColour = "Green"
End If


This substitutes "Green" if the variable is not in the save state file.

It is a bit simpler in Lua:


MessageColour = GetVariable ("MessageColour") or "Green"


This is because Lua returns nil if the variable doesn't exist, and the short-circuit boolean evaluation takes either the variable, or the default (in this case, "Green").
Amended on Thu 08 Nov 2007 07:23 PM by Nick Gammon
Australia Forum Administrator #10
My response didn't really address the question of setting a default MUSHclient variable. Maybe this:


If IsEmpty (GetVariable ("MessageColour")) Then
  SetVariable "MessageColour", "Green"
End If


And in Lua:


SetVariable ("MessageColour", GetVariable ("MessageColour") or "Green")