v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Difference between revisions of "Utility:DFHack/createitem"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
(The selected unit doesnt actually get any experience, because they're performing a custom reaction with [SKILL:NONE]. Also, it only goes beneath the cursor if you didn't select a unit)
 
(32 intermediate revisions by 18 users not shown)
Line 1: Line 1:
 
This is a list of <code>createitem</code> commands for [[Utility:DFHack|DFHack]].
 
This is a list of <code>createitem</code> commands for [[Utility:DFHack|DFHack]].
  
Not to be confused with <code>create-items</code>, a Ruby script with different syntax and support for fewer types of items.
+
Not to be confused with <code>gui/create-item</code>, an interactive Lua script, or <code>create-items</code>, a Ruby script with different syntax and support for fewer types of items.
  
 
= Usage =
 
= Usage =
Line 8: Line 8:
 
  createitem {{tc|green|'''[Item token]'''}} {{tc|blue|'''[Material]'''}} {{tc|red|'''[Quantity (optional)]'''}}
 
  createitem {{tc|green|'''[Item token]'''}} {{tc|blue|'''[Material]'''}} {{tc|red|'''[Quantity (optional)]'''}}
  
* "createitem" must be run with a creature/unit selected and will place items at their feet.
+
* If you select a unit, then that unit will be used as the crafter, otherwise the first unit in the fortress will be automatically selected. Clothing and armor items will be sized for that unit's creature type.
 +
* By default, items will be placed on the floor, either at the feet of the selected unit or beneath the cursor.
 +
** If you select a container (such as a barrel, backpack, or minecart) and type <code>createitem item</code>, all subsequently created items will be placed inside that container.
 +
** If you select a building (such as a workshop, chest, or weapon rack) and type <code>createitem building</code>, all subsequently created items will be placed inside that building.
 +
** Typing <code>createitem floor</code> will switch it back to placing created items on the floor. This will also happen automatically if the previously-selected container or building is destroyed.
 
* A list of valid item tokens can be found [[item token|here]]. Note that CORPSE, CORPSEPIECE, and FOOD are not supported by DFHack.
 
* A list of valid item tokens can be found [[item token|here]]. Note that CORPSE, CORPSEPIECE, and FOOD are not supported by DFHack.
* You can create multiple items at once by appending a number to the createitem command (e.g. <code>createitem BOULDER INORGANIC:HEMATITE 20</code>). Note that certain item types will be created in stacks, while others will be created as individual items - see the [[DF2012:Reactions#quantity_2|Reactions]] page for more information.
+
* You can create multiple items at once by appending a number to the createitem command (e.g. <code>createitem BOULDER INORGANIC:HEMATITE 20</code>). Note that certain item types will be created in stacks, while others will be created as individual items - see the [[Reactions#quantity_2|Reactions]] page for more information.
 
* Text in ''italics'' should be replaced with the ID from the relevant raw page on this wiki. For example, to make goblin-cap logs, visit the [[goblin-cap]] page and view the raws. The ID is found in the first token, separated from the item type with a colon - for example, the ID for goblin-caps is <code>GOBLIN_CAP</code>, retrieved from <code>[PLANT:GOBLIN_CAP]</code>.
 
* Text in ''italics'' should be replaced with the ID from the relevant raw page on this wiki. For example, to make goblin-cap logs, visit the [[goblin-cap]] page and view the raws. The ID is found in the first token, separated from the item type with a colon - for example, the ID for goblin-caps is <code>GOBLIN_CAP</code>, retrieved from <code>[PLANT:GOBLIN_CAP]</code>.
 +
** Some IDs contain a space which needs to be quoted, for example <code>createitem ROUGH "INORGANIC:LAPIS LAZULI"</code>.
 +
** All ID values are ''case sensitive'', so make sure you capitalize them correctly - in vanilla raws, they are typically all uppercase, but mixed-case IDs may be encountered when using mods.
  
 
__TOC__
 
__TOC__
Line 57: Line 63:
  
 
(Items made of glass, e.g. furniture, use these names as well)
 
(Items made of glass, e.g. furniture, use these names as well)
 +
 +
== Fuel ==
 +
* Coke
 +
BAR COAL:COKE
 +
* Charcoal
 +
BAR COAL:CHARCOAL
 +
 +
== Misc ==
 +
* Ash bars
 +
BAR ASH
 +
* Liquids (non-DRINK but including milk)
 +
LIQUID_MISC ''material''
 +
* Quires
 +
TOOL:ITEM_TOOL_QUIRE ''material''
 +
* Pipe sections
 +
PIPE_SECTION ''material''
  
 
== Armor ==
 
== Armor ==
 
* Gauntlets (will automatically be created in pairs)
 
* Gauntlets (will automatically be created in pairs)
 
  GLOVES:ITEM_GLOVES_GAUNTLETS ''material''
 
  GLOVES:ITEM_GLOVES_GAUNTLETS ''material''
 +
* Gloves (will automatically be created in pairs)
 +
GLOVES:ITEM_GLOVES_GLOVES ''material''
 +
* Helm
 +
HELM:ITEM_HELM_HELM ''material''
 +
* Cap
 +
HELM:ITEM_HELM_CAP ''material''
 +
* Breastplate
 +
ARMOR:ITEM_ARMOR_BREASTPLATE ''material''
 +
* Mail shirt
 +
ARMOR:ITEM_ARMOR_MAIL_SHIRT ''material''
 +
* Greaves
 +
PANTS:ITEM_PANTS_GREAVES ''material''
 +
* Leggings
 +
PANTS:ITEM_PANTS_LEGGINGS ''material''
 +
* High boots (will automatically be created in pairs)
 +
SHOES:ITEM_SHOES_BOOTS ''material''
 +
* Low boots (will automatically be created in pairs)
 +
SHOES:ITEM_SHOES_SHOES ''material''
 +
* Shoes (will automatically be created in pairs)
 +
SHOES:ITEM_SHOES_BOOTS_LOW ''material''
 +
* Cloak
 +
ARMOR:ITEM_ARMOR_CLOAK ''material''
 +
* Shield
 +
SHIELD:ITEM_SHIELD_SHIELD ''material''
 +
* Buckler
 +
SHIELD:ITEM_SHIELD_BUCKLER ''material''
 +
* Skirt (long)
 +
PANTS:ITEM_PANTS_SKIRT_LONG ''material''
 +
* Skirt (short)
 +
PANTS:ITEM_PANTS_SKIRT_SHORT ''material''
 +
* Skirt
 +
PANTS:ITEM_PANTS_SKIRT ''material''
  
 
== Weapons ==
 
== Weapons ==
Line 142: Line 196:
 
| Armor stand || ARMORSTAND
 
| Armor stand || ARMORSTAND
 
|-
 
|-
| Bag || BOX
+
| Bag || BAG
 
|-
 
|-
 
| Bed || BED
 
| Bed || BED
Line 182: Line 236:
  
 
== Animal products ==
 
== Animal products ==
=== Cloth/leather ===
+
=== Cloth/leather/milk ===
 
* Yarn (creature must be able to produce wool):
 
* Yarn (creature must be able to produce wool):
 
  CLOTH CREATURE_MAT:''creature'':HAIR
 
  CLOTH CREATURE_MAT:''creature'':HAIR
Line 189: Line 243:
 
* Plant fiber (only works with appropriate plants):
 
* Plant fiber (only works with appropriate plants):
 
  CLOTH PLANT_MAT:''plant'':THREAD
 
  CLOTH PLANT_MAT:''plant'':THREAD
(Example: createitem CLOTH PLANT_MAT:GRASS_TAIL_PIG 1)
+
(Example: createitem CLOTH PLANT_MAT:GRASS_TAIL_PIG:THREAD 1)
 
* Leather (tanned):
 
* Leather (tanned):
 
  SKIN_TANNED CREATURE_MAT:''creature'':LEATHER
 
  SKIN_TANNED CREATURE_MAT:''creature'':LEATHER
 +
* Milk (creature must be able to produce milk):
 +
LIQUID_MISC CREATURE_MAT:''creature'':MILK
  
 
=== Shells ===
 
=== Shells ===
* Shells (when demanded for moods, for example) are body parts and cannot be created directly. But it is possible to create a raw fish, then process it in a fishery:
+
* Shells (when demanded for [[mood]]s, for example) are body parts and cannot be created directly. But it is possible to create a raw fish, then process it in a fishery:
 
  FISH_RAW ''creature'':''caste''
 
  FISH_RAW ''creature'':''caste''
 +
Example:
 +
createitem FISH_RAW POND_TURTLE:MALE
  
 
== Plant products ==
 
== Plant products ==
 +
 +
=== Drinks ===
 +
* Drink made from the specified plant:
 +
DRINK PLANT_MAT:''plant'':DRINK
 +
Example: createitem DRINK PLANT_MAT:MUSHROOM_HELMET_PLUMP:DRINK
 +
 +
Spawning drinks on the ground will create an undrinkable puddle. You may wish to select an empty barrel with the cursor first.
 +
 +
=== Mill Products ===
 +
* Flour, dyes, and sugar:
 +
POWDER_MISC PLANT_MAT:''plant'':MILL
 +
Example: createitem POWDER_MISC PLANT_MAT:MUSHROOM_CUP_DIMPLE:MILL
 +
 +
Note that powders will only be usable if you create them into a bag by doing "createitem item" beforehand.
 +
 
=== Seeds ===
 
=== Seeds ===
* Create seeds for farming:
+
* Seeds for farming:
 
  SEEDS PLANT_MAT:''plant'':SEED
 
  SEEDS PLANT_MAT:''plant'':SEED
 +
 +
=== Growths ===
 +
* Growths being FRUIT, LEAVES, FLOWERS, etc:
 +
PLANT_GROWTH PLANT:''plant'':''growth''
 +
 +
== Equipment ==
 +
* Flask/Waterskin/Vial:
 +
FLASK:NONE ''material''
 +
* Backpack:
 +
BACKPACK:NONE ''material''
  
 
= Materials =
 
= Materials =
Line 208: Line 291:
 
  ''item'' CREATURE_MAT:''creature'':{{tc|green|''material''}}
 
  ''item'' CREATURE_MAT:''creature'':{{tc|green|''material''}}
 
Valid materials:
 
Valid materials:
* Edible
+
* Edible (e.g. for MEAT items)
 
** MUSCLE
 
** MUSCLE
 
** EYE<sup>4</sup>
 
** EYE<sup>4</sup>

Latest revision as of 21:57, 1 May 2024

This is a list of createitem commands for DFHack.

Not to be confused with gui/create-item, an interactive Lua script, or create-items, a Ruby script with different syntax and support for fewer types of items.

Usage[edit]

Format:

createitem [Item token] [Material] [Quantity (optional)]
  • If you select a unit, then that unit will be used as the crafter, otherwise the first unit in the fortress will be automatically selected. Clothing and armor items will be sized for that unit's creature type.
  • By default, items will be placed on the floor, either at the feet of the selected unit or beneath the cursor.
    • If you select a container (such as a barrel, backpack, or minecart) and type createitem item, all subsequently created items will be placed inside that container.
    • If you select a building (such as a workshop, chest, or weapon rack) and type createitem building, all subsequently created items will be placed inside that building.
    • Typing createitem floor will switch it back to placing created items on the floor. This will also happen automatically if the previously-selected container or building is destroyed.
  • A list of valid item tokens can be found here. Note that CORPSE, CORPSEPIECE, and FOOD are not supported by DFHack.
  • You can create multiple items at once by appending a number to the createitem command (e.g. createitem BOULDER INORGANIC:HEMATITE 20). Note that certain item types will be created in stacks, while others will be created as individual items - see the Reactions page for more information.
  • Text in italics should be replaced with the ID from the relevant raw page on this wiki. For example, to make goblin-cap logs, visit the goblin-cap page and view the raws. The ID is found in the first token, separated from the item type with a colon - for example, the ID for goblin-caps is GOBLIN_CAP, retrieved from [PLANT:GOBLIN_CAP].
    • Some IDs contain a space which needs to be quoted, for example createitem ROUGH "INORGANIC:LAPIS LAZULI".
    • All ID values are case sensitive, so make sure you capitalize them correctly - in vanilla raws, they are typically all uppercase, but mixed-case IDs may be encountered when using mods.

Items[edit]

Inorganic items[edit]

Most of these can be obtained from the list of item tokens.

Stone[edit]

  • Boulders (i.e. mined stones):
BOULDER INORGANIC:stone
  • Blocks
BLOCKS INORGANIC:stone

Wood[edit]

  • Logs
WOOD PLANT_MAT:tree:WOOD
  • Blocks
BLOCKS PLANT_MAT:tree:WOOD

Metal[edit]

BAR INORGANIC:metal

Gems[edit]

  • Rough gems
ROUGH INORGANIC:gem
  • Small cut gems
SMALLGEM INORGANIC:gem
  • Large cut gems
GEM INORGANIC:gem

Glass[edit]

Raw glass:

ROUGH glass:NONE
Glass Material token ("glass")
Green glass GLASS_GREEN
Clear glass GLASS_CLEAR
Crystal glass GLASS_CRYSTAL

(Items made of glass, e.g. furniture, use these names as well)

Fuel[edit]

  • Coke
BAR COAL:COKE
  • Charcoal
BAR COAL:CHARCOAL

Misc[edit]

  • Ash bars
BAR ASH
  • Liquids (non-DRINK but including milk)
LIQUID_MISC material
  • Quires
TOOL:ITEM_TOOL_QUIRE material
  • Pipe sections
PIPE_SECTION material

Armor[edit]

  • Gauntlets (will automatically be created in pairs)
GLOVES:ITEM_GLOVES_GAUNTLETS material
  • Gloves (will automatically be created in pairs)
GLOVES:ITEM_GLOVES_GLOVES material
  • Helm
HELM:ITEM_HELM_HELM material
  • Cap
HELM:ITEM_HELM_CAP material
  • Breastplate
ARMOR:ITEM_ARMOR_BREASTPLATE material
  • Mail shirt
ARMOR:ITEM_ARMOR_MAIL_SHIRT material
  • Greaves
PANTS:ITEM_PANTS_GREAVES material
  • Leggings
PANTS:ITEM_PANTS_LEGGINGS material
  • High boots (will automatically be created in pairs)
SHOES:ITEM_SHOES_BOOTS material
  • Low boots (will automatically be created in pairs)
SHOES:ITEM_SHOES_SHOES material
  • Shoes (will automatically be created in pairs)
SHOES:ITEM_SHOES_BOOTS_LOW material
  • Cloak
ARMOR:ITEM_ARMOR_CLOAK material
  • Shield
SHIELD:ITEM_SHIELD_SHIELD material
  • Buckler
SHIELD:ITEM_SHIELD_BUCKLER material
  • Skirt (long)
PANTS:ITEM_PANTS_SKIRT_LONG material
  • Skirt (short)
PANTS:ITEM_PANTS_SKIRT_SHORT material
  • Skirt
PANTS:ITEM_PANTS_SKIRT material

Weapons[edit]

  • Whip:
WEAPON:ITEM_WEAPON_WHIP material
  • Battle axe:
WEAPON:ITEM_WEAPON_AXE_BATTLE material
  • War hammer:
WEAPON:ITEM_WEAPON_HAMMER_WAR material
  • Short sword:
WEAPON:ITEM_WEAPON_SWORD_SHORT material
  • Spear:
WEAPON:ITEM_WEAPON_SPEAR material
  • Mace:
WEAPON:ITEM_WEAPON_MACE material
  • Crossbow:
WEAPON:ITEM_WEAPON_CROSSBOW material
  • Pick:
WEAPON:ITEM_WEAPON_PICK material
  • Bow:
WEAPON:ITEM_WEAPON_BOW material
  • Blowgun:
WEAPON:ITEM_WEAPON_BLOWGUN material
  • Pike:
WEAPON:ITEM_WEAPON_PIKE material
  • Halberd:
WEAPON:ITEM_WEAPON_HALBERD material
  • Two-handed sword:
WEAPON:ITEM_WEAPON_SWORD_2H material
  • Long sword:
WEAPON:ITEM_WEAPON_SWORD_LONG material
  • Maul:
WEAPON:ITEM_WEAPON_MAUL material
  • Great axe:
WEAPON:ITEM_WEAPON_AXE_GREAT material
  • Dagger:
WEAPON:ITEM_WEAPON_DAGGER_LARGE material
  • Scourge:
WEAPON:ITEM_WEAPON_SCOURGE material
  • Flail:
WEAPON:ITEM_WEAPON_FLAIL material
  • Morningstar:
WEAPON:ITEM_WEAPON_MORNINGSTAR material
  • Scimitar:
WEAPON:ITEM_WEAPON_SCIMITAR material
  • Training axe:
WEAPON:ITEM_WEAPON_AXE_TRAINING material
  • Training sword:
WEAPON:ITEM_WEAPON_SWORD_SHORT_TRAINING material
  • Training spear:
WEAPON:ITEM_WEAPON_SPEAR_TRAINING material

Ammo[edit]

  • Bolts:
AMMO:ITEM_AMMO_BOLTS material
AMMO:ITEM_AMMO_BOLTS PLANT:GOBLIN_CAP:WOOD

Trap components[edit]

  • Menacing spike
TRAPCOMP:ITEM_TRAPCOMP_MENACINGSPIKE material
  • Large, serrated disc
TRAPCOMP:ITEM_TRAPCOMP_LARGESERRATEDDISC material
  • Spiked ball
TRAPCOMP:ITEM_TRAPCOMP_SPIKEDBALL material
  • Enormous corkscrew
TRAPCOMP:ITEM_TRAPCOMP_ENORMOUSCORKSCREW material
  • Giant axe blade
TRAPCOMP:ITEM_TRAPCOMP_GIANTAXEBLADE material

Tools[edit]

  • Nest box
TOOL:ITEM_TOOL_NEST_BOX material

Furniture[edit]

Format:

createitem Item token (from list below) Material

"Material" is the same as the material used to create basic items (e.g. logs, boulders, bars, etc.)

Item Item token
Armor stand ARMORSTAND
Bag BAG
Bed BED
Box BOX
Cabinet CABINET
Cage CAGE
Chair CHAIR
Chest BOX
Coffer
Coffin COFFIN
Door DOOR
Floodgate FLOODGATE
Grate GRATE
Hatch cover HATCH_COVER
Mechanisms TRAPPARTS
Slab SLAB
Statue STATUE
Table TABLE
Traction bench TRACTION_BENCH
Weapon rack WEAPONRACK

Animal products[edit]

Cloth/leather/milk[edit]

  • Yarn (creature must be able to produce wool):
CLOTH CREATURE_MAT:creature:HAIR
  • Silk (creature must be able to produce silk):
CLOTH CREATURE_MAT:creature:SILK
  • Plant fiber (only works with appropriate plants):
CLOTH PLANT_MAT:plant:THREAD

(Example: createitem CLOTH PLANT_MAT:GRASS_TAIL_PIG:THREAD 1)

  • Leather (tanned):
SKIN_TANNED CREATURE_MAT:creature:LEATHER
  • Milk (creature must be able to produce milk):
LIQUID_MISC CREATURE_MAT:creature:MILK

Shells[edit]

  • Shells (when demanded for moods, for example) are body parts and cannot be created directly. But it is possible to create a raw fish, then process it in a fishery:
FISH_RAW creature:caste

Example:

createitem FISH_RAW POND_TURTLE:MALE

Plant products[edit]

Drinks[edit]

  • Drink made from the specified plant:
DRINK PLANT_MAT:plant:DRINK

Example: createitem DRINK PLANT_MAT:MUSHROOM_HELMET_PLUMP:DRINK

Spawning drinks on the ground will create an undrinkable puddle. You may wish to select an empty barrel with the cursor first.

Mill Products[edit]

  • Flour, dyes, and sugar:
POWDER_MISC PLANT_MAT:plant:MILL

Example: createitem POWDER_MISC PLANT_MAT:MUSHROOM_CUP_DIMPLE:MILL

Note that powders will only be usable if you create them into a bag by doing "createitem item" beforehand.

Seeds[edit]

  • Seeds for farming:
SEEDS PLANT_MAT:plant:SEED

Growths[edit]

  • Growths being FRUIT, LEAVES, FLOWERS, etc:
PLANT_GROWTH PLANT:plant:growth

Equipment[edit]

  • Flask/Waterskin/Vial:
FLASK:NONE material
  • Backpack:
BACKPACK:NONE material

Materials[edit]

Unusual materials that work for most items above

Body parts[edit]

Format:

item CREATURE_MAT:creature:material

Valid materials:

  • Edible (e.g. for MEAT items)
    • MUSCLE
    • EYE4
    • BRAIN
    • LUNG
    • HEART
    • LIVER
    • GUT
    • STOMACH
    • GIZZARD
    • PANCREAS
    • SPLEEN
    • KIDNEY
  • Craftable
    • BONE1,4
    • SHELL3
    • HOOF3
    • HORN3
    • IVORY3
    • TOOTH1
    • SILK3
    • HAIR1,4 (sometimes)
  • Processable
    • SKIN1,4
      • LEATHER
    • FAT
      • TALLOW
        • SOAP
    • MILK3
      • CHEESE
  • Useless
    • CHITIN2
    • CARTILAGE1,4
    • SPINE3
    • NERVE
    • SINEW3
    • BLOOD3
    • PUS3
    • ICHOR3
    • GOO3
    • FEATHER3
    • SCALE3
    • CLAW3
    • NAIL3
    • TALON3
1 - only present on standard creatures
2 - only present on chitinous creatures
3 - only present on some creatures
4 - missing from some creatures