Recently I had an issue where my script was swapping targets after a player teleported. After some consideration, I realized I had followed an example on Welcor's DG script guide that was a little goofy:
http://www.builderacademy.net/Oasis_DG_pages/contents/wld_com_ex.htm#echoaround
Here was the code on a Command-type Room trigger that fired when someone went west:
%send% %actor.name% Your movement toward the door causes it to open quickly, and you step through into the next room:
%echoaround% %actor.name% The door to the west opens with a blast of air as %actor.name% steps into the next room.
%teleport% %actor% 113.80
%force% %actor.name% look
if (%actor.level% > 100)
%send% %actor.name% Immortal notification: Script has fired completely.
end
Using Barr (immortal, over level 100) and BarrJr to observe messages and whatnot, when Barr went west, it sent him the first message only. BarrJr was the player forced to look (even in a room separate from from the scripted room and the target room) and was sent the message inside the if statement. I realized that the script searches through the room for the first %actor.name% it comes across (the most recently arrived in the room) and uses that, and if there is no one matching that, it searches the world for the first players matching %actor.name% (most recently logged in).
In Welcor's world command example of %echoaround% it uses %actor.name% as the 'victim' for some of the lines, instead of just simply %actor%. Correcting that in my code solved the problem, since it searches for that player instead of a player with that name.
%send% %actor% Your movement toward the door causes it to open quickly, and you step through into the next room:
%echoaround% %actor% The door to the west slides open with a blast of air as %actor.name% steps into the next room.
%teleport% %actor% 113.80
%force% %actor% look
if (%actor.level% > 100)
%send% %actor% Immortal notification: Script has fired completely.
end
Anyhow, thought I'd pass this along so no one else made that mistake, and so that example might be updated.



