Difference between revisions of "ITEMDEF"
From SphereWiki
m (Added languagemenue) |
(→Examples) |
||
Line 151: | Line 151: | ||
==Examples== | ==Examples== | ||
− | < | + | <tt>// |
− | // Blue Gold | + | // Blue Gold |
− | // | + | // |
− | [ITEMDEF i_gold_blue] | + | [ITEMDEF i_gold_blue] |
− | ID=i_gold // inherits from i_gold | + | ID=i_gold // inherits from i_gold |
− | NAME=Blue Gold // named Blue Gold | + | NAME=Blue Gold // named Blue Gold |
− | TYPE=t_gold // is type t_gold | + | TYPE=t_gold // is type t_gold |
− | VALUE=10 // valued at gold | + | VALUE=10 // valued at gold |
− | + | ||
− | ON=@Create | + | ON=@Create |
− | + | COLOR = colors_blue | |
− | + | ||
− | + | ||
− | // | + | // |
− | // Small Stone and Plaster House (from default script pack) | + | // Small Stone and Plaster House (from default script pack) |
− | // | + | // |
− | [ITEMDEF 04064] // item ID 0x4064 (in mul files) | + | [ITEMDEF 04064] // item ID 0x4064 (in mul files) |
− | DEFNAME=i_multi_house_stone_plaster_small | + | DEFNAME=i_multi_house_stone_plaster_small |
− | NAME=Small Stone and Plaster House | + | NAME=Small Stone and Plaster House |
− | TYPE=t_multi | + | TYPE=t_multi |
− | VALUE=43800 // valued at 43800 gold | + | VALUE=43800 // valued at 43800 gold |
− | MULTIREGION=-3,-3,3,4 // size of the region, relative to location of the item | + | MULTIREGION=-3,-3,3,4 // size of the region, relative to location of the item |
− | COMPONENT=i_door_wood,0,3,7 // adds a door at 0,3,7 (relative to location of the item) | + | COMPONENT=i_door_wood,0,3,7 // adds a door at 0,3,7 (relative to location of the item) |
− | COMPONENT=i_sign_brass_2,2,4,5 // adds a brass sign at 2,4,5 (relative to location of the item)</ | + | COMPONENT=i_sign_brass_2,2,4,5 // adds a brass sign at 2,4,5 (relative to location of the item)</tt> |
− | + | ||
[[Category: Reference Compendium]] | [[Category: Reference Compendium]] | ||
[[Category: Definitions]] | [[Category: Definitions]] |
Revision as of 12:19, 27 October 2011
Missing languages
An ITEMDEF block defines the basic properties of an item.
Properties
Here is a list of all item definition properties.
Name | Read/Write | Description |
ARMOR min,max | RW | Gets or sets the base protection that the armour will give. |
ARMOR.LO | R | Gets the minimum base protection the armour will give. |
ARMOR.HI | R | Gets the maximum base protection the armour will give. |
BASEID | R | Gets the defname of the item if set, otherwise the ID. |
CAN | RW | Gets or sets attributes for the item. See can_i_flags in sphere_defs.scp. |
DAM min,max | RW | Gets or sets the base damage that the weapon will deal. |
DAM.LO | R | Gets the minimum base damage the weapon will deal. |
DAM.HI | R | Gets the maximum base damage the weapon will deal. |
DEFNAME | RW | Gets or sets defname of the item |
DISPID | RW | Gets or sets the ID to display as to clients. |
DUPEITEM | RW | Gets or sets the defname of the item that this is a duplicate/rotation of (see DUPELIST). |
DUPELIST item_defname, item_defname, ... | RW | Gets or sets a comma-separated list of items that this item will cycle through when rotated. |
DYE | RW | Gets or sets whether or not the item can be dyed using dye tubs (1 or 0). |
FLIP | RW | Gets or sets whether or not the item automatically rotates when dropped. |
HEIGHT | RW | Gets or sets the height of the item. |
ID | RW | Gets or sets the ID of the item to inherit property values from. |
INSTANCES | R | Returns the number of this item that exist in the world. |
ISARMOR | R | Gets whether or not the item is considered to be armour. |
ISWEAPON | R | Gets whether or not the item is considered to be a weapon. |
LAYER | RW | Gets or sets the layer that the item will occupy when equipped (1 or 0). |
NAME | RW | Gets or sets the name of the item. |
RANGE min, max | RW | Gets or sets the range of the weapon. |
RANGEH | R | Gets the maximum range of the weapon. |
RANGEL | R | Gets the minimum range of the weapon. |
REPAIR | RW | Gets or sets whether or not the item can be repaired (1 or 0). |
REPLICATE | RW | Gets or sets whether or not multiple instances of the item can be crafted at once. |
RESDISPDNHUE | RW | Gets or sets the colour to display as to clients who don't have a high enough RESDISP to see the item. |
RESDISPNID | RW | Gets or sets the item ID to display as to clients who don't have a high enough RESDISP to see the item. |
RESLEVEL | RW | Gets the minimum RESDISP required for a client to see the item. |
RESMAKE | R | Returns the names of the resources needed to craft the item. |
RESOURCES | RW | Gets or sets the resources that are needed to craft the item. |
RESOURCES.COUNT | R | Gets the number of different resources that are needed to craft the item. |
RESOURCES.n.KEY | R | Gets the BASEID of the nth resource needed to craft the item. (zero-based) |
RESOURCES.n.VAL | R | Gets the amount of the nth resource needed to craft the item. (zero-based) |
REQSTR | RW | Gets or sets the amount of strength needed to equip the item. |
SKILL | RW | Gets or sets the skill that is used with the weapon. |
SKILLMAKE | RW | Gets or sets the list of skills needed to craft the item. |
SKILLMAKE.n.KEY | R | Gets the name of the nth skill needed to craft the item. |
SKILLMAKE.n.VAL | R | Gets the amount of the nth skill needed to craft the item. |
SPEED | RW | Gets or sets the speed of the weapon. |
TAG.name | RW | Gets or sets the value of a TAG. |
TDATA1 | RW | Gets or sets the TDATA1 value of the item. |
TDATA2 | RW | Gets or sets the TDATA2 value of the item. |
TDATA3 | RW | Gets or sets the TDATA3 value of the item. |
TDATA4 | RW | Gets or sets the TDATA4 value of the item. |
TEVENTS | RW | Gets a list of events attached the item, or adds an event to the item. |
TFLAGS | RW | Gets or sets the flags of the item from tiledata.mul. |
TWOHANDS | RW | Gets or sets whether or not the item occupies both hands when equipped (layer_hand2) |
TYPE | RW | Gets or sets the item's type. |
VALUE | RW | Gets or sets the base value of the item. |
WEIGHT | RW | Gets or sets the weight of the item. |
Multi Definitions
For multi items (t_multi, t_multi_custom, t_ship), the ITEMDEF has additional properties.
Properties
Here is a list of all multi definition properties.
Name | Read/Write | Override† | Description |
BASECOMPONENT | R | ?? | Gets how many static components the multi has in the multi.mul file. |
BASECOMPONENT.n.KEY | R | ?? | Accesses the multi's static components directly from the multi.mul file. (ID,DX,DY,DZ,D,VISIBLE) |
COMPONENT | R | ?? | Gets how many dynamic components have been defined for the multi. |
COMPONENT.n.KEY | R | ?? | Accesses the multi's dynamic components. (ID,DX,DY,DZ,D) |
COMPONENT item_defname, dx, dy, dz | W | ?? | Defines a dynamic component to the multi that will be spawned along with it (e.g. doors and house sign) |
MULTIREGION left, top, right, bottom | RW | ?? | Gets or sets the boundaries of the multi (t_multi, t_multi_custom, t_ship). |
REGIONFLAGS | RW | ?? | Gets or sets the flags that will be set on the multi's region. |
SHIPSPEED tiles, period | RW | ?? | Gets or sets the speed that a ship will move at. (t_ship only) |
SHIPSPEED.TILES | RW | Y | Gets or sets the speed that a ship will move at. (t_ship only) |
SHIPSPEED.PERIOD | RW | Y | Gets or sets the speed that a ship will move at. (t_ship only) |
TSPEECH | RW | ?? | Gets a list of attached SPEECH handlers, or adds a handler to the multi. |
† Some ITEMDEF properties can be overridden using tags. For example, TAG.OVERRIDE.SHIPSPEED.PERIOD and TAG.OVERRIDE.SHIPSPEED.TILES can be set on individual ships in-game to affect their speed.
Examples
// // Blue Gold // [ITEMDEF i_gold_blue] ID=i_gold // inherits from i_gold NAME=Blue Gold // named Blue Gold TYPE=t_gold // is type t_gold VALUE=10 // valued at gold ON=@Create COLOR = colors_blue // // Small Stone and Plaster House (from default script pack) // [ITEMDEF 04064] // item ID 0x4064 (in mul files) DEFNAME=i_multi_house_stone_plaster_small NAME=Small Stone and Plaster House TYPE=t_multi VALUE=43800 // valued at 43800 gold MULTIREGION=-3,-3,3,4 // size of the region, relative to location of the item COMPONENT=i_door_wood,0,3,7 // adds a door at 0,3,7 (relative to location of the item) COMPONENT=i_sign_brass_2,2,4,5 // adds a brass sign at 2,4,5 (relative to location of the item)