There seems to be a small bug (or I'm using the wrong syntax) with context %actor.id% and rooms.
Here's the set up. Suppose I want to store a variable in the room, and my trigger in storing the variables have this line:
context %actor.id%
set myvariable blahblah
global myvariable
context 0
When players trigger this, statting the room gives
myvariable:154: yes
myvariable:28: no
i.e. the first player with player ID 154 has stored the value yes in the room, and the second player with player ID 28 has stored the value no in the room.
Now, suppose I want to check the value stored by the respective players, when neither of the players are in the same room.
context %actor.id%
set roomnum 75000
if %roomnum.myvariable% == yes
%echo% yes, %roomnum.myvariable%
else
%echo% no, %roomnum.myvariable%
endif
context 0
However, this doesn't work as well as it expects.
I have the following cases.
If only ONE player, let's call it player A stores the value yes in the room, this trigger activated by player A will echo yes. Success!
If player A *first* stores the value yes, and player B *then* stores the value no, then player A activating the trigger will trigger a no, and says the value no is stored. Player B activating the trigger will trigger a no, and says the value no is stored.
If player B *first* stores the value no, and player A then stores the value yes, then player A activating the trigger will trigger a yes, and so will player B activating a trigger.
So it seems that the following snippet of code, will give the value of myvariable in that room which has been stored by the last player activating it
Thus, I am unsure whether it's a syntax problem, or a small bug.
Motivation for this: Could check if player's action in a room (pulled lever, etc) causes changes in another place (eg gate opens), *only* for the player itself. So if a player spends 20 mins and figures out something, he gets free access, but another player would be stuck.
Could anyone comment on this if they know more? Thanks!
PS. I'll try to pose a workaround to this in the next post.