init

final_realms_fluffos_v1/lib/doc/man/local/lfun/room/init · 558 B

From the archive final_realms_fluffos_v1.zip

Download the archive   « Back to the archive contents

init()
Called when every someTHING enters the room
Used to add_action's to a room.
example:

void init()
{

  add_action("do_bing","bing");    
  ::init();
}

int do_bing(string str)
{
    notify_fail("Bing what ?");
    if(str != "bong") return 0; // notify_fail printed if no other "bing" actions
    else
    {
        write("bong!\n");
        return 1;   // return 1; (no "what??")
}
Note, don't assume the thing entering will be a player.
If you need an object, use event_enter() rather than init()
(this_player() won't always get the correct person)

Site Stats

Snippets: 1791
Codebases: 571