Status variables

shandlia
26 Sept 2006, 14:20
I'm having a problem with status variables. The way I understand it is that if you want the variable to effect the entire game and all players it needs to be global if you want it player specific then you need it to be local, correct?

Now assuming this if I change my stat var to local such as strength etc. So that each player has different stats I get a subscript out of range error. Either I'm totally off on the way I'm seeing this or I'm missing something else. Can anyone please explain this to me?

Alex
26 Sept 2006, 15:40
You need to specify the user ID when updating the status variable. Local status variables are stored as arrays, so you need to use "health[userid]" rather than just "health", for example.

Elexxorine
26 Sept 2006, 15:46
ok, you're right glabal means for all peoples, local for each. You should keep a variable local or global through out the game though... Your strength should look a little like this, yes?
define variable <strength>
type numeric
scope local
value <5>
end define
Now in the multiplayer game, quest turns this into an array, with the index buing the userid, %strength[userid]%...

Double check you've defined it correctly... also if you don't need it displayed at the side, I sugeest not havinc it as a status variable but a normal array, which is defined by putting 'set numeric <strength[10]; 5>' in the start script, this'll set an array called sterngth with indexs of 0 to 10 for you, each set to 5.

If this doesn't help, send me your game and I can check for a possible cause. Hope this helps.