When I want to play multiple sessions on the same mud, I just copy the .MCL into another new one and open 2 different sessions. That is working great.
I want some variables to be world(file) specific, which isn't happening like now. Lets say I have a (global?) variable named currentGainedXp, which incresas on each kill. I want somehow that session1 have its specific currentGainedXp value and session2 also have its specific currentGainedXp value. When I run with only one opened world, everything works great.
What is happening is that GetVariable("currentGainedXp") is returning a valid value from a random opened world.
How can I achieve that?
The vars don't need to be saved. I'll try to delete them under the Scripting -> Variables section and declare local to give it a try. I thought local vars would work only inside a function...
Ah, I meant just don't use SetVariable and GetVariable.
They would still be globals, just within that world file unless you put local in front of it.
ie:
a = b is global
local a = b is local
Using SetVariable let's you use a variable between/across sessions from any plugin or world file using GetVariable to call it. So like the problem you're having is it's setting/updating the same variable from two sessions. So it's being added to twice.
I want to have multiple alts playing in the same mud, at the same time. I'll be in one windows, which could me the 'main', and the others are playing by triggers. At some point, I want to check some variables from each alt, which in the case is each opened world, for example, how much xp each alt got.
I have all this info when playing one world only, but looks like I'm using global variables.