Skip to content

OLC Objects

Kit Oliynyk edited this page Nov 3, 2026 · 3 revisions

TL;DR: oedit edits an object prototype. Item type decides what the five value fields v0 to v4 mean, and show prints their meaning for the current type. Stat bonuses are affects added with addaffect. The old set obj and string obj commands are gone. Use when: you create or change an item, set its type values, add stat bonuses or skill bonuses, cap how many copies may exist, or need to change flags on a loaded item. Source of truth: plug-ins/olc/oedit.cpp, plug-ins/olc/ovalues.cpp (values per type), plug-ins/loadsave/affects.cpp (applying affects), plug-ins/fight_core/itemeconomy.cpp (weight and cost), src/core/object.cpp (getsValueFromProto). Verified: 2026-11-02 against dreamland_code a7c4fd10, dreamland_world a35c62ce

Entering the editor

oedit <vnum>
oedit create <vnum>
oedit create next
oedit show <vnum>
oedit load <vnum>
oedit delete <vnum>
edit object [...]
Form What it does
oedit <vnum> Opens the prototype. You need rights on that vnum.
oedit create <vnum or next> Opens an empty prototype. It exists only after done.
oedit show <vnum> Prints a prototype without opening the editor.
oedit load <vnum> Creates a copy of the item in your inventory, or on the floor if it cannot be picked up.
oedit delete <vnum> Flags the prototype as deleted. asave then leaves it out of the file.

oedit works on a copy. done stores it, cancel drops it: OLC.

Commands

Command Meaning
name, uaname, runame Keywords the player types (get sword).
short, uashort, rushort Short description. English has no article: "iron sword", not "an iron sword". Russian and Ukrainian use the Flexer case form, see Area-Format.
long, ualong, rulong Line shown on the floor.
sound, uasound, rusound Text shown by listen <item>.
smell, uasmell, rusmell Text shown by smell <item>.
ed, uaed, rued Extra descriptions, same as in rooms: OLC-Rooms.
type <item type> Item type (? item_table). Clears v0 to v4.
v0 to v4, or value0 to value4 Type values, see below.
level <0-120> Item level.
condition <0-100> Condition. 100 is perfect.
weight <0-10000> Weight. 0 means "use the computed weight".
cost <0-1000000> The highest price the item may have.
limit <-1..100> Global copy limit, see Limit.
extra <flags> Extra flags, toggled (? extra_flags).
wear <flags> Where it is worn, toggled (? wear_flags). Include take if the item can be picked up.
material <name> Material (? material). Drives fire, rust and vulnerability rules.
gender m|f|n|p Grammatical gender, one value for all languages.
addaffect, addgrant, delaffect Affects, see below.
random <best tier>, random clear Makes a weapon a random weapon, see below.
behaviors <names>, props <behavior> <prop> <value> Attach behaviors and set their properties.
fenia <trigger> Opens the trigger editor, see Fenia-Triggers.
oldbehavior, oldbehavior clear Legacy behavior XML.
copy param|desc|behavior <vnum> Copies one group of fields from another object.
list Rooms where the item is placed by a reset, and shops that sell it.
where Where live copies are now.
show, commands, done, cancel, dump Editor housekeeping.

Flag commands toggle. The editor prints the resulting flags.

Weight and cost

The server computes weight and cost from the item's stats (see Item-Power). The area file value is a bound on that:

  • weight above 0 overrides the computed weight. 0 means "use the computed one".
  • cost is the most the item may cost. The price used is the lower of the computed one and your number (and a global cap). An item with scripts and no stats the model can read keeps your number.

show prints the set value and the computed value side by side.

Values per item type

show prints the meaning of v0 to v4 for the current type. Setting a value takes the same kind of argument that show prints: a number, a flag name (toggled), a skill name or a liquid name.

Type Values
armor v0 armor class against pierce, v1 bash, v2 slash, v3 exotic (magic)
weapon v0 weapon class (? weapon_class), v1 number of damage dice, v2 sides of each die, v3 type of blow (? weapon_flags), v4 weapon flags (? weapon_type2, toggled)
container v0 capacity, v1 flags (? container_flags), v2 key vnum, v3 maximum weight of one item, v4 weight reduction factor
drink v0 total liquid, v1 liquid now, v2 liquid (? liquid), v3 flags (? drink_flags), v4 corkscrew vnum
fountain v0 total liquid, v1 liquid now, v2 liquid, v3 maximum people, v4 furniture flags
food v0 food hours, v1 full hours, v3 poisoned (any non-zero value)
furniture v0 maximum people, v1 maximum weight, v2 flags (? furniture_flags), v3 heal bonus, v4 mana bonus
light v2 hours of light
wand, staff v0 level, v1 total charges, v2 charges left, v3 spell
scroll, potion, pill v0 level, v1 to v4 spells
portal v0 charges, v1 exit flags (? exit_flags), v2 portal flags (? portal_flags), v3 destination room vnum, v4 key vnum
key v0 how long it stays in an inventory: 0 it rots when the carrier saves (quits), 1 it never rots, any other number is minutes. v1 non-zero: it rots on the ground
keyring v0 maximum number of keys
lockpick v0 lock type it opens (or the special "opens all" and "blank for key forgery" values), v1 quality
map v0 non-zero: does not rot in the inventory
money v0 silver, v1 gold
recipe v0 recipe flags (? recipe_flags, toggled), v2 complexity
spellbook, textbook v0 total pages, v1 used pages, v2 best quality, v3 and v4 spell or skill taught

Other types (treasure, trash, gem, jewelry, boat, tattoo, warp_stone, clothing, parchment and the rest) answer "Value not used" in oedit. Their fields are stored in the area file and are changed by editing the file: see Area-Format.

For weapons, the class (v0) and the type of blow (v3) of a loaded copy are always read from the prototype. For ordinary weapons the dice (v1, v2) are read from the prototype as well. Writing those fields on a loaded copy from a script has no effect. A script that must change them adds the permanent affects weapon_class and weapon_attack (see Affects).

Earrings, amulets and other trinkets may be of type jewelry rather than armor. A script that handles "armor or weapon" will skip them unless it names jewelry.

Affects

An affect is a bonus the wearer gets, or a flag the item sets. show lists them numbered from 0.

addaffect <location> <modifier> [<table or registry> <names>]
addgrant <skill> [<flag table> <flags>]
delaffect <number>

<location> is a name from apply_flags (? apply_flags): str dex int wis con cha level age mana hit move gold ac hitroll damroll saving_para saves saving_rod saving_petri saving_breath saving_spell size heal_gain mana_gain learned slevel beats sector_type bitvector weapon_class weapon_attack dice_number dice_size. <modifier> is a number.

The optional third word names what the modifier or flags apply to:

  • a flag table: detect_flags, affect_flags, vuln_flags, res_flags, imm_flags, weapon_type2, extra_flags, followed by flag names. The affect then sets those bits while the item is worn.
  • a registry: skill, skillGroup, liquid, wearlocation, followed by names.

Examples:

addaffect hit 50
addaffect hitroll 4
addaffect saves -3
addaffect none 0 affect_flags sanctuary
addaffect learned 10 skillGroup combat
addaffect learned -30 skill bless
addaffect level 2 skill fireball
addaffect slevel 3
delaffect 0

Bonuses to skills

The locations learned, level and slevel change how well the wearer knows or casts a skill. They affect players only.

Location Without a name With skill <name> or skillGroup <name>
learned Adds the modifier, in percent, to the knowledge of every skill. Adds it to that skill or to every skill of that group.
level Adds the modifier to the level of every skill the wearer uses. Adds it to that skill or group.
slevel Adds the modifier to the level of every spell the wearer casts. Not scoped.

Rules:

  • The registry names are skill and skillGroup. Older documentation wrote skills and skill_groups, which the editor no longer accepts.
  • A bonus to learned applies only to a skill the wearer already has (known at 1% or more). It never gives a skill. To grant one, use addgrant or a script.
  • The knowledge of a skill after all bonuses is limited to 0 to 100 percent.
  • Bonuses from several items add up.

Grants and flags

addgrant <skill> makes the item permanently confer that skill's affect on its wearer, so affects and identify can name it. It can carry a flag bit too: addgrant sanctuary affect_flags sanctuary.

addaffect weapon_class <class number> and addaffect weapon_attack <attack number> replace the class or blow type of a weapon (the modifier is the table index). The locations dice_number and dice_size change its damage dice. The location bitvector with a modifier of -1 removes the named bits instead of adding them, but only for the part_flags table. With any other table (affect_flags and so on) the bits are added.

Random weapons

random <best tier> marks a weapon as a random weapon with that best tier, removes all its affects and gives it the random weapon behavior. The server then rolls stats for each copy. random clear undoes it. Only weapons can be random. Resets can also ask for random stats, see OLC-Resets.

Limit

limit is the number of copies of this item that may exist at once in the whole world. It is not a spawn rate.

  • -1 means no limit.
  • With a positive limit, a reset that would create a copy does nothing when the world already holds that many. The count includes copies carried by players who are offline.
  • Items with a limit are scarce on purpose, so use it for the best gear. After all copies are claimed the item is simply absent until one is dropped, destroyed or lost.

The limit and maxHere numbers of a reset are another thing: they control how many mobs or items a reset creates. See OLC-Resets.

Changing a loaded item from a script

The old immortal commands set obj and string obj no longer exist. For a prototype use oedit. For one loaded item, a Fenia script can write the fields extra_flags, wear_flags and value0 to value4:

var bag; bag = ch.get_obj_carry("bag");
bag.extra_flags = .set_bit(bag.extra_flags, .tables.extra_flags.hum);
bag.wear_flags = .unset_bit(bag.wear_flags, .tables.wear_flags.take);

.set_bit, .unset_bit and .isset_bit work on a flag word. A flag name is .tables.<table>.<name>, and .tables.<table>.names(mask) returns the names set in a mask. These edits touch the loaded copy only, not the prototype.

Notes:

  • extra_flags is a full 32-bit integer and every bit is taken. A new extra flag needs an existing one to be repurposed.
  • Area XML stores flags by name. An unknown flag name in a file is skipped silently when the area loads.

See also: OLC, OLC-Resets, Item-Power, Area-Format, Fenia-API.

Clone this wiki locally