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.

23a:Raw file

From Dwarf Fortress Wiki
Revision as of 04:45, 6 January 2023 by Lethosor (talk | contribs) (use category template for versioning)
Jump to navigation Jump to search
This article is about an older version of DF.

Raw files are text files found in the raw/objects/ subdirectory of Dwarf Fortress (used for world generation). These files can be looked through to discover various specifics of game items, materials, and creatures, and can be changed to alter how the game behaves. They are sometimes referred to by players as just "the raws".

The raw/graphics subfolder of Dwarf Fortress is used to store user-customizable graphics sets.

Dwarf Fortress is not an open-source program, so most modding of the game is limited to altering the raws or doing memory hacking.

Duplicating the raw files can cause several bugs, and even crashes. The game gets very messy and buggy when you do it.

Syntax of raw files

filename

[OBJECT:TYPE]

[TYPE:ID] 
<...contents...>

ID is a unique identificator for your type to use (i.e. [CREATURE:DOG], ID=DOG or [ITEM:ITEM_WEAPON_SWORD], ID=ITEM_WEAPON_SWORD).

Types of content

  • BODY - body parts and structures.
  • CREATURE - creatures.
  • DESCRIPTOR - special descriptive objects to add flavor to the game.
  • ENTITY - civilization types, with assigned race, language, available resources, and behavior.
  • GRAPHICS - custom graphics sets. These are not found inside the raw/objects folder.
    • TILE_PAGE - describes the files containing the custom creature tiles.
    • CREATURE_GRAPHICS - specifies the files and coordinates in which each creature's graphics are located.
  • ITEM - items ranging from ammunition to food types, has secondary types for the purposes of [TYPE:ID].
    • ITEM_AMMO - ammunition for ranged weapons.
    • ITEM_ARMOR - body clothing, including armor.
    • ITEM_FOOD - prepared food definitions.
    • ITEM_GLOVES - hand clothing, including armor.
    • ITEM_HELM - head clothing, including armor.
    • ITEM_INSTRUMENT - instrument definitions.
    • ITEM_PANTS - lower body clothing, including armor.
    • ITEM_SHIELD - shields.
    • ITEM_SHOES - foot clothing, including armor.
    • ITEM_SIEGEAMMO - ammunition for siege weapons that ballistae fire.
    • ITEM_TOY - toy definitions.
    • ITEM_TRAPCOMP - special weapons that can be used in weapon traps.
    • ITEM_WEAPON - weapons that are used by soldiers, as well as digging tools.
  • LANGUAGE - word definitions for the languages used by ENTITY objects.
    • TRANSLATION - provides translations of words from English to the various languages used by each ENTITY (e.g. Dwarvish, Elven, Human, and Goblin).
    • SYMBOL - sorts words into symbolic/poetic groups to be referenced by ENTITY preferences.
    • WORD - defines individual words and their alternate forms (in English).
  • MATGLOSS - defines materials.
    • MATGLOSS_GEM — gem type definitions.
    • MATGLOSS_PLANT — plant type definitions.
    • MATGLOSS_STONE — stone type definitions.
    • MATGLOSS_WOOD — tree type definitions.

Usually empty strings are used to divide different types of structures like the fine name and [OBJECT:] or different entries, however everything which is not a token besides the 1st string (which is the filename) is understood as comments and is not considered.

The tokens are enclosed in square brackets ([TOKEN:VALUES]).

When the game is started, the program "compiles" each file from <game folder>/raw/objects folder and converts them in actual data files which are placed in <game folder>/data/objects folder with the same names. This is made every time you start the game, so if you make any changes to file structure or remove some files, don't forget to clear the /data/objects folder as well, otherwise the game can get confused by data files which are no longer supported by raw files.

A list of tokens can be seen at Category:Tokens.