Difference between revisions of "Manual:Zone Manual/The Objects Section"
(checked against the current code (wiki review 2026-11-15)) |
|||
| Line 1: | Line 1: | ||
== The objects section == | == The objects section == | ||
| − | + | With rooms and NPCs alone you could build a world of naked people fighting with their bare hands. Objects fill it with everything else: weapons and armour for the NPCs, food and drink, keys, chests, boats and the junk lying about in the rooms. | |
| − | + | ||
| − | + | Objects go in the <code>%objects</code> section of a zone file. Like rooms and NPCs, each object is a symbolic name, then its fields in any order, then <code>end</code>: | |
| − | + | ||
| − | + | <pre> | |
| − | + | %objects | |
| + | |||
| + | big_rock | ||
| + | names {"big rock", "rock"} | ||
| + | title "a big rock" | ||
| + | descr "A big rock is lying in the road." | ||
| + | manipulate {MANIPULATE_TAKE} | ||
| + | weight 40 | ||
| + | end | ||
| + | </pre> | ||
| + | |||
| + | This page lists the fields an object can have and what each one does in the game. [[Manual:Zone Manual/The Objects Section/Object macros|Object macros]] shows the macros that set up weapons, armour, containers, drinks and the other kinds of objects; [[Manual:Zone Manual/The Objects Section/Building your first object|Building your first object]] walks through a complete object. | ||
| + | |||
| + | === Object fields === | ||
| − | |||
| − | |||
| − | |||
{| class="wikitable" | {| class="wikitable" | ||
| − | | | + | !Field |
| + | !Value | ||
| + | !Default | ||
| + | !What it is | ||
| + | |- | ||
| + | |<code>names</code> | ||
| + | |string list | ||
| + | |none | ||
| + | |The words players use to act on the object. | ||
| + | |- | ||
| + | |<code>title</code> | ||
| + | |string | ||
| + | |none | ||
| + | |The short name: "a big rock". | ||
| + | |- | ||
| + | |<code>descr</code> | ||
| + | |string | ||
| + | |none | ||
| + | |What players see when the object lies in a room. | ||
| + | |- | ||
| + | |<code>inside_descr</code> | ||
| + | |string | ||
| + | |none | ||
| + | |What players see when they are inside the object (a coffin, a boat). | ||
| + | |- | ||
| + | |<code>extra</code> | ||
| + | |string list, string | ||
| + | |none | ||
| + | |Descriptions to look at, special messages, and data for DIL. | ||
| + | |- | ||
| + | |<code>type</code> | ||
| + | |<code>ITEM_*</code> | ||
| + | |<code>ITEM_OTHER</code> | ||
| + | |The kind of object. Usually set by a macro. | ||
| + | |- | ||
| + | |<code>manipulate</code> | ||
| + | |<code>MANIPULATE_*</code> flags | ||
| + | |none | ||
| + | |Whether it can be taken, entered, worn (and where), wielded or held. | ||
| + | |- | ||
| + | |<code>flags</code> | ||
| + | |<code>UNIT_FL_*</code> flags | ||
| + | |none | ||
| + | |Unit flags: invisible, buried, magic, not saved... | ||
| + | |- | ||
| + | |<code>romflags</code> | ||
| + | |<code>OBJ_*</code> flags | ||
| + | |none | ||
| + | |Object flags. | ||
| + | |- | ||
| + | |<code>weight</code> | ||
| + | |number | ||
| + | |1 | ||
| + | |Weight in pounds, 0 to 32767. | ||
| + | |- | ||
| + | |<code>height</code> | ||
| + | |number | ||
| + | |180 | ||
| + | |Size in centimetres; decides who it fits. | ||
|- | |- | ||
| − | + | |<code>capacity</code> | |
| − | + | |number | |
| − | + | |0 | |
| − | + | |How many pounds it can hold, -1 to 32767 (-1 is endless). | |
|- | |- | ||
| − | | | + | |<code>value[0]</code> .. <code>value[4]</code> |
| − | | | + | |number |
| − | | | + | |0 |
| − | | | + | |Five numbers whose meaning depends on the type. Usually set by a macro. |
|- | |- | ||
| − | | | + | |<code>cost</code> |
| − | | | + | |money |
| − | | | + | |0 |
| − | | | + | |What it is worth in a shop. |
|- | |- | ||
| − | | | + | |<code>rent</code> |
| − | | | + | |money |
| − | | | + | |0 |
| − | | | + | |What it costs per day to keep it while logged off. |
|- | |- | ||
| − | | | + | |<code>open</code> |
| − | | | + | |<code>EX_*</code> flags |
| − | | | + | |none |
| − | | | + | |Whether it opens, closes and locks. May be followed by <code>difficulty</code> n. |
|- | |- | ||
| − | | | + | |<code>key</code> |
| − | | | + | |symbolic name |
| − | | | + | |none |
| − | | | + | |The object that locks and unlocks it. |
|- | |- | ||
| − | | | + | |<code>bright</code> |
| − | | | + | | -6 to 6 |
| − | | | + | |0 |
| − | | | + | |How much light it gives off. |
|- | |- | ||
| − | | | + | |<code>light</code> |
| − | | | + | | -6 to 6 |
| − | | | + | |0 |
| − | | | + | |Light inside the object. |
|- | |- | ||
| − | | | + | |<code>minv</code> |
| − | | | + | |number |
| − | | | + | |0 |
| − | | | + | |Administrator invisibility level. |
|- | |- | ||
| − | | | + | |<code>alignment</code> |
| − | | | + | | -1000 to 1000 |
| − | | | + | |0 |
| − | | | + | |Stored, but nothing in the game reads an object's alignment. |
|- | |- | ||
| − | | | + | |<code>spell</code> |
| − | | | + | |0 to 255 |
| − | | | + | |0 |
| − | | | + | |Magic resistance. |
|- | |- | ||
| − | | | + | |<code>dilcopy</code>, <code>dilbegin</code> |
| − | | | + | |DIL |
| − | | | + | |none |
| − | | | + | |Scripts that run on the object. |
|- | |- | ||
| − | | | + | |<code>affect</code> |
| − | | | + | |affect block |
| − | | | + | |none |
| − | | | + | |Bonuses and curses. Use the macros, never write it yourself. |
|} | |} | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| + | Fields can come in any order. <code>manipulate</code>, <code>flags</code>, <code>romflags</code> and <code>open</code> add up when you give them more than once; every other field keeps the last value it was given. A macro such as <code>WEAPON_DEF</code> sets <code>type</code>, <code>value[]</code> and other fields, so put the macro first and change things after it. | ||
| + | |||
| + | Flags are written in braces and separated by commas: <code>manipulate {MANIPULATE_TAKE, MANIPULATE_HOLD}</code>. A single flag needs no braces. Numbers may be sums such as <code>2*12+1</code>. | ||
| + | |||
| + | All the constants on this page come from <code>vme/include/vme.h</code> and <code>values.h</code>; start your zone with <code>#include <macros.h></code>, which includes them. | ||
| + | |||
| + | === Description of the object fields === | ||
;symbolic name | ;symbolic name | ||
| − | : The | + | :The name the object is known by in the zone, such as <code>dragon_head</code>. Administrators use it to <code>load</code> and <code>wstat</code> the object, and other fields (<code>key</code>) and the resets refer to it. Use a name that matches the title so it is easy to find. The rules for symbols are in [[Manual:Zone Manual/Unit Building Blocks|Unit Building Blocks]]: letters, digits and <code>_</code>, at most 15 characters, unique among the rooms, objects and NPCs of the zone. |
| − | + | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
;title | ;title | ||
| − | : | + | :What the game shows when the object is picked up, dropped, given, listed in an inventory or used in a fight. Start it in lower case with an article, and don't end it with punctuation: vmc warns about a title that ends in something other than a letter, and about one that starts with a capitalised word such as "The". |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | + | <pre> | |
| − | + | title "a big rock" | |
| − | + | title "the flame tongue" | |
| − | + | title "an oval hover car" | |
| − | + | </pre> | |
| − | + | ;descr | |
| − | + | :What players see when the object lies in the room they are in, or when they look around. One line is usually enough. | |
| + | |||
| + | <pre> | ||
| + | descr "A green bloody sword is lying here." | ||
| + | descr "A massive round wooden table stands here." | ||
| + | </pre> | ||
| − | |||
| − | |||
;names | ;names | ||
| − | : The | + | :The words players type to pick the object up, drop it, look at it and so on. Every word a player might use from the title and the description should be in the list, and nothing that isn't. Put longer names first: vmc refuses a list where a name starts with an earlier one ("rock" before "big rock"). A name can't end in <code>'s</code> or start with <code>self</code>. |
| − | + | <pre> | |
| − | + | title "an old twisted staff" | |
| − | + | descr "An old twisted staff has been thrown away here." | |
| − | + | names {"old twisted staff", "twisted staff", "old staff", "staff"} | |
| − | + | </pre> | |
| − | + | ||
| + | :On a drink container the last name must be the liquid, as in <code>{"waterskin", "skin", "water"}</code>: when the container is drunk empty, the game removes the last name. | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
;inside_descr | ;inside_descr | ||
| − | : | + | :What players see when they are inside the object, for objects that can be entered (a coffin, a boat). It can be several lines long, like a room description. |
| − | + | ||
| − | + | <pre> | |
| − | + | inside_descr | |
| + | "You are inside a black coffin with red velvet padding. Scary!" | ||
| + | </pre> | ||
| − | |||
| − | |||
| − | |||
;extra | ;extra | ||
| − | : | + | :Extra descriptions. An extra with an empty name list is what players see when they look at the object: |
| − | + | ||
| − | + | <pre> | |
| + | extra {} | ||
| + | "The ice cube is about 40 meters on each side. It seems to be melting | ||
| + | slightly, but waiting for it to finish would be like waiting for the | ||
| + | ice age to end." | ||
| + | </pre> | ||
| − | + | :An extra with names describes a part of the object, for <code>look at crack</code>: | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | + | <pre> | |
| − | + | extra {"crack"} | |
| − | + | "There is a big crack in the side of the ice cube." | |
| − | + | </pre> | |
| − | + | ||
| − | + | :Extras whose name starts with <code>$</code> are not for players to look at. Some of them replace the game's standard messages when something is done to the object. In them <code>$1n</code> is the character who does it and <code>$2n</code> the object; the codes are explained under [[Manual:DIL Manual/act()|act()]]. | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
{| class="wikitable" | {| class="wikitable" | ||
| − | |+ | + | |+Message extras |
| − | |||
!Extra | !Extra | ||
| − | ! | + | !Replaces the message... |
|- | |- | ||
| − | |$ | + | |<code>$get_s</code> / <code>$get_o</code> |
| − | | | + | |to the character / to the others in the room, when it is picked up from the floor |
| − | |||
|- | |- | ||
| − | |$ | + | |<code>$drop_s</code> / <code>$drop_o</code> |
| − | | | + | |when it is dropped |
|- | |- | ||
| − | |$ | + | |<code>$wear_s</code> / <code>$wear_o</code> |
| − | | | + | |when it is worn, wielded or held |
|- | |- | ||
| − | |$rem_o | + | |<code>$rem_s</code> / <code>$rem_o</code> |
| − | | | + | |when it is removed |
|- | |- | ||
| − | |$ | + | |<code>$enter_s</code> / <code>$enter_o</code> |
| − | | | + | |when someone enters it |
|- | |- | ||
| − | |$get_o | + | |<code>$exit_s</code> / <code>$exit_o</code> |
| − | + | |when someone leaves it | |
| + | |} | ||
| + | |||
| + | <pre> | ||
| + | extra {"$get_s"} | ||
| + | "You pick up $2n. It is very cold and starts to melt in your hands." | ||
| + | |||
| + | extra {"$get_o"} | ||
| + | "$1n picks up $2n. A drop of water hits the ground." | ||
| + | </pre> | ||
| + | |||
| + | :Other <code>$</code> extras hold data: <code>$identify</code> is shown by the identify spell, the <code>MATERIAL_*</code> macros write <code>$material</code>, the drink macros write <code>$drink_color</code> and friends, and DIL programs keep their own. The extra must start with <code>$</code>: <code>extra {"drop_o"}</code> is just a description of a part called "drop_o". | ||
| + | |||
| + | ;type | ||
| + | :The kind of object, one of the <code>ITEM_*</code> constants. Only one type can be set. The macros on [[Manual:Zone Manual/The Objects Section/Object macros|Object macros]] set it for you, together with the values that type needs. | ||
| + | |||
| + | {| class="wikitable" | ||
| + | |+Item types | ||
| + | !Type | ||
| + | !Used by the game | ||
|- | |- | ||
| − | | | + | |<code>ITEM_WEAPON</code> |
| − | |A | + | |A weapon to wield. <code>WEAPON_DEF</code>. |
|- | |- | ||
| − | | | + | |<code>ITEM_ARMOR</code> |
| − | | | + | |Armour. <code>ARMOUR_DEF</code> and the <code>ARMOUR_*</code> macros. |
|- | |- | ||
| − | | | + | |<code>ITEM_SHIELD</code> |
| − | |A | + | |A shield. <code>SHIELD_DEF</code>. |
|- | |- | ||
| − | | | + | |<code>ITEM_WORN</code> |
| − | | | + | |Clothes and jewellery that give no protection. |
|- | |- | ||
| − | | | + | |<code>ITEM_CONTAINER</code> |
| − | | | + | |Things to put things in. <code>CONTAINER_DEF</code>. |
|- | |- | ||
| − | | | + | |<code>ITEM_DRINKCON</code> |
| − | |A | + | |A drink container for <code>drink</code> and <code>pour</code>. <code>LIQ_DEF</code> and the liquid macros. |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
|- | |- | ||
| − | + | |<code>ITEM_FOOD</code> | |
| − | + | |Food for <code>eat</code>. <code>FOOD_DEF</code>. | |
|- | |- | ||
| − | | | + | |<code>ITEM_LIGHT</code> |
| − | | | + | |A torch or lantern for <code>light</code> and <code>extinguish</code>. <code>LIGHT_DEF</code>. |
| − | |||
|- | |- | ||
| − | | | + | |<code>ITEM_MONEY</code> |
| − | | | + | |Coins. <code>MONEY</code>. |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
|- | |- | ||
| − | + | |<code>ITEM_POTION</code> | |
| − | + | |A potion for <code>quaff</code>. <code>POTION_DEF</code>. | |
|- | |- | ||
| − | | | + | |<code>ITEM_SCROLL</code> |
| − | | | + | |A scroll for <code>recite</code>. <code>SCROLL_DEF</code>. |
|- | |- | ||
| − | | | + | |<code>ITEM_WAND</code>, <code>ITEM_STAFF</code> |
| − | | | + | |Held and used with <code>use</code>. <code>WAND_DEF</code>, <code>STAFF_DEF</code>. |
|- | |- | ||
| − | | | + | |<code>ITEM_FIREWEAPON</code> |
| − | | | + | |A bow, crossbow or sling for <code>shoot</code>. <code>RANGED_DEF</code>. |
| − | |||
| − | |||
|- | |- | ||
| − | | | + | |<code>ITEM_TRAP</code> |
| − | | | + | |A trap for the trap skill. <code>TRAP_DEF</code>. |
| − | |||
|- | |- | ||
| − | | | + | |<code>ITEM_NOTE</code> |
| − | | | + | |Paper to write on, and to post on boards or send as mail. |
| − | |||
|- | |- | ||
| − | | | + | |<code>ITEM_BOARD</code> |
| − | | | + | |A bulletin board (see <code>vme/zone/boards.zon</code>). |
|- | |- | ||
| − | | | + | |<code>ITEM_BOAT</code> |
| − | | | + | |Something to enter and <code>sail</code> over water. |
|- | |- | ||
| − | | | + | |<code>ITEM_KEY</code> |
| − | | | + | |A key. A lock only checks the key's symbolic name, so the type is just for shops and players. |
|- | |- | ||
| − | | | + | |<code>ITEM_TREASURE</code> |
| − | | | + | |Gems and other valuables, worth only their price. |
| − | |||
| − | |||
| − | |||
| − | |||
|- | |- | ||
| − | | | + | |<code>ITEM_TRASH</code> |
| − | | | + | |Junk. Broken weapons and armour become trash. |
| − | |||
|- | |- | ||
| − | | | + | |<code>ITEM_OTHER</code> |
| − | | | + | |Anything else. The default. |
|- | |- | ||
| − | | | + | |<code>ITEM_MISSILE</code>, <code>ITEM_PEN</code>, <code>ITEM_SPELL</code>, <code>ITEM_BOOK</code>, <code>ITEM_SKIN</code> |
| − | | | + | |Defined, but no command treats them specially. Arrows are <code>ITEM_WEAPON</code> (<code>MISSILE_DEF</code>). |
|} | |} | ||
| − | + | ||
| − | + | :You can give your own DIL commands their own meaning for a type, but the built-in commands only know the ones above. | |
| − | + | ||
| − | + | ;manipulate | |
| − | + | :What can be done with the object. <code>MANIPULATE_TAKE</code> lets it be picked up: without it the object can't be taken at all, which is right for a fountain or a statue. <code>MANIPULATE_ENTER</code> lets players put things into it, and enter it if it is big enough (a coffin, a boat). The rest say where it is used: | |
| − | + | ||
| − | : | ||
{| class="wikitable" | {| class="wikitable" | ||
| − | + | !Flag | |
| + | !Position | ||
| + | !Flag | ||
| + | !Position | ||
|- | |- | ||
| − | + | |<code>MANIPULATE_WIELD</code> | |
| − | + | |wielded as a weapon | |
| + | |<code>MANIPULATE_HOLD</code> | ||
| + | |held in the hand | ||
|- | |- | ||
| − | | | + | |<code>MANIPULATE_WEAR_HEAD</code> |
| − | | | + | |head |
| + | |<code>MANIPULATE_WEAR_NECK</code> | ||
| + | |neck (two) | ||
|- | |- | ||
| − | | | + | |<code>MANIPULATE_WEAR_BODY</code> |
| − | | | + | |body |
| + | |<code>MANIPULATE_WEAR_CHEST</code> | ||
| + | |across the chest (a baldric) | ||
|- | |- | ||
| − | | | + | |<code>MANIPULATE_WEAR_ABOUT</code> |
| − | | | + | |about the body (a cloak) |
| − | + | |<code>MANIPULATE_WEAR_BACK</code> | |
| + | |back | ||
|- | |- | ||
| − | | | + | |<code>MANIPULATE_WEAR_ARMS</code> |
| − | | | + | |arms |
| − | + | |<code>MANIPULATE_WEAR_WRIST</code> | |
| + | |wrist (two) | ||
|- | |- | ||
| − | | | + | |<code>MANIPULATE_WEAR_HANDS</code> |
| − | | | + | |hands |
| + | |<code>MANIPULATE_WEAR_FINGER</code> | ||
| + | |finger (two) | ||
|- | |- | ||
| − | | | + | |<code>MANIPULATE_WEAR_WAIST</code> |
| − | | | + | |waist |
| − | + | |<code>MANIPULATE_WEAR_LEGS</code> | |
| + | |legs | ||
|- | |- | ||
| − | | | + | |<code>MANIPULATE_WEAR_FEET</code> |
| − | | | + | |feet |
| − | + | |<code>MANIPULATE_WEAR_ANKLE</code> | |
| + | |ankle (two) | ||
|- | |- | ||
| − | | | + | |<code>MANIPULATE_WEAR_EAR</code> |
| − | | | + | |ear (two) |
| − | + | |<code>MANIPULATE_WEAR_SHIELD</code> | |
| + | |shield arm | ||
| + | |} | ||
| + | |||
| + | :Give an object one wear position; if it has several, <code>wear</code> uses only one of them. Combine it with <code>MANIPULATE_TAKE</code>, and with <code>MANIPULATE_ENTER</code> for a backpack: | ||
| + | |||
| + | <pre> | ||
| + | // an earring | ||
| + | manipulate {MANIPULATE_TAKE, MANIPULATE_WEAR_EAR} | ||
| + | |||
| + | // a backpack | ||
| + | manipulate {MANIPULATE_TAKE, MANIPULATE_ENTER, MANIPULATE_WEAR_BACK} | ||
| + | </pre> | ||
| + | |||
| + | :Whether an item fits depends on its <code>height</code> compared with the wearer's: body armour must be 60% to 140% of the wearer's height, everything else 50% to 150%. Held objects that aren't weapons always fit. | ||
| + | |||
| + | ;flags | ||
| + | :Unit flags, the same <code>UNIT_FL_*</code> flags rooms and NPCs use. Only <code>UNIT_FL_*</code> constants belong here. vmc only sees numbers, so an object flag written here sets a different unit flag without a word: <code>flags {OBJ_NO_DUAL}</code> makes the object load buried. | ||
| + | |||
| + | {| class="wikitable" | ||
| + | |+Unit flags on objects | ||
| + | !Flag | ||
| + | !On an object | ||
|- | |- | ||
| − | | | + | |<code>UNIT_FL_INVISIBLE</code> |
| − | | | + | |Only characters who detect invisible can see it. |
|- | |- | ||
| − | | | + | |<code>UNIT_FL_BURIED</code> |
| − | | | + | |It loads buried in the ground, hidden until someone digs it up. |
| − | |||
|- | |- | ||
| − | | | + | |<code>UNIT_FL_MAGIC</code> |
| − | | | + | |It shows a magic aura to characters who detect magic, and can't be resized. The magic macros set it. |
| − | |||
|- | |- | ||
| − | | | + | |<code>UNIT_FL_NOSAVE</code> |
| − | | | + | |It isn't saved with a player's inventory. Use it for quest items and keys that must not leave the game. |
| − | |||
| − | |||
|- | |- | ||
| − | | | + | |<code>UNIT_FL_TRANS</code> |
| − | | | + | |Transparent: characters inside it (a boat, a cart) see out and are seen. |
|- | |- | ||
| − | | | + | |<code>UNIT_FL_NO_TELEPORT</code> |
| − | | | + | |Nobody can teleport into or out of it. |
| − | |||
|- | |- | ||
| − | | | + | |<code>UNIT_FL_SACRED</code> |
| − | | | + | |Characters inside it regain hit points, mana and endurance twice as fast. |
|- | |- | ||
| − | | | + | |<code>UNIT_FL_NO_WEATHER</code> |
| − | | | + | |Characters inside it get no weather messages. |
| − | |||
|- | |- | ||
| − | | | + | |<code>UNIT_FL_PRIVATE</code> |
| − | | | + | |At most two characters can <code>goto</code> into it. |
|- | |- | ||
| − | | | + | |<code>UNIT_FL_NO_MOB</code>, <code>UNIT_FL_INDOORS</code>, <code>UNIT_FL_NO_BURY</code> |
| − | | | + | |Room flags; they do nothing on an object. |
| + | |} | ||
| + | |||
| + | <pre> | ||
| + | manipulate {MANIPULATE_TAKE} | ||
| + | flags {UNIT_FL_NOSAVE} | ||
| + | </pre> | ||
| + | |||
| + | ;romflags | ||
| + | :Object flags (<code>OBJ_*</code>). | ||
| + | |||
| + | {| class="wikitable" | ||
| + | !Flag | ||
| + | !Effect | ||
|- | |- | ||
| − | | | + | |<code>OBJ_NO_DUAL</code> |
| − | | | + | |A weapon that can't be held as the second weapon when fighting with two. |
|- | |- | ||
| − | | | + | |<code>OBJ_TWO_HANDS</code> |
| − | | | + | |Read by a few skills that need a free hand. Whether a weapon needs both hands comes from its weapon type, not from this flag. |
|- | |- | ||
| − | | | + | |<code>OBJ_NO_UNEQUIP</code> |
| − | | | + | |Meant to make an item impossible to remove, but the <code>remove</code> command doesn't check it. Use <code>CURSED_OBJECT</code> instead. |
| − | |||
|- | |- | ||
| − | | | + | |<code>OBJ_NOCOVER</code> |
| − | | | + | |Not used. |
| + | |} | ||
| + | |||
| + | ;weight | ||
| + | :The weight in pounds, 0 to 32767. A character can carry only so much, and a container only its <code>capacity</code>. | ||
| + | |||
| + | ;height | ||
| + | :The object's size in centimetres. It decides who can wear or wield it (see <code>manipulate</code>). When a reset equips an NPC with the object, the object is resized to fit that NPC. | ||
| + | |||
| + | ;capacity | ||
| + | :How many pounds of things a container can hold, or how much liquid a drink container holds; -1 means endless (a fountain). Only objects with <code>MANIPULATE_ENTER</code> can have things put into them. | ||
| + | |||
| + | ;cost | ||
| + | :What the object is worth in a shop. Write the number of coins, then the coin, separated by commas: | ||
| + | |||
| + | <pre> | ||
| + | cost 5 GOLD_PIECE | ||
| + | cost 2 SILVER_PIECE, 4 COPPER_PIECE | ||
| + | </pre> | ||
| + | |||
| + | :The coins are <code>IRON_PIECE</code>, <code>COPPER_PIECE</code>, <code>SILVER_PIECE</code>, <code>GOLD_PIECE</code> and <code>PLATINUM_PIECE</code>; each is worth eight of the one before. A bare number (<code>cost 25600</code>) and <code>cost 5*GOLD_PIECE</code> are syntax errors, and <code>money</code> is an NPC field, not an object field. An object without a cost is worth nothing. | ||
| + | |||
| + | ;rent | ||
| + | :What the object costs per real day while its owner is logged off, written like <code>cost</code>. The server charges a percentage of it set by <code>rent</code> in <code>server.cfg</code>; the default configuration has 0, no rent at all. | ||
| + | |||
| + | ;open | ||
| + | :Lets the object be opened, closed and locked, like a door: | ||
| + | |||
| + | {| class="wikitable" | ||
| + | !Flag | ||
| + | !Effect | ||
|- | |- | ||
| − | | | + | |<code>EX_OPEN_CLOSE</code> |
| − | | | + | |It can be opened and closed. |
|- | |- | ||
| − | | | + | |<code>EX_CLOSED</code> |
| − | | | + | |It is closed when it loads. |
| − | |||
|- | |- | ||
| − | | | + | |<code>EX_LOCKED</code> |
| − | | | + | |It is locked when it loads. |
|- | |- | ||
| − | | | + | |<code>EX_PICKPROOF</code> |
| − | | | + | |The lock can't be picked. |
| − | |||
|- | |- | ||
| − | | | + | |<code>EX_INSIDE_OPEN</code> |
| − | | | + | |It can be opened and locked from inside (a coffin). |
| − | |||
|} | |} | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | + | :<code>difficulty</code> after the flags sets how hard the lock is to pick, 0 to 250. A lock needs a <code>key</code> field: without one, <code>lock</code>, <code>unlock</code> and <code>pick</code> all say there is no keyhole. | |
| − | + | ||
| − | + | <pre> | |
| − | + | open {EX_OPEN_CLOSE, EX_CLOSED, EX_LOCKED} difficulty 40 | |
| − | + | key brass_key | |
| − | + | </pre> | |
| − | + | ||
| − | |||
| − | |||
;key | ;key | ||
| − | : The | + | :The symbolic name of the object that locks and unlocks this one. Write <code>key brass_key</code> for a key in the same zone and <code>key brass_key@otherzone</code> for one in another zone. The player must carry an object with that symbolic name; its type doesn't matter. vmc doesn't check that the key exists. |
| − | |||
| − | |||
| − | |||
| − | + | ;bright, light | |
| − | + | :<code>bright</code> is how much light the object gives off: lying in a room it lights the room, and worn or held it lights the room its wearer is in. <code>bright 2</code> makes a light that never goes out and can't be put out. A torch made with <code>LIGHT_DEF</code> has no <code>bright</code> until someone lights it. <code>light</code> is the light inside the object, for objects players can enter. Both are -6 to 6. | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
;minv | ;minv | ||
| − | : | + | :The administrator invisibility level: only administrators of at least this level can see the object. Use it for objects that run DIL programs and should not be seen by players. |
| − | + | ||
| − | + | <pre> | |
| − | + | minv 239 | |
| − | + | </pre> | |
| + | |||
;alignment | ;alignment | ||
| − | : | + | :A number from -1000 to 1000. No command uses an object's alignment, but DIL programs can read it. |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | ; | + | ;spell |
| − | : | + | :The object's magic resistance, 0 to 255: how well it resists spells cast on it. For potions, scrolls, wands and staffs, <code>value[0]</code> (the spell power) is used instead. |
| − | |||
| − | |||
| − | |||
| − | : | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
;value | ;value | ||
| − | : | + | :Five numbers, <code>value[0]</code> to <code>value[4]</code>, whose meaning depends on the type: for a weapon they are the weapon type, craftsmanship, magic bonus and slaying race. Let the macros set them unless a DIL program of your own needs a value. [[Manual:Zone Manual/The Objects Section/Object macros|Object macros]] lists what each type keeps in them. |
| − | + | ||
| + | <pre> | ||
| + | value[0] 5 | ||
| + | value[4] 12 | ||
| + | </pre> | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
;affect | ;affect | ||
| − | : | + | :Bonuses and penalties the object gives its wearer, and curses. Don't write <code>affect</code> blocks yourself: vmc checks them and refuses anything the game doesn't know. Use the transfer macros and <code>CURSED_OBJECT</code> on [[Manual:Zone Manual/The Objects Section/Object macros|Object macros]]. |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | + | ;dilcopy, dilbegin | |
| − | + | :DIL programs on the object. <code>dilcopy</code> runs a template from another zone with arguments; <code>vme/zone/function.zon</code> has many made for objects, such as restrictions on who can use an item: | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | + | <pre> | |
| − | + | dilcopy level_restrict@function(10, 0, 25, ""); | |
| − | + | </pre> | |
| − | |||
| − | |||
| − | |||
| − | + | :[[Manual:Zone Manual/The Objects Section/DIL functions for objects|DIL functions for objects]] describes them, and [[Manual:Zone Manual/The Objects Section/More complex objects|More complex objects]] puts some to work. vmc doesn't check a template's name or arguments; read the template's <code>dilbegin</code> line in its zone before you use it. How to write DIL of your own is in the [[Manual:DIL Manual|DIL manual]]. | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | <div style='padding-top: 30px; padding-bottom: 20px; text-align: left;float:left;width:50%;'>[[Manual: | + | <div style='padding-top: 30px; padding-bottom: 20px; text-align: left;float:left;width:50%;'>[[Manual:Zone Manual/The NPC Section/Suggested NPC exercises|Previous: Suggested NPC exercises]]</div> |
| − | <div style='padding-top: 30px; padding-bottom: 20px; text-align: right;float:right;width:50%;'>[[Manual: | + | <div style='padding-top: 30px; padding-bottom: 20px; text-align: right;float:right;width:50%;'>[[Manual:Zone Manual/The Objects Section/Object macros|Next: Object macros]]</div> |
Latest revision as of 06:18, 15 November 2026
The objects section
With rooms and NPCs alone you could build a world of naked people fighting with their bare hands. Objects fill it with everything else: weapons and armour for the NPCs, food and drink, keys, chests, boats and the junk lying about in the rooms.
Objects go in the %objects section of a zone file. Like rooms and NPCs, each object is a symbolic name, then its fields in any order, then end:
%objects
big_rock
names {"big rock", "rock"}
title "a big rock"
descr "A big rock is lying in the road."
manipulate {MANIPULATE_TAKE}
weight 40
end
This page lists the fields an object can have and what each one does in the game. Object macros shows the macros that set up weapons, armour, containers, drinks and the other kinds of objects; Building your first object walks through a complete object.
Object fields
| Field | Value | Default | What it is |
|---|---|---|---|
names
|
string list | none | The words players use to act on the object. |
title
|
string | none | The short name: "a big rock". |
descr
|
string | none | What players see when the object lies in a room. |
inside_descr
|
string | none | What players see when they are inside the object (a coffin, a boat). |
extra
|
string list, string | none | Descriptions to look at, special messages, and data for DIL. |
type
|
ITEM_*
|
ITEM_OTHER
|
The kind of object. Usually set by a macro. |
manipulate
|
MANIPULATE_* flags
|
none | Whether it can be taken, entered, worn (and where), wielded or held. |
flags
|
UNIT_FL_* flags
|
none | Unit flags: invisible, buried, magic, not saved... |
romflags
|
OBJ_* flags
|
none | Object flags. |
weight
|
number | 1 | Weight in pounds, 0 to 32767. |
height
|
number | 180 | Size in centimetres; decides who it fits. |
capacity
|
number | 0 | How many pounds it can hold, -1 to 32767 (-1 is endless). |
value[0] .. value[4]
|
number | 0 | Five numbers whose meaning depends on the type. Usually set by a macro. |
cost
|
money | 0 | What it is worth in a shop. |
rent
|
money | 0 | What it costs per day to keep it while logged off. |
open
|
EX_* flags
|
none | Whether it opens, closes and locks. May be followed by difficulty n.
|
key
|
symbolic name | none | The object that locks and unlocks it. |
bright
|
-6 to 6 | 0 | How much light it gives off. |
light
|
-6 to 6 | 0 | Light inside the object. |
minv
|
number | 0 | Administrator invisibility level. |
alignment
|
-1000 to 1000 | 0 | Stored, but nothing in the game reads an object's alignment. |
spell
|
0 to 255 | 0 | Magic resistance. |
dilcopy, dilbegin
|
DIL | none | Scripts that run on the object. |
affect
|
affect block | none | Bonuses and curses. Use the macros, never write it yourself. |
Fields can come in any order. manipulate, flags, romflags and open add up when you give them more than once; every other field keeps the last value it was given. A macro such as WEAPON_DEF sets type, value[] and other fields, so put the macro first and change things after it.
Flags are written in braces and separated by commas: manipulate {MANIPULATE_TAKE, MANIPULATE_HOLD}. A single flag needs no braces. Numbers may be sums such as 2*12+1.
All the constants on this page come from vme/include/vme.h and values.h; start your zone with #include <macros.h>, which includes them.
Description of the object fields
- symbolic name
- The name the object is known by in the zone, such as
dragon_head. Administrators use it toloadandwstatthe object, and other fields (key) and the resets refer to it. Use a name that matches the title so it is easy to find. The rules for symbols are in Unit Building Blocks: letters, digits and_, at most 15 characters, unique among the rooms, objects and NPCs of the zone.
- title
- What the game shows when the object is picked up, dropped, given, listed in an inventory or used in a fight. Start it in lower case with an article, and don't end it with punctuation: vmc warns about a title that ends in something other than a letter, and about one that starts with a capitalised word such as "The".
title "a big rock" title "the flame tongue" title "an oval hover car"
- descr
- What players see when the object lies in the room they are in, or when they look around. One line is usually enough.
descr "A green bloody sword is lying here." descr "A massive round wooden table stands here."
- names
- The words players type to pick the object up, drop it, look at it and so on. Every word a player might use from the title and the description should be in the list, and nothing that isn't. Put longer names first: vmc refuses a list where a name starts with an earlier one ("rock" before "big rock"). A name can't end in
'sor start withself.
title "an old twisted staff"
descr "An old twisted staff has been thrown away here."
names {"old twisted staff", "twisted staff", "old staff", "staff"}
- On a drink container the last name must be the liquid, as in
{"waterskin", "skin", "water"}: when the container is drunk empty, the game removes the last name.
- inside_descr
- What players see when they are inside the object, for objects that can be entered (a coffin, a boat). It can be several lines long, like a room description.
inside_descr "You are inside a black coffin with red velvet padding. Scary!"
- extra
- Extra descriptions. An extra with an empty name list is what players see when they look at the object:
extra {}
"The ice cube is about 40 meters on each side. It seems to be melting
slightly, but waiting for it to finish would be like waiting for the
ice age to end."
- An extra with names describes a part of the object, for
look at crack:
extra {"crack"}
"There is a big crack in the side of the ice cube."
- Extras whose name starts with
$are not for players to look at. Some of them replace the game's standard messages when something is done to the object. In them$1nis the character who does it and$2nthe object; the codes are explained under act().
| Extra | Replaces the message... |
|---|---|
$get_s / $get_o
|
to the character / to the others in the room, when it is picked up from the floor |
$drop_s / $drop_o
|
when it is dropped |
$wear_s / $wear_o
|
when it is worn, wielded or held |
$rem_s / $rem_o
|
when it is removed |
$enter_s / $enter_o
|
when someone enters it |
$exit_s / $exit_o
|
when someone leaves it |
extra {"$get_s"}
"You pick up $2n. It is very cold and starts to melt in your hands."
extra {"$get_o"}
"$1n picks up $2n. A drop of water hits the ground."
- Other
$extras hold data:$identifyis shown by the identify spell, theMATERIAL_*macros write$material, the drink macros write$drink_colorand friends, and DIL programs keep their own. The extra must start with$:extra {"drop_o"}is just a description of a part called "drop_o".
- type
- The kind of object, one of the
ITEM_*constants. Only one type can be set. The macros on Object macros set it for you, together with the values that type needs.
| Type | Used by the game |
|---|---|
ITEM_WEAPON
|
A weapon to wield. WEAPON_DEF.
|
ITEM_ARMOR
|
Armour. ARMOUR_DEF and the ARMOUR_* macros.
|
ITEM_SHIELD
|
A shield. SHIELD_DEF.
|
ITEM_WORN
|
Clothes and jewellery that give no protection. |
ITEM_CONTAINER
|
Things to put things in. CONTAINER_DEF.
|
ITEM_DRINKCON
|
A drink container for drink and pour. LIQ_DEF and the liquid macros.
|
ITEM_FOOD
|
Food for eat. FOOD_DEF.
|
ITEM_LIGHT
|
A torch or lantern for light and extinguish. LIGHT_DEF.
|
ITEM_MONEY
|
Coins. MONEY.
|
ITEM_POTION
|
A potion for quaff. POTION_DEF.
|
ITEM_SCROLL
|
A scroll for recite. SCROLL_DEF.
|
ITEM_WAND, ITEM_STAFF
|
Held and used with use. WAND_DEF, STAFF_DEF.
|
ITEM_FIREWEAPON
|
A bow, crossbow or sling for shoot. RANGED_DEF.
|
ITEM_TRAP
|
A trap for the trap skill. TRAP_DEF.
|
ITEM_NOTE
|
Paper to write on, and to post on boards or send as mail. |
ITEM_BOARD
|
A bulletin board (see vme/zone/boards.zon).
|
ITEM_BOAT
|
Something to enter and sail over water.
|
ITEM_KEY
|
A key. A lock only checks the key's symbolic name, so the type is just for shops and players. |
ITEM_TREASURE
|
Gems and other valuables, worth only their price. |
ITEM_TRASH
|
Junk. Broken weapons and armour become trash. |
ITEM_OTHER
|
Anything else. The default. |
ITEM_MISSILE, ITEM_PEN, ITEM_SPELL, ITEM_BOOK, ITEM_SKIN
|
Defined, but no command treats them specially. Arrows are ITEM_WEAPON (MISSILE_DEF).
|
- You can give your own DIL commands their own meaning for a type, but the built-in commands only know the ones above.
- manipulate
- What can be done with the object.
MANIPULATE_TAKElets it be picked up: without it the object can't be taken at all, which is right for a fountain or a statue.MANIPULATE_ENTERlets players put things into it, and enter it if it is big enough (a coffin, a boat). The rest say where it is used:
| Flag | Position | Flag | Position |
|---|---|---|---|
MANIPULATE_WIELD
|
wielded as a weapon | MANIPULATE_HOLD
|
held in the hand |
MANIPULATE_WEAR_HEAD
|
head | MANIPULATE_WEAR_NECK
|
neck (two) |
MANIPULATE_WEAR_BODY
|
body | MANIPULATE_WEAR_CHEST
|
across the chest (a baldric) |
MANIPULATE_WEAR_ABOUT
|
about the body (a cloak) | MANIPULATE_WEAR_BACK
|
back |
MANIPULATE_WEAR_ARMS
|
arms | MANIPULATE_WEAR_WRIST
|
wrist (two) |
MANIPULATE_WEAR_HANDS
|
hands | MANIPULATE_WEAR_FINGER
|
finger (two) |
MANIPULATE_WEAR_WAIST
|
waist | MANIPULATE_WEAR_LEGS
|
legs |
MANIPULATE_WEAR_FEET
|
feet | MANIPULATE_WEAR_ANKLE
|
ankle (two) |
MANIPULATE_WEAR_EAR
|
ear (two) | MANIPULATE_WEAR_SHIELD
|
shield arm |
- Give an object one wear position; if it has several,
wearuses only one of them. Combine it withMANIPULATE_TAKE, and withMANIPULATE_ENTERfor a backpack:
// an earring
manipulate {MANIPULATE_TAKE, MANIPULATE_WEAR_EAR}
// a backpack
manipulate {MANIPULATE_TAKE, MANIPULATE_ENTER, MANIPULATE_WEAR_BACK}
- Whether an item fits depends on its
heightcompared with the wearer's: body armour must be 60% to 140% of the wearer's height, everything else 50% to 150%. Held objects that aren't weapons always fit.
- flags
- Unit flags, the same
UNIT_FL_*flags rooms and NPCs use. OnlyUNIT_FL_*constants belong here. vmc only sees numbers, so an object flag written here sets a different unit flag without a word:flags {OBJ_NO_DUAL}makes the object load buried.
| Flag | On an object |
|---|---|
UNIT_FL_INVISIBLE
|
Only characters who detect invisible can see it. |
UNIT_FL_BURIED
|
It loads buried in the ground, hidden until someone digs it up. |
UNIT_FL_MAGIC
|
It shows a magic aura to characters who detect magic, and can't be resized. The magic macros set it. |
UNIT_FL_NOSAVE
|
It isn't saved with a player's inventory. Use it for quest items and keys that must not leave the game. |
UNIT_FL_TRANS
|
Transparent: characters inside it (a boat, a cart) see out and are seen. |
UNIT_FL_NO_TELEPORT
|
Nobody can teleport into or out of it. |
UNIT_FL_SACRED
|
Characters inside it regain hit points, mana and endurance twice as fast. |
UNIT_FL_NO_WEATHER
|
Characters inside it get no weather messages. |
UNIT_FL_PRIVATE
|
At most two characters can goto into it.
|
UNIT_FL_NO_MOB, UNIT_FL_INDOORS, UNIT_FL_NO_BURY
|
Room flags; they do nothing on an object. |
manipulate {MANIPULATE_TAKE}
flags {UNIT_FL_NOSAVE}
- romflags
- Object flags (
OBJ_*).
| Flag | Effect |
|---|---|
OBJ_NO_DUAL
|
A weapon that can't be held as the second weapon when fighting with two. |
OBJ_TWO_HANDS
|
Read by a few skills that need a free hand. Whether a weapon needs both hands comes from its weapon type, not from this flag. |
OBJ_NO_UNEQUIP
|
Meant to make an item impossible to remove, but the remove command doesn't check it. Use CURSED_OBJECT instead.
|
OBJ_NOCOVER
|
Not used. |
- weight
- The weight in pounds, 0 to 32767. A character can carry only so much, and a container only its
capacity.
- height
- The object's size in centimetres. It decides who can wear or wield it (see
manipulate). When a reset equips an NPC with the object, the object is resized to fit that NPC.
- capacity
- How many pounds of things a container can hold, or how much liquid a drink container holds; -1 means endless (a fountain). Only objects with
MANIPULATE_ENTERcan have things put into them.
- cost
- What the object is worth in a shop. Write the number of coins, then the coin, separated by commas:
cost 5 GOLD_PIECE cost 2 SILVER_PIECE, 4 COPPER_PIECE
- The coins are
IRON_PIECE,COPPER_PIECE,SILVER_PIECE,GOLD_PIECEandPLATINUM_PIECE; each is worth eight of the one before. A bare number (cost 25600) andcost 5*GOLD_PIECEare syntax errors, andmoneyis an NPC field, not an object field. An object without a cost is worth nothing.
- rent
- What the object costs per real day while its owner is logged off, written like
cost. The server charges a percentage of it set byrentinserver.cfg; the default configuration has 0, no rent at all.
- open
- Lets the object be opened, closed and locked, like a door:
| Flag | Effect |
|---|---|
EX_OPEN_CLOSE
|
It can be opened and closed. |
EX_CLOSED
|
It is closed when it loads. |
EX_LOCKED
|
It is locked when it loads. |
EX_PICKPROOF
|
The lock can't be picked. |
EX_INSIDE_OPEN
|
It can be opened and locked from inside (a coffin). |
difficultyafter the flags sets how hard the lock is to pick, 0 to 250. A lock needs akeyfield: without one,lock,unlockandpickall say there is no keyhole.
open {EX_OPEN_CLOSE, EX_CLOSED, EX_LOCKED} difficulty 40
key brass_key
- key
- The symbolic name of the object that locks and unlocks this one. Write
key brass_keyfor a key in the same zone andkey brass_key@otherzonefor one in another zone. The player must carry an object with that symbolic name; its type doesn't matter. vmc doesn't check that the key exists.
- bright, light
brightis how much light the object gives off: lying in a room it lights the room, and worn or held it lights the room its wearer is in.bright 2makes a light that never goes out and can't be put out. A torch made withLIGHT_DEFhas nobrightuntil someone lights it.lightis the light inside the object, for objects players can enter. Both are -6 to 6.
- minv
- The administrator invisibility level: only administrators of at least this level can see the object. Use it for objects that run DIL programs and should not be seen by players.
minv 239
- alignment
- A number from -1000 to 1000. No command uses an object's alignment, but DIL programs can read it.
- spell
- The object's magic resistance, 0 to 255: how well it resists spells cast on it. For potions, scrolls, wands and staffs,
value[0](the spell power) is used instead.
- value
- Five numbers,
value[0]tovalue[4], whose meaning depends on the type: for a weapon they are the weapon type, craftsmanship, magic bonus and slaying race. Let the macros set them unless a DIL program of your own needs a value. Object macros lists what each type keeps in them.
value[0] 5 value[4] 12
- affect
- Bonuses and penalties the object gives its wearer, and curses. Don't write
affectblocks yourself: vmc checks them and refuses anything the game doesn't know. Use the transfer macros andCURSED_OBJECTon Object macros.
- dilcopy, dilbegin
- DIL programs on the object.
dilcopyruns a template from another zone with arguments;vme/zone/function.zonhas many made for objects, such as restrictions on who can use an item:
dilcopy level_restrict@function(10, 0, 25, "");
- DIL functions for objects describes them, and More complex objects puts some to work. vmc doesn't check a template's name or arguments; read the template's
dilbeginline in its zone before you use it. How to write DIL of your own is in the DIL manual.