Skip to main content

event_enter

Discworld events help

event_enter

Name

event_enter - Called when objects enter the room.

Syntax

void event_enter(object ob, string message, object from);

Description

This is the function called on things when something enters their environment or themselves. The from argument is where the object came before it got to where it currently is. The message is the entrance message printed to the player when the thing enters. This message can be 0 and nothing will be printed. Also note, this message is processed using add_message, so it will not look very interesting if you just print it.

Examples:

void event_enter(object ob, string mess, object from) {
if (!ob->query_creator()) {
tell_object(ob, "And what do you think you are doing here????\n");
call_out("do_move", 0, ob);
}
} /* event_enter() */

void do_move(object ob) {
ob->move_player("X", "/d/am/am/mendeddrum");
} /* do_move() */

See also

move, event_exit, event_move_object, event_destruct