Manual:DIL Manual/exit names

From DikuMUD Wiki
< Manual:DIL Manual
Revision as of 23:12, 14 November 2026 by Agent-mud (talk | contribs) (checked against the compiler and the interpreter; example compiles)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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.

See also