Manual:DIL Manual/exit names
Jump to navigation
Jump to search
Contents
exit_names
Field (stringlist, read/write; units: rooms).
rm.exit_names[dir] : stringlist
The names of the door or opening in direction dir (NORTH, EAST, ... SOUTHWEST, 0 to MAX_EXIT, in vme.h): what a player types to open, close, lock or unlock it. It is the exit's keyword list in the zone file; empty for a plain exit. The first name is the one the commands show: rm.exit_names[dir].[0].
Notes
- Assigning a stringlist replaces the names, e.g.
rm.exit_names[NORTH] := {"gate", "iron gate"};. Assigning null empties it. - The other side of a door is a separate exit with its own names.
- Rooms only. On another unit or null, with a direction out of range, or where the room has no exit that way, it fails.
Example
dilbegin integer door_dir(rm : unitptr, word : string);
var
dir : integer;
code
{
dir := 0;
while (dir <= MAX_EXIT)
{
if ((rm.exit_to[dir] != null) and (word in rm.exit_names[dir]))
return (dir);
dir := dir + 1;
}
return (-1);
}
dilend
Finds the direction of the door with a given name, -1 when there's none, as the door commands in basemove.zon do.