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 "40d:Raw file"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
(+modding category)
 
(25 intermediate revisions by 10 users not shown)
Line 1: Line 1:
= Introduction =
+
{{Quality|Superior|13:25, 5 August 2013 (UTC)}}
 +
{{av}}'''Raw files''' are text files found in the \raw\objects subfolder of Dwarf Fortress.  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 modding of the Dwarf Fortress game is mostly limited to the things the author allowed us to do via text files because the application is not an open-source one.
+
The \raw\graphics subfolder of Dwarf Fortress is used to store user-customizable [[Graphics set repository|graphics sets]].
This page describes the main idea of the raw file.
 
  
= What is a "raw file"? =
+
Dwarf Fortress is not an open source program, so most [[modding]] of the game is limited to altering the raws or doing [[memory hacking]].
  
== Where are they? ==
+
==Syntax of raw files==
A "raw file" is a text file which is stored into your <game folder>/raw/ folder.
 
There're 2 subfolders: "graphics" and "objects".
 
  
The first one contains information about a special feature which supports replacement of ascii characters for creatures with actual pictures.
+
filename
The second one contains all the major moddable info about the game.
+
 +
[OBJECT:TYPE]
 +
 +
[TYPE:ID]
 +
<...contents...>
  
== How does the game understands their content? ==
+
ID is an unique identificator for your type to use (i.e. [CREATURE:DOG], ID=DOG or [ITEM:ITEM_WEAPON_SWORD], ID=ITEM_WEAPON_SWORD).
 
 
There are 2 major rules about raw file for the game to read it.
 
 
 
1) It should have a file name (without an extension) in the first string inside.
 
 
 
2) The next not empty string* should be a [OBJECT:TYPE] token which describes the contents of the file.
 
The types are:
 
BODY, CREATURE, DESCRIPTOR, ENTITY, GRAPHICS, ITEM, LANGUAGE, MATGLOSS, REACTION.
 
  
 +
===Types of content:===
 
*BODY - body parts and structures
 
*BODY - body parts and structures
 
*CREATURE - creatures
 
*CREATURE - creatures
Line 33: Line 28:
 
*REACTION - smelter reactions
 
*REACTION - smelter reactions
  
* usually the 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.
+
 
 +
    * usually the 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]).
 
The tokens are enclosed in square brackets ([TOKEN:VALUES]).
[Category:Tokens|The list of tokens]
 
  
 
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 for the game to avoid presense of data files which are no longer supported by raw files (the engine does not check for it yet).
 
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 for the game to avoid presense of data files which are no longer supported by raw files (the engine does not check for it yet).
 +
 +
A list of tokens can be seen at [[:Category:Tokens]].
 +
 +
{{Category|Files}}
 +
{{Category|Modding}}

Latest revision as of 04:46, 6 January 2023

This article is about an older version of DF.

Raw files are text files found in the \raw\objects subfolder of Dwarf Fortress. 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.

Syntax of raw files[edit]

filename

[OBJECT:TYPE]

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

ID is an 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:[edit]

  • BODY - body parts and structures
  • CREATURE - creatures
  • DESCRIPTOR - objects to be used for engravings/symbols
  • ENTITY - civilizations
  • GRAPHICS - graphic tiles for creatures
  • ITEM - items
  • LANGUAGE - language translation
  • MATGLOSS - different types of materials (soil, minerals, wood, plants etc.)
  • REACTION - smelter reactions


   * usually the 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 for the game to avoid presense of data files which are no longer supported by raw files (the engine does not check for it yet).

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