Contents | Index | < Browse | Browse >
7.6. Transition Routines
ADL has an internal structure known as the Transition
Vector. This structure is a list of ten verb IDs and is set
and used by the following routines. These routines are typ-
ically used in the ACTION routines of rooms in scenarios in
order to move the player around.
$setv ( $setv verb1 verb2 verb3 ... verb10 ) -> No return
value. Initializes the Transition Vector to the
list of verbs verb1 verb2 verb3 ... verb10.
Example:
($setv north south east west ne se nw sw up down)
$hit ( $hit obj loc1 loc2 loc3 ... loc10 ) -> No return
value. Scans the Transition Vector for a match with
the current Verb. If found, obj is moved to the
corresponding loc. Nothing happens if no match is
found. An attempt to move an object to location 0
(.ALL) is ignored.
Example:
room1(ACTION) =
($hit .ME room2 room3 room4 0 0 0 0 0 0 0)
;
$miss ( $miss rout1 rout2 rout3 ... rout10 ) -> No return
value. Scans the Transition Vector for a match with
the current Verb. If found, the corresponding rout
is called. Nothing happens if no match is found.
An attempt to call routine 0 does nothing.
Example:
cg = ($say "You can't go that way.n")
room2(ACTION) =
($miss 0 0 0 cg cg cg cg cg cg cg)
;