Skip to main content

add_failed_mess

Discworld tmp help

add_failed_mess

Name

add_failed_mess - Failure message for use with add_command.

Syntax

void add_failed_mess(object dir, string mess, object *in_dir);

Description

This is used to set up a failure message for the objects when useing add_command. This gets all of the multiple short stuff correct and that sort of useful thing.

The message goes through a series of transformations. They are similar to the ones for add_succeeded_mess, the ones supported by add_failed_mess are as follows:

$DDirect object. Does a query_multiple_short on all the ones that return with the same message.
$IThe indirect objects. This is created from the indirect objects passed as the last parameter to add_failed_mess().
$VThe verb used.
Examples:

For an example of how to use add_failed_mess look at /obj/misc/torch.c

int do_light() {
if (lit) {
this_player()->add_failed_mess(this_object(), "$D is already lit.\n",
({ }));
return 0;
}
lit = 1;
return 1;
} /* do_light() */

See also

add_succeeded_mess, add_command, add_succeeded