MESSAGE MODULE

Introduction:


The message module exists to simplify and standardize messages in the LIMA mudlib. It is designed to replace code like the following:

write("You bing at "+target->query_name()+".\n");

tell_object(target, this_player()->query_name()+" bings at you.\n");

tell_room(environment(this_player()), this_player()->query_name()+" bings at "+target->query_name()+".\n");

Compare that to the following:

this_player()->targetted_action("$N $vbing at $t.\n", target);

The message module will create the appropriate messages and send them to the correct places. targetted_action can be called in any object which has inherited the MESSAGES module.


The Simple Interface:


Four routines make up the simple version of the message interface:

  1. simple_action(message [, object [,object] ] )

    for simple actions only involving the doer and optionally some objects (or strings, see below)

  2. other_action(message, [, object [, object] ] )

    same as simple_action, but only sends messages to the room

  3. my_action(message, ...)

    only send messages to the doer

  4. targetted_action(message, target [, object [, object] ] )

    for simple actions involving the doer, a target, and possibly some objects or strings

The appropriate routine should be called in the object that is actually _doing_ the action. If the message is actually an array of messages, one of the messages will be chosen at random.

Format for Messages


A quick note: If you want something capitalized, use the upper case version ($N) as opposed to $n.

Here are the variables that can be used in messages: