User Tools

Site Tools


dev:object_fields_key_value

Key Value fields

Those fields are not part of the Object or Stats structures of struct obj {} object; but used through the key / value mechanism in that struct.
See page Object Fields about struct obj .

This mechanism seems to be a fallback handler for new and unknown attributes listed in .arc archetype files.

File server/include/object.h :

/**
 * Each object (this also means archetypes!) could have a few of these
 * "dangling" from it; this could also end up containing 'parse errors'.
 *
 * key and value are shared-strings.
 *
 * Please use object_get_value(), object_set_value() from object.c rather than
 * accessing the list directly.
 * Exception is if you want to walk this list for some reason.
 */
typedef struct _key_value {
    const char *key;
    const char *value;
    struct _key_value *next;
} key_value;
 
typedef struct obj {
/* lots of lines here */
  key_value   *key_values;    /**< Fields not explicitly known by the loader. */
} object;

key_values

Type: key_value *

Meaning:


List of key_value fields

Short incomplete list of various attributes(keys) of objects(archetypes) .

Alphabetically sorted keys and values are listed here: 1_index .

price_*

price_adjustment

price_adjustment_buy

price_adjustment_sell

Those control the price the item should have. They are a ratio from the item's raw value, and are applied without any bargaining / charisma / shop specialization effect.

Values should be a valid float (as recognized by atof).

If price_adjustment is set, it will override the other 2 keys. Else any of the 2 can be not set without any side effect.

divine_giver_name

For god-given items, name of the god that gave the item. Used to remove them if player switches cult.

divine_blessing_name

Specified god has blessed the item. Used to avoid accumulating blessings.

item_owner

Player owning the item, so other players can't bless it.
If set, the item can't be applied by another player unless he has enough experience (see item_willpower).

generator_code

For GENERATOR objects, a key to copy to generated monsters, so they can be tracked.

FIXME real flag

generator_max

For GENERATOR objects, the maximum number of generated monsters allowed at the same time.

FIXME ditto

generator_name

Name of the generator, used for generator_code value.
If unset will use generator's name, else generator.

FIXME

on_use_yield

Should be the name of an archetype. When containing object is applied,
this specific object is generated, and inserted at the same place as the containing object.
Used mostly for giving empty bottles when drinking stuff.

item_willpower

If set incombination with item_owner, an item will refuse to be applied by another player who doesn't have at least that much experience.

passenger_limit

For TRANSPORT , the maximum players can board at the same time.

FIXME real type

*_full

face_full

anim_full

For TRANSPORT, face to use when it's full.

*_speed

weight_speed_ratio

base_speed

Control the max speed of the TRANSPORT, based on the formula speed = base_speed - (base_speed * weight the transport is carrying * weight_speed_ratio) / (transport's weight_limit * 100

spell_expiry_warn_*

spell_expiry_warn_1

spell_expiry_warn_2

Those are used by spell effects, to store when player should be warned of effect expiration. Player will get a message when spell's duration reaches the first value, then the second. Will be set by the code automatically, should be a number parse-able via atoi().

dev/object_fields_key_value.txt · Last modified: 2018/04/13 04:07 by karl