Skip to main content

add_exit

Discworld room help

add_exit

Name

add_exit - Adds an exit to the room.

Syntax

int add_exit(string direc, string dest, string type);

Description

Adds an exit to the room. The direction is the direction in which the exit should go. This is something like "north" or "enter gate". The destination field is where the player will go when they enter the exit. The type is a set type that sets a whole bunch of defaults for the room.

The types are controlled by /obj/handlers/room_handler.c. The current types and what this all means are:

roadWide road.
pathNarrower path.
doorAn exit with a door. Defaults to closed, not locked.
secretA secret door. Defauls to closed, not locked and not obvious.
gateA large door. Defaults to open, not locked.
corridorA corridor (bing).
hiddenA hidden exit without a door.

The room aliases are used to expand things for exits. However they don't expand the entire exit name. They expand it in bits. For instance, if the exit was "enter live eel", you could add_alias("eel", "live eel"); and add_alias("bing", "enter"); to get both of the bits of the exit. So "bing eel", "enter eel", "bing live eel" etc would work.

Example

add_exit("north", PATH+"market2", "road");
add_exit("enter live eel", PATH+"live_eel", "secret");

See also

modify_exit, query_dest_dir, remove_exit