Man set names

From LSWiki

Revision as of 12:05, 11 June 2007; Laine (Talk | contribs)
(diff) ←Older revision | Current revision | Newer revision→ (diff)
Jump to: navigation, search

set_names - used to set the ids, short name and living name of an item/monster

Contents

Synopsis

varargs void set_names(string *base, string *known) /* /std/item */ void set_names(string *ids) /* /std/autonomon */

Files

   /std/item.c
   /std/autonomon.c

Description

Called within the configure() of an item or monster, set_names is used to initialize the id array of an item or monster. Additionally, the function sets a few other handy values, depending upon whether it is used within an item or monster.

Usage within an item:

set_names is used in place of set_id and set_short to define the identity array of the item. The first member of the array is set as the short description of the item.

In conjunction with set_code and set_identify_skills, set_names can be given two arrays, *base and *known. The first is an array of ids which are used for item identification by players without the required skills. The second array will be used if the player has at least one of the required skill levels as defined by set_identify_skills, and is not a necessary argument. The first entry in each array will also be used for short descriptions, eliminating the need for a separate set_short call.

Usage within a monster:

Used in place of set_id, set_short, and set_living_name, set_names will perform the function of all three. The entire array will be added to the monster's id array, the first entry used as both the short description and the string which is added to the hash table of living names. If you want your monster's short description to be different than that used during action messages, then you must use set_id and set_short instead.


Examples

Usage within an item:

   set_names(({"glowing sphere", "sphere", "ND"}));
   set_names(({"glowing sphere", "sphere", "ND"}), ({"Sphere of the Gods"}));


Usage within a monster:

   set_names(({"Remedios the Ancient", "remedios", "nyad"}));
   
   /* alternative method */
   set_id(({"Remedios", "remedios", "nyad"}));
   set_short("Remedios the Ancient");
   set_living_name("remedios");

See Also

set_living_name(efun), set_id(lfun), set_short(lfun)

Personal tools