Movechar

Main.Movechar History

Hide minor edits - Show changes to markup

December 31, 2008, at 06:09 PM EST by admin
Added lines 1-39:
      movechar - syntax: movechar(CH1,ROOM,options) 

Prog Types: Mob, Object, Room

Movechar is used to transfer a character or group to a different room without requiring an "actor". Movechar is mostly of use from within room or object progs. If the first argument is a CH variable, that character is targeted directly. If the first argument is "all", all characters in the room may be transferred if not filtered out by additional options (see below).

The second argument can either be a ROOM type variable or a room key. The options argument (optional) can be used to limit the targets selected. With the exception of SEEALL, these options are ignored if a CH type variable is given rather than a name:

  LP_PLRONLY Transfer can target mobs also. Use this option to restrict to players. 
  LP_MOBONLY Only mobs will be checked when a name is given or the target is "all". 
  LP_GROUP When used with a name or a CH variable, will cause all group members in the room to be transferred. 
  LP_NOERR Sometimes a mob will want to transfer a target if it is there, but no target is not considered an error. Set this option to suppress errors. 
  LP_ACTIVEONLY Only transfer target if they are in-game. Players in note or edit mode will be ignored. 


   --- Move the character from a "push button" trigger

   --- Trigger on room:
   --- 
   --- Trigger Type Program       Phrase             Actor
   --- ============ ============= ==================== ==============
   --- Command      tol-49        push button

   send(ch,"Ooops, you shouldn't have done that!")
   movechar(ch,"aylor-2")

   --- Alternative version:
   --- If something could make the player move rooms before this code is reached
   --- you may need to make sure they're still in the room.
   ---
   --- Remember that 'room' is always the room the prog fired in.
   ---
   if ch.room.key == room.key then
      send(ch,"Ooops, you shouldn't have done that!")
      movechar(ch,"aylor-2")
   end