Isn't this making things more complicated than they need to be? Plugins already save their variables (if save_state = "y") so all you need to do is serialize script variables into MUSHclient variables in the OnPluginSaveState script callback, and then it all happens automatically. No need to push the variables into the main world and have it save them.
I'm just looking for ways to simplify what's in my world file. I'm serializing all mushclient variables from the same scripts into a single variable, and reducing aliases to a single one and parsing them through lua instead.
Currently I use an alias to save plugin variables to the world, but this was something else I was hoping to remove the need for. Not possible then?
This is by design. The whole idea of plugins is that they are supposed to be self-contained, and thus have their own:
Script space (including script language which can vary from plugin to plugin)
Script variables
MUSHclient variables (which are saved and restored if "save state" is specified)
Triggers
Aliases
Timers
If you were able to set a world variable (that is, in the "main world" variables space) then if different plugins chose to set the same variable name (eg. "counter" or "target") then they would interfere with each other, and also interfere with any main-world scripts or triggers/aliases etc.
The question is, why do you want to do this? There are work-arounds by making a plugin send to "execute" some text, which the main world can capture as an alias. Also, the main world can access a plugin's variables. So if you really need to talk to a plugin, the main world script can find out a plugin's variable, rather than the plugin setting the main world's variables.
I have my system in a plugin. I store all my lua variables in a MUSHclient variable. What I'm looking to do is then store that MUSHclient variable in the world, not the plugin. I know a number of ways around it, but all require something to be added to the world itself. Is there any way at all to do it from the plugin itself?
I've tried looking for a function such as SetPluginVariable or SetWorldVariable, but I can't find one. I've tried setting it on the world with setting x as the world and using x:SetVariable. Nothing seems to work.
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.