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.

Editing Modding

Jump to navigation Jump to search

Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.

If you are creating a redirect to the current version's page, do not use any namespace. For example: use #REDIRECT [[Cat]], not #REDIRECT [[Main:Cat]] or #REDIRECT [[cv:Cat]]. See DF:Versions for more information.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
 
{{migrated article}}
 
{{migrated article}}
{{Quality|Fine}}
+
{{Quality|Unrated}}
 
{{av}}
 
{{av}}
 
{{For/see|a list of Dwarf Fortress mods|[[List of mods]]}}
 
{{For/see|a list of Dwarf Fortress mods|[[List of mods]]}}
Line 13: Line 13:
 
* [[Mod#Enabling Mods|Enabling mods in-game]]
 
* [[Mod#Enabling Mods|Enabling mods in-game]]
  
; Guides and references:
+
Game data documentation:  
* [[Modding guide|DF RAWs modding guide]]
+
* [[Raw file]]
* [https://docs.dfhack.org/en/latest/docs/guides/modding-guide.html#dfhack-modding-guide DFHack modding guide]
+
* [[Token]]
* [[Modding pitfalls]] for troubleshooting
+
* [[Graphics]]
 +
* [[Speech file]]
  
* [[Mod#Mod Format|Mod Format]] and [[Game folders and files]]
+
Tools & Utilities
* [[Mod#Publish on Steam Workshop|Publish on Steam Workshop]]
+
* [http://www.bay12forums.com/smf/index.php?board=13.0 Official bay12 Forum for modding]
* [[Memory hacking]], [[Main:Offset Finding Methods|Offset Finding Methods]]
+
* [[Utilities#Modding tools]]
 
* [[Character table]]
 
* [[Character table]]
  
; Where to get help?
+
Guides:
* This [http://www.bay12forums.com/smf/index.php?board=13.0 forum] is the official DF subforum dedicated to discussions about modding.
+
* [[#Guide|Guide to Modding]]
* [https://discord.com/channels/329272032778780672/629902895138996264 Kitfox modding discord]
+
* [[Memory hacking]], [[Main:Offset Finding Methods|Offset Finding Methods]]
* [https://docs.dfhack.org/en/stable/docs/Introduction.html#getting-help DFhack questions]
+
* [[Category:DF2014:Modding Examples]]
 
 
; Modding tools
 
There are several [[Utilities#Modding_tools|utilities]] that assist in modding efforts. There is [http://www.bay12forums.com/smf/index.php?topic=28829.0 a list of them] on the [[Bay 12 Forums]].
 
* Text Editors are used in all areas of modding. Use a good text editor to edit files and search into multiple files (like the free [https://notepad-plus-plus.org/ Notepad++] for example) or more advanced editors capable of highlighting and formatting the displayed text (like [[Utilities#DF_RAW_Language_server|DF RAW Language server]])
 
* Image Editor will be needed for doing custom graphics. [https://www.getpaint.net/ Paint.NET], Photoshop and GIMP are the most used, but whatever supports the .png format will work.
 
 
 
=== Documentation===
 
; [[Raw file]]s
 
 
 
These object files, stored in <code>/data/vanilla/*/objects/</code>, define various specifics of game items, materials, and creatures, and can be changed using mods to alter how the game behaves. These are text based and can be edited with any text editor, however, editing the vanilla raw files is now discouraged.
 
 
 
See [[Token|Token reference]] - It's always good to refer to tokens on the wiki. Even experienced modders have to look up tokens! A list of articles about tokens can be found here.
 
 
 
; [[Graphics|Graphics Files]]:
 
 
 
The `/data/art/` subfolder of Dwarf Fortress is used to store user-customizable graphics sets.
 
 
 
; [[Reaction]]s:
 
 
 
; [[Language token|Language]] and [[Speech file]]:
 
  
; [[Audio|Sound and Music files]]:
+
* [[Game folders and files]]
  
All sound and music files used by ''Dwarf Fortress'' are stored in the [https://en.wikipedia.org/wiki/Ogg .ogg] format within the <code>/data/sound/</code> subfolders. You can replace the existing ogg files with different ones. That has to be performed manually and isn't actually supported by the game. You can also change some of the definitions of when certain musical cues are played, using available [[music token]]s and [[sound token]]s in the raw files. However, you can't add new music or sounds other than replacing what's already there.
+
Miscellaneous
 
+
* Development: [[DF2014:Release information|Release information]] • [[Main:Dwarf_Fortress_Talk|Developer diaries]] [[Main:Dwarf_Fortress_Development|Roadmap]]
=== Best practice ===
+
* [[Main:Screenshot|Screenshot]]
The current best practice is to not modify the original raw files, since most modifications can be made via mods. Mods can add new objects, add tokens to existing objects, and cut objects entirely. You should prefer SELECT over CUT, and prefer CUT over not loading vanilla raws.
 
  
 
== Guide ==
 
== Guide ==
Line 66: Line 46:
  
 
=== Basics of DF modding ===
 
=== Basics of DF modding ===
To make a mod, one must put a folder into the <code>/mods/</code> folder. The vast majority of modifications to the game can be done via this method. This folder should contain a file named "info.txt" and two subfolders: "graphics" (where you insert [[Graphics set repository|graphics sets]]), and "objects", which contains all the data for, generally, everything in the game that is not hardcoded.
+
To make a mod, one must put a folder into the \mods\ folder. The vast majority of modifications to the game can be done via this method. This folder should contain a file named "info.txt" and two subfolders: "graphics" (where you insert [[Graphics set repository|graphics sets]]), and "objects", which contains all the data for, generally, everything in the game that is not hardcoded.
  
The [[info.txt]] is formatted like so:
+
The info.txt is formatted like so:
  
 
{{code|
 
{{code|
Line 83: Line 63:
 
A mod should have all of these. There are a [[mod info token|few more tokens]], but the above are the important ones.
 
A mod should have all of these. There are a [[mod info token|few more tokens]], but the above are the important ones.
  
Most of the game's vanilla content is in the same format as mods. Many text files can be found in the subfolders of the <code>/data/vanilla</code> folder - these are the [[raw file|raw files]], and using them as a basis for modification is quite easy. For now, we will take a look at one of the existing files. For example, if you open <code>/data/vanilla/vanilla_creatures/creature_standard.txt</code>, it should look something like this:
+
Most of the game's vanilla content is in the same format as mods. Many text files can be found in the subfolders of the \data\vanilla folder - these are the [[raw file|raw files]], and using them as a basis for modification is quite easy. For now, we will take a look at one of the existing files. For example, if you open vanilla_creatures\creature_standard.txt, it should look something like this:
  
 
{{code|
 
{{code|
Line 99: Line 79:
 
}}
 
}}
  
As you can see, each file comprises a header string stating the file name, a second header stating the type of object data it contains, followed by the contents of the file itself. These are all necessary elements of the file, and without them, the file will be ignored by the game.  
+
As you can see, each file comprises a header string stating the file name, a second header stating the type of object data it contains, followed by the contents of the file itself. These are all necessary elements of the file, and without them, the file will be ignored by the game. You may have also noticed the file naming scheme - this is also important; files containing creatures have names starting with "creature_", entity file names must begin with "entity_", etc..
 
 
'''In other words, to be recognized by the game, a raw file must have all of the following:'''
 
 
 
# A filename that refers to the type of objects contained therein. '''Creature files must start with creature_, entity files must start with entity_, and so on.'''
 
# The filename on the first line of the file.
 
# [OBJECT:type], where "type" is replaced with the relevant object type.
 
  
 
Below the headers, there begins a list of entries. Each entry is made up of its own header (in this case, "[CREATURE:DWARF]"), again stating the type of object, and then the object's unique identifier - if an identifier isn't unique, the game will mess up and you'll get some serious, and potentially very trippy, errors. ([[Duplicated raws|For example...]])  Below that, we have the body of the entry, which determines the entry's specific properties.
 
Below the headers, there begins a list of entries. Each entry is made up of its own header (in this case, "[CREATURE:DWARF]"), again stating the type of object, and then the object's unique identifier - if an identifier isn't unique, the game will mess up and you'll get some serious, and potentially very trippy, errors. ([[Duplicated raws|For example...]])  Below that, we have the body of the entry, which determines the entry's specific properties.
Line 114: Line 88:
  
 
* Try to avoid modifying the existing raw files when possible. You should make a mod instead!
 
* Try to avoid modifying the existing raw files when possible. You should make a mod instead!
* When adding files, token identifiers are all you need to include to ensure proper references are maintained.  The game searches through all loaded raw files by tokens.  For example, you can add a new pair of leather boots and not even have to add it to a file named item_shoes.txt, but rather your own file, say item_shoes_new.txt and ensure you have the token listed, ex. [ITEM_SHOES:ITEM_SHOES_BOOTS_NEW].
+
* When adding files, all you need to include to ensure proper references are maintained is the token identifiers.  The game searches through all loaded raw files by tokens.  For example, you can add a new pair of leather boots and not even have to add it to a file named item_shoes.txt, but rather your own file, say item_shoes_new.txt and ensure you have the token listed, ex. [ITEM_SHOES:ITEM_SHOES_BOOTS_NEW].
  
 
* When a new world is generated, the mods included are "baked in" and cannot be modified except to be updated--for this, the game checks that the mod used by the save is of a compatible NUMERIC_VERSION.
 
* When a new world is generated, the mods included are "baked in" and cannot be modified except to be updated--for this, the game checks that the mod used by the save is of a compatible NUMERIC_VERSION.
Line 121: Line 95:
 
=== Modifying the vanilla objects ===
 
=== Modifying the vanilla objects ===
  
You should not modify the vanilla raws where they originally are if you can help it. Instead, patch them using the patching functions provided with ''Dwarf Fortress'' since v50.01.
+
You should not modify the vanilla raws where they originally are if you can help it. Instead, patch them using the patching functions now provided with Dwarf Fortress since v50.01. If you wanted to mod beards into dwarven women while also removing elephants from the game, for example:
 
 
There are two patching functions: SELECT and CUT. When SELECT is used, it lets you make changes to an object without needing the entire entry to be present in your mod file. When CUT is used, it forces the game to not use that object, even though it is still found in the vanilla raws (or in any other mods earlier in the load order). Both of these functions take the form of tokens. These functions are not universally applicable to any token found in any entry, just the following list of objects:
 
 
 
CREATURE, ENTITY, INTERACTION, ITEM, WORD, TRANSLATION, SYMBOL, INORGANIC, PLANT, MUSIC, REACTION, SOUND
 
 
 
The syntax required for these functions is: '''['''<function>'''_'''<object>''':'''<specific object being affected>''']'''. For instance, [CUT_PLANT:MUSHROOM_HELMET_PLUMP] cuts the plump helmet object in the vanilla file plant_standard.txt, so the game will not use that object at all. However, [SELECT_ITEM_HELM:ITEM_HELM_HELM] does not select the helm object from the vanilla file item_helm.txt, even though that's how the object appears in that file, because there is no [SELECT_ITEM_HELM] token. Instead, the helm would be selected with [SELECT_ITEM:ITEM_HELM_HELM].
 
 
 
For example, if you wanted to mod beards onto dwarven women while also removing elephants from the game:
 
  
 
{{code|
 
{{code|
Line 154: Line 120:
 
     [PERMITTED_BUILDING:MY_BUILDING]
 
     [PERMITTED_BUILDING:MY_BUILDING]
 
}}
 
}}
 +
You can both SELECT and CUT for all of the following types of objects:
 +
 +
CREATURE, ENTITY, INTERACTION, ITEM, WORD, TRANSLATION, SYMBOL, INORGANIC, PLANT, MUSIC, REACTION, SOUND
  
And in any of these, one can add the token [LOG_CURRENT_ENTRY] somewhere under one of the objects of the file, which logs the full contents of the object in question to logs\current_entry.txt. This can be useful to make sure that the patch is doing what you think it is. For instance if [LOG_CURRENT_ENTRY] were added on the next line after [CREATURE:DWARF] in your mod file, then the dwarf object would be the object detailed in the log entry.
+
And in any of these, one can use [LOG_CURRENT_ENTRY], which logs the full contents of the object in question to logs\current_entry.txt. This can be useful to make sure that the patch is doing what you think it is.
  
 
...Speaking of, let's move on to modifying and adding entities.
 
...Speaking of, let's move on to modifying and adding entities.
Line 161: Line 130:
 
=== Modding civilizations (entities) ===
 
=== Modding civilizations (entities) ===
  
Entities - the objects that determine how civilizations work - are stored in <code>vanilla_entities/entity_default.txt</code> (though, like all other files, you may add more). They follow the same format as any other raw file:
+
Entities - the objects that determine how civilizations work - are stored in vanilla_entities\entity_default.txt (though, like all other files, you may add more). They follow the same format as any other raw file:
  
 
{{code|
 
{{code|
Line 177: Line 146:
 
Most of the time, it doesn't matter which order these tokens are in or where they're placed so long as they're below the "ENTITY:" identifier, but there are some important exceptions in the case of other files, especially creatures, which can contain a lot of "nested" tokens.
 
Most of the time, it doesn't matter which order these tokens are in or where they're placed so long as they're below the "ENTITY:" identifier, but there are some important exceptions in the case of other files, especially creatures, which can contain a lot of "nested" tokens.
  
"[CREATURE:]" links the civilization with a specific creature defined in a creature file. This is the creature that'll be making up the entity's population, and, therefore, the creature you'll be playing as in fortress or adventure mode if the entity is a playable one. For example, if you wanted to do something silly, you could switch the "CREATURE:DWARF" entry in entity_default.txt with "CREATURE:ELF" and you would be marching elves around in fortress mode, although they would still use dwarven technology, language and names and so forth. Oh, and before you get any funny ideas - it ''is'' possible to define more than one creature for a civ, but that won't work in quite the way you probably expect; it will pick only one of the defined creatures at random to use for the civ. Later on, in the creature section, you'll learn about castes, which will provide a much more viable alternative, so try to bear with us until then.
+
"[CREATURE:]" links the civilization with a specific creature defined in a creature file. This is the creature that'll be making up the entity's population, and, therefore, the creature you'll be playing as in fortress or adventure mode if the entity is a playable one. For example, if you wanted to do something silly, you could switch the "CREATURE:DWARF" entry in entity_default.txt with "CREATURE:ELF" and you would be marching elves around in fortress mode, although they would still use dwarven technology, language and names and so forth. Oh, and before you get any funny ideas - it ''is'' possible to define more than one creature for a civ, but that won't work in quite the way you probably expect; later on, in the creature section, you'll learn about castes, which will provide a much more viable alternative, so try to bear with us until then.
  
 
"[TRANSLATION:]" defines the language file that the entity will be using, which will determine what their untranslated words are for things. This doesn't determine which words they use for naming things, only the way those words are spelled. The default language files are HUMAN, DWARF, ELF, and GOBLIN.
 
"[TRANSLATION:]" defines the language file that the entity will be using, which will determine what their untranslated words are for things. This doesn't determine which words they use for naming things, only the way those words are spelled. The default language files are HUMAN, DWARF, ELF, and GOBLIN.
Line 199: Line 168:
 
You can find many details about the rest of the civilization tokens [[entity token|here]].  
 
You can find many details about the rest of the civilization tokens [[entity token|here]].  
  
Besides those mentioned, some fundamental ones are the <code>[SITE_CONTROLLABLE]</code> token, which lets you control the civ in fortress mode, the <code>[OUTSIDER_CONTROLLABLE]</code> token, which allows you to play in adventure mode as an outsider, and the <code>[ALL_MAIN_POPS_CONTROLLABLE]</code> token, which allows you to play a civ native (non-outsider) in adventure mode. Other tokens that you should pay attention to are START_BIOME and the ones regarding sites, but in general, you can just run through the aforementioned list and add or remove what you want.
+
Besides those mentioned, some fundamental ones are the SITE_CONTROLLABLE token, which lets you control the civ in fortress mode, the OUTSIDER_CONTROLLABLE token, which allows you to play in adventure mode as an outsider, and the ALL_MAIN_POPS_CONTROLLABLE token, which allows you to play a civ native (non-outsider) in adventure mode. Other tokens that you should pay attention to are START_BIOME and the ones regarding sites, but in general, you can just run through the aforementioned list and add or remove what you want.
  
If you have more than one civ with the <code>[SITE_CONTROLLABLE]</code> token, all the available civs from those entities will appear in the group selection section on the embark screen. It may not be immediately obvious from which species each civ may be - while this can be determined from legends mode, the topmost species in the "neighbors" display in the embark screen is always the same as the currently selected species; if your group is dwarven, dwarves will be topmost, whilst (say) elves will be topmost if your chosen group is elven. By default, the game seems to choose a civ (and therefore a species if there is more than one) at random.
+
If you have more than one civ with the SITE_CONTROLLABLE token, all the available civs from those entities will appear in the group selection section on the embark screen. It may not be immediately obvious from which species each civ may be - while this can be determined from legends mode, the topmost species in the "neighbors" display in the embark screen is always the same as the currently selected species; if your group is dwarven, dwarves will be topmost, whilst (say) elves will be topmost if your chosen group is elven. By default, the game seems to choose a civ (and therefore a species if there is more than one) at random.
  
 
You can also attempt to discern the civ yourself by the names it uses - this is the realm of "symbols", collections of words centered around a specific concept. The civ will use the words comprising whatever symbols are applicable to it for various things. This association might be a little confusing at first, so, let's refer to the DWARF entity:
 
You can also attempt to discern the civ yourself by the names it uses - this is the realm of "symbols", collections of words centered around a specific concept. The civ will use the words comprising whatever symbols are applicable to it for various things. This association might be a little confusing at first, so, let's refer to the DWARF entity:
Line 244: Line 213:
 
An easy method of creating a civilization is just to copy-paste a similar one to the bottom of the entity_default.txt file and edit things to your liking. Remember to always change the civ's "ENTITY:" identifier! This can be anything, so long as it's not already existing.
 
An easy method of creating a civilization is just to copy-paste a similar one to the bottom of the entity_default.txt file and edit things to your liking. Remember to always change the civ's "ENTITY:" identifier! This can be anything, so long as it's not already existing.
  
At the end of some of the default entries you'll find a list of positions, both ones that'll directly affect you in fort mode (such as nobles) and ones that'll primarily affect worldgen and adventure mode. A list of the tokens applicable to positions can be found [[position token|here]]; they don't require a great deal of explanation, but that can be found in [[Advanced Entity Position Mechanics]]
+
At the end of some of the default entries you'll find a list of positions, both ones that'll directly affect you in fort mode (such as nobles) and ones that'll primarily affect worldgen and adventure mode. A list of the tokens applicable to positions can be found [[position token|here]]; they don't require a great deal of explanation.
  
 
==== Trade ====
 
==== Trade ====
Line 251: Line 220:
 
* [[Entity token#ACTIVE_SEASON|[ACTIVE_SEASON]]] - Defines the seasons when an entity may visit your fortress.
 
* [[Entity token#ACTIVE_SEASON|[ACTIVE_SEASON]]] - Defines the seasons when an entity may visit your fortress.
 
* [[Entity token#PROGRESS_TRIGGER_POPULATION|[PROGRESS_TRIGGER_*]]] - Defines the triggers which control when an entity will become interested in your fortress.
 
* [[Entity token#PROGRESS_TRIGGER_POPULATION|[PROGRESS_TRIGGER_*]]] - Defines the triggers which control when an entity will become interested in your fortress.
* [[Entity token#COMMON_DOMESTIC_PACK|[COMMON_DOMESTIC_PACK]]] - Allows the civilization to use domestic pack animals. If an entity lacks pack animals (or ability to pull wagons), it will be unable to send caravans (showing as {{DFtext|No Trade|6:1}} at the [[embark]] screen), unless it has domesticated any suitable animal species or is forced to use a non-suitable creature by the [ANIMAL] definition [ALWAYS_WAGON_PULLER] on creature, caste or class.
+
* [[Entity token#COMMON_DOMESTIC_PACK|[COMMON_DOMESTIC_PACK]]] - Allows the civilization to use domestic pack animals. If an entity lacks pack animals (pr ability to pull wagons), it will be unable to send caravans (showing as {{DFtext|No Trade|6:1}} at the [[embark]] screen), unless it has domesticated any suitable animal species.
 
* [[Entity token#COMMON_DOMESTIC_PULL|[COMMON_DOMESTIC_PULL]]] - Allows the civilization to use domestic animals to pull [[wagon]]s, assuming their [[Ethic#KILL_PLANT|KILL_PLANT ethic]] permits them to use wagons in the first place.
 
* [[Entity token#COMMON_DOMESTIC_PULL|[COMMON_DOMESTIC_PULL]]] - Allows the civilization to use domestic animals to pull [[wagon]]s, assuming their [[Ethic#KILL_PLANT|KILL_PLANT ethic]] permits them to use wagons in the first place.
 
* [[Entity token#MERCHANT_BODYGUARDS|[MERCHANT_BODYGUARDS]]] - Caravan will be guarded by [[soldier]]s.
 
* [[Entity token#MERCHANT_BODYGUARDS|[MERCHANT_BODYGUARDS]]] - Caravan will be guarded by [[soldier]]s.
Line 511: Line 480:
 
  [MATERIAL_SIZE:5]
 
  [MATERIAL_SIZE:5]
 
  [ATTACK:EDGE:100000:8000:slash:slashes:NO_SUB:1250]
 
  [ATTACK:EDGE:100000:8000:slash:slashes:NO_SUB:1250]
[ATTACK_PREPARE_AND_RECOVER:3:3]
 
 
  [ATTACK:EDGE:50:4000:stab:stabs:NO_SUB:1000]
 
  [ATTACK:EDGE:50:4000:stab:stabs:NO_SUB:1000]
[ATTACK_PREPARE_AND_RECOVER:3:3]
 
 
  [ATTACK:BLUNT:100000:8000:slap:slaps:flat:1250]
 
  [ATTACK:BLUNT:100000:8000:slap:slaps:flat:1250]
[ATTACK_PREPARE_AND_RECOVER:3:3]
 
 
  [ATTACK:BLUNT:100:1000:strike:strikes:pommel:1000]
 
  [ATTACK:BLUNT:100:1000:strike:strikes:pommel:1000]
[ATTACK_PREPARE_AND_RECOVER:3:3]
 
 
}}
 
}}
  
Line 524: Line 489:
 
Attacks take a little more explanation. The first value determines the contact area of the weapon's attack; this should be high for slashing weapons and low for bludgeoning, piercing and poking ones. The second value determines how deep the weapon penetrates - for BLUNT attacks this value is ignored as they're not supposed to penetrate anyway, but in the case of EDGE attacks it should generally be lower for slashing attacks and higher for stabbing attacks.
 
Attacks take a little more explanation. The first value determines the contact area of the weapon's attack; this should be high for slashing weapons and low for bludgeoning, piercing and poking ones. The second value determines how deep the weapon penetrates - for BLUNT attacks this value is ignored as they're not supposed to penetrate anyway, but in the case of EDGE attacks it should generally be lower for slashing attacks and higher for stabbing attacks.
  
Following these are the nouns and verb used; they should be self-explanatory. Finally, we have the velocity modifier, which has a multiplying effect on the weapon's size for the purposes of determining how powerful it is in combat. But more accurate it describe distribution of momentum across length of weapon. So STAB perfomed with only muscular power and modifier is x1 (1000). SLASH performed with some rotating momentum of cutting edge, but sword is pretty balanced thru it's length and modifier is just x1.25 (1250). Axes, hammers and maces have more unbalanced mass distribution and weapon mass concentrated far from grasp, so higher modifiers.
+
Following these are the nouns and verb used; they should be self-explanatory. Finally, we have the velocity modifier, which has a multiplying effect on the weapon's size for the purposes of determining how powerful it is in combat.
 
 
ATTACK_PREPARE_AND_RECOVER determine number of game frames to perform these actions. In vanilla almost not varies for different weapons.
 
  
 
Other, more miscellaneous items are generally simple and shouldn't require any further explanation.
 
Other, more miscellaneous items are generally simple and shouldn't require any further explanation.
Line 533: Line 496:
  
 
=== Modding language files ===
 
=== Modding language files ===
{{main|Language token}}
 
  
 
Let's say you added a whole new species.  Sure, you could just swipe one of the existing translation files and steal their language for your species, but that's the lazy way!  If you want to create a whole new language, it is very simple.
 
Let's say you added a whole new species.  Sure, you could just swipe one of the existing translation files and steal their language for your species, but that's the lazy way!  If you want to create a whole new language, it is very simple.
  
First, you'd need a whole new language_RACE file, such as language_LIZARDMAN.txt, along with "language_LIZARDMAN" at the top of the file proceeded by [OBJECT:LANGUAGE] and [TRANSLATION:LIZARDMAN].  After that, it's just a matter of copy-pasting one of the existing language lists and editing the finished 'translated' word.  That's it! Then just add the translation link to your civ in entity_default.txt and it'll be added to the game on worldgen.
+
First, you'd need a whole new language_RACE file, such as language_LIZARDMAN.txt, along with "language_LIZARDMAN" at the top of the file proceeded by [OBJECT:LANGUAGE] and [TRANSLATION:LIZARDMAN].  After that, it's just a matter of copy-pasting one of the existing language lists and editing the finished 'translated' word.  That's it! Then just add the translation link to your civ in entity_default.txt and it'll be added to the game on worldgen.
 
 
All raw files use Code Page 437 encoding, and you should make sure you are editing these files in that format. As many text editors default to UTF-8, some characters with diacritical marks may fail to show properly. Saving one of the default language raw files in this state will overwrite these characters with the unicode question mark, which will corrupt the file. To fix this  replace the file with a clean one downloaded from the distributed version of DF.
 
  
 
(Note that the name of the file doesn't actually matter; however, it's good form to name the file after a creature if only that creature speaks the language.)
 
(Note that the name of the file doesn't actually matter; however, it's good form to name the file after a creature if only that creature speaks the language.)
Line 1,067: Line 1,027:
  
 
[[material definition token|Here's a list of material tokens]]. It should also help you out with any modifications you want to make regarding those creature modifications we were making a while back. See, it all ties together in the end. The beauty of the current materials system is that there's actually very little difference between, say, leather and iron - they're fundamentally the same thing, just with different properties, which is how things really should be.
 
[[material definition token|Here's a list of material tokens]]. It should also help you out with any modifications you want to make regarding those creature modifications we were making a while back. See, it all ties together in the end. The beauty of the current materials system is that there's actually very little difference between, say, leather and iron - they're fundamentally the same thing, just with different properties, which is how things really should be.
 
== Selecting and Cutting ==
 
 
[[Modding#Modifying_the_vanilla_objects|As explained above]], existing raws can be altered with the use of SELECT, and can also be culled with CUT for more granular control, compared to simply unloading vanilla content in the mod loader. Token behavior when multiple tokens are added is dependent on the individual token. Removing tags from an object without cutting and recreating the object in question is typically impossible, except for creature object tags removed and/or replaced with the use of [[Creature_variation_token|creature variation tokens]].
 
 
The syntax for selecting and cutting objects is as follows:
 
 
{{code|code=
 
Substitute X for the desired object. A CUT does not need a SELECT prior, this is simply a list of available options.
 
 
[SELECT_CREATURE:X]
 
[CUT_CREATURE:X]
 
 
[SELECT_ENTITY:X]
 
[CUT_ENTITY:X]
 
 
[SELECT_INTERACTION:X]
 
[CUT_INTERACTION:X]
 
 
[SELECT_ITEM:X]
 
[CUT_ITEM:X]
 
 
[SELECT_WORD:X]
 
[CUT_WORD:X]
 
 
[SELECT_TRANSLATION:X]
 
[CUT_TRANSLATION:X]
 
 
[SELECT_SYMBOL:X]
 
[CUT_SYMBOL:X]
 
 
[SELECT_INORGANIC:X]
 
[CUT_INORGANIC:X]
 
 
[SELECT_PLANT:X]
 
[CUT_PLANT:X]
 
 
[SELECT_MUSIC:X]
 
[CUT_MUSIC:X]
 
 
[SELECT_REACTION:X]
 
[CUT_REACTION:X]
 
 
[SELECT_SOUND:X]
 
[CUT_SOUND:X]
 
 
}}
 
  
 
== Examples ==
 
== Examples ==
:''Main articles: [[:Category:Modding_Examples]]''
+
:''Main articles: [[:Category:DF2014:Modding_Examples]]''
  
 
The Hydling below was made by Mysteryguye (and annotated, updated and separated into blocks by Putnam), to act as an example creature.
 
The Hydling below was made by Mysteryguye (and annotated, updated and separated into blocks by Putnam), to act as an example creature.
Line 1,145: Line 1,058:
 
  [BODY:BASIC_2PARTBODY:7HEADNECKS:BASIC_FRONTLEGS:BASIC_REARLEGS:TAIL:2EYES:NOSE:2LUNGS:HEART:GUTS:ORGANS:THROAT:SPINE:BRAIN:SKULL:3TOES_FQ_REG:3TOES_RQ_REG:MOUTH:TONGUE:GENERIC_TEETH_WITH_FANGS:RIBCAGE]
 
  [BODY:BASIC_2PARTBODY:7HEADNECKS:BASIC_FRONTLEGS:BASIC_REARLEGS:TAIL:2EYES:NOSE:2LUNGS:HEART:GUTS:ORGANS:THROAT:SPINE:BRAIN:SKULL:3TOES_FQ_REG:3TOES_RQ_REG:MOUTH:TONGUE:GENERIC_TEETH_WITH_FANGS:RIBCAGE]
  
  Has a lower body, upper body, 4 legs, a tail, fourteen eyes, fourteen ears, seven noses, two lungs, a heart, guts, a pancreas etc., and 7 heads with all that goes with those.
+
  Has a lower body, upper body, 4 legs, a tail, ten eyes, ten ears, five noses, two lungs, a heart, guts, a pancreas etc., and 5 heads with all that goes with those.
  
 
  [BODYGLOSS:PAW] Feet will be called "paws"
 
  [BODYGLOSS:PAW] Feet will be called "paws"
Line 1,247: Line 1,160:
 
  [MALE] See above.
 
  [MALE] See above.
 
}}
 
}}
 +
 +
== Utilities ==
 +
{{main|Utilities#Modding_tools|l1=Utilities § Modding_tools}}
 +
There are several utilities that assist in modding efforts. There is [http://www.bay12forums.com/smf/index.php?topic=28829.0 a list of them] on the [[Bay 12 Forums]].
 +
 +
* Text Editors are used in all areas of modding. Use a good text editor to edit files and search into multiple files (like the free [https://notepad-plus-plus.org/ Notepad++] for example) or more advanced editors capable of highlighting and formatting the displayed text.
 +
 +
* Image Editor will be needed for doing custom graphics. [https://www.getpaint.net/ Paint.NET], Photoshop and GIMP are the most used, but whatever supports the .png format will work.
  
 
== See also ==
 
== See also ==
Line 1,253: Line 1,174:
 
* [[Raw file]]
 
* [[Raw file]]
 
* [[Token]]
 
* [[Token]]
* [[Modding pitfalls]]
 
* [[Cheating]]
 
* Bay 12 Guide: https://bay12games.com/dwarves/modding_guide.html
 
  
 
{{Category|Modding}}
 
{{Category|Modding}}
 
{{Category|Guides}}
 
{{Category|Guides}}
 
[[ru:Modding]]
 
[[ru:Modding]]

Please note that all contributions to Dwarf Fortress Wiki are considered to be released under the GFDL & MIT (see Dwarf Fortress Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel Editing help (opens in new window)

Templates used on this page:

This page is a member of 1 hidden category: