
TO_OBJECT(2)               silmul_efun               TO_OBJECT(2)

名稱
     to_object - 把字串轉換為物件

語法
     object to_object(mixed target);

描述
     (The following description is taken from Truilkan's comments
     in the source file.)

     Purpose: Converts a string into the  object  it  represents.
     This object
      is intended to be used as a parser by those wizard commands
     that need
      to refer to objects by various  means  (such  as  dest  and
     trans).

     to_object() returns the object that a  given  string  refer-
     ences.     Strings    are    of   the   form   'object'   or
     'object@environment' where environment can also  be  of  the
     form  'object@environment'.   object may also be of the form
     'e(object)' which refers to the environment of object.

     object may optionally be prefixed with one of the  following
     symbols:

      !  (what follows names an object that is not an  NPC  or  a
     player)
      %  (what follows names a player)
      $  (what follows names an NPC)
      #  (what follows is an ordinal value, e.g. #3, #4, etc)
      /  (what follows is a filename of an object)

     object may also be one of the words  "here"  or  "me"  where
     here  refers  to  the  environment  of  this player and "me"
     refers to this_player().

     例子

        object obj;

       // find the object which has an id of "key" and is in player
       // truilkan's inventory.
       //
       obj = to_object("!key@%truilkan");
       //
       // find the orc NPC which is in the bag which is in the church
       //


MudOS Release 0.9         Last change:                   3-19-93

TO_OBJECT(2)               silmul_efun               TO_OBJECT(2)

       obj = to_object("$orc@!bag@/room/church");
       //
       //  Destroy  the  4th  object  in  the  inventory  of  the
     environment of
       //  this player (0 is the first object :)
       //
       to_object("#3@here")->remove();

作者
     Ichabod@TMI (taken from Truilkan's comments), 3/17/93
     wade@future 4/8/1996 翻譯

Sun Release 4.1           Last change:                          2

