Save World Automatically On Close

Posted by Chyort on Mon 06 Apr 2015 04:05 AM — 5 posts, 18,640 views.

USA #0
Version 4.84

The "save world automatically on close" feature isn't working when i change a variable using an alias.


<aliases>
  <alias
   match="test *"
   enabled="y"
   expand_variables="y"
   send_to="12"
   sequence="100"
  >
  <send>Note ("Test is @test")
SetVariable ("Test", "%1")
Note ("Test is now %1")</send>
  </alias>
</aliases>

<variables>
  <variable name="Test">1</variable>
</variables>



The problem is, it is VERY sporadic. One second it will save, the next it wont, which makes attempting to replicate it mind numbing.

Made a completely blank new world, no plugins/anything.
Added that alias, and starting variable, then saved manually and closed.

Then

Open the world.
Change the variable.
Close the world.
Repeat

Sometimes the variable will save, sometimes it wont.


Any help would be appreciated.
Australia Forum Administrator #1
In Global Preferences -> Closing, do you have "Offer to save world if only variables have changed" checked?
USA #2
I have used it from time to time, but currently no.

I often multi 8 characters at once and dislike having to constantly deal with the dialog box that pops up.



I currently have Save("") tacked into my real variable setting alias, not the simplified tester i posted. But that is causing a conflict with my sync program, which likes to lock write access for a split second after a file changes. So if i try to change 2 variables somewhat fast i sometimes get a different dialog box telling me access was denied.

That however isn't a Mush problem, it is a sync safety feature that i don't see being changed. If i can reduce the frequency of saves though, i reduce the chances of a conflict with my sync program, bringing me back to the Save world automatically on close.
Amended on Mon 06 Apr 2015 01:48 PM by Chyort
Australia Forum Administrator #3
It appears that changing a variable does not mark the document as having changed, and thus it won't be saved. I think this is because of the option "only save changed variables". Instead of marking the document as changed, it marks the variables as having changed. Then it can test for just variables changing, and bypass saving the (world) document if that is the only change.

Now as a work-around you can delete the variable, which appears to mark the document as changed.

eg.


DeleteVariable ("Test")
SetVariable ("Test", "%1")
USA #4
As you said, a bit of a work-around. But it is still better than forcing potentially dozens of extra saves per world file.


And after a quick test on my end, it appears to be working.

Thanks Nick.