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.

40d:Raw file

From Dwarf Fortress Wiki
Revision as of 11:48, 9 August 2008 by Marasmusine (talk | contribs) (cat)
Jump to navigation Jump to search

Introduction

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. This page describes the main idea of the raw file.

What is a "raw file"?

Where are they?

A "raw file" is a text file which is stored in 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. The second one contains all the major moddable info about the game.

How does the game understands their content?

Syntax

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:

  • 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).