Contents | Index | < Browse | Browse >
7.1. Object Routines
These routines operate primarily on Objects. They move
Objects around, find Object properties, and set Object pro-
perties.
$loc ( $loc obj ) -> The location of obj.
Example:
(IF ($eq ($loc .ME) volcano) THEN
($say "You are fried to a crisp.n")
)
$cont ( $cont obj ) -> The first object which is contained
in obj.
Example:
(IF ($eq ($cont .ME) 0) THEN
($say "You are empty-handed.n")
)
$link ( $link obj ) -> The next object contained in the
same location as obj.
Example:
($setg obj ($cont .ME))
(WHILE @obj DO
($say ($name @obj) "n")
($setg obj ($link @obj))
)
$ldesc ( $ldesc obj ) -> The long description of obj. This
is equivalent to ($prop obj LDESC). Since this is a
Routine ID, it is typically used as the callee in a
routine call.
Example:
($setg obj ($loc .ME))
( ($ldesc @obj) ) { Call LDESC of ($loc .ME) }
$sdesc ( $sdesc obj ) -> The short description of obj.
This is equivalent to ($prop obj SDESC). Since this
is a Routine ID, it is typically used as the callee
in a routine call.
Example:
($setg obj ($loc .ME))
( ($sdesc @obj) ) { Call SDESC of ($loc .ME) }
$action ( $action obj ) -> The ACTION routine of obj. This
is equivalent to ($prop obj ACTION). Since this is
a Routine ID, it is typically used as the callee in
a routine call.
Example:
( ($action .ME) ) { Call ACTION of .ME }
$modif ( $modif obj ) -> The modifier of obj. This is zero
if there is no modifier, negative if the modifier is
a Verb, and positive if the modifier is an Adjec-
tive.
Example:
(IF ($eq ($modif [ blue ball ] ) blue) THEN
($say "$modif works!n")
)
(IF ($eq ($modif [ north wall ] ) ($minus 0 north)) THEN
($say "$modif still works!n")
)
(IF ($eq ($modif room1) 0) THEN
($say "$modif comes through one more time!n")
)
$prop ( $prop obj num ) -> The numth property of obj.
Example:
($setg obj ($loc .ME))
(IF ($prop @obj VISIT) THEN
($say "I've been here before!n")
)
$setp ( $setp obj num val ) -> No return value. Sets the
numth property of obj to val.
Example:
($setg obj ($loc .ME))
($setp @obj VISIT TRUE)
$move ( $move obj loc ) -> No return value. Moves obj to
loc. WARNING: Do not attempt to violate the tree
structure of objects (e.g. ($move .ALL foobar)) or
horrible and unpredictable things will happen.
Example:
(IF ($eq @Verb north) THEN
($move .ME room2)
)