[Package Index | Mudlib Index | Effect Index]
.
void chat_off()This stops the object chatting. This is done automaticly when leaving the prescence of all interactive objects.
void chat_on()This starts the object chatting. This is done automaticly when entering the presence of an interactive object
void check_chat()This method makes sure that we are chatting if we should be.
string fix_saved_chat(string chat)Fixes saved chats
void item_chat(mixed * args)This method adds atmospheric chat messages to the object. The array which is passed into the object has three elements, the first element is the minimum time between chats, the second parameter is the maximum time bewteen chats and the third parameter is the list of actual chats.
Item chats are strings which are printed at (semi) random intervals to living objects holding or in the same room as someone holding the object. Currently they will not be heard outside containers. They are used to add atmosphere to an Item. A chat will be picked at random from the array of chats with a frequency controlled by the times min and max. ie. one will be picked every n seconds where is varies between min and max seconds. Please don't make the values for min and max too small or the messages just become annoying!
Currently, there's a maximum on the min/max values, every value higher than 320 seconds is treated as that.
The chats can contain one of $a_short$, $the_short$ and $poss_short$ which will be replaced with the corresponding value.
To call a function defined on the item in place of a chat message use "#function_name" in place of a chat string.
To use languages in item chats you start the string with a '%%'. Then the language, followed by another '%%'. After that should be two more strings, first being the start message the second being the string to mangle.
To use item chats, the object needs to inherit "/std/basic/item_chat" and if the object defines an init() function, that function should also call ::init()
To make the chatting object save the values, it's necessary to define a couple of supporting functions in the item:
mapping query_dynamic_auto_load() { mapping tmp; tmp = ([ "::" : object::query_dynamic_auto_load(), "chat" : item_chat::query_dynamic_auto_load(), ]); return tmp; } /* query_dynamic_auto_load() */ void init_dynamic_arg(mapping map) { if (map["::"]) object::init_dynamic_arg(map["::"]); if (map["chat"]) item_chat::init_dynamic_arg(map["chat"]); } /* init_dynamic_arg() */Use object in the previous if the object is inheriting /std/object, if not, then use whatever it's inheriting from instead.
item_chat( ({ 120, 240, ({ "A revolting smell drifts from $the_short$.", "Something rustles in $the_short$." }) }) );
void make_chat()This method does the actual chat, it prints a message and figures that stuff out.
mixed * query_chats()