HEART_BEAT(L)
NAME
heart_beat - called every 2 seconds in objects
SYNOPSIS
void heart_beat();
LOCATION
/obj/living.c, and can be placed in any object.
DESCRIPTION
When a true value is passed to set_heart_beat(E), then the driver
starts to call heart_beat() in that object every 2 seconds until
it is shut off.
This can be shut off by passing 0 to set_heart_beat, or will
be shut off if an error occurs.
NOTES
Try not to have objects with heart_beat running continuously. It
is rather costly in cpu usage. Instead, you might want to shut it
off if no interactive players are nearby.
If the object in which the heart_beat is running is living, then
everytime heart_beat is called, this_player() will return the
object. If it is not alive, this_player() will return 0.
Error messages, accordingly, will be either printed to the object
or to nobody.
If you just want to print out a message or two after some delay,
use the call_out(E) efun.
EXAMPLES
In some silly object.
object owner; /* An external variable */
void reset(int arg) {
if( !arg ) {
owner = this_player(); /* See NOTES above for reason */
set_heart_beat(1);
}
}
void heart_beat() {
tell_object(owner, "Your heart goes DUNK DUNK.\n");
}
SEE ALSO
set_heart_beat(E), call_out(E), enable_commands(E)
Help topics available:
You are guest number 121 since January 2020.
This file was last modified: June 2000.