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.

Mod

From Dwarf Fortress Wiki
Revision as of 10:40, 3 January 2023 by Jan (talk | contribs)
Jump to navigation Jump to search
For using mods and their basic structure, see modding about making mods.

A mod (short for modification) is an alteration of the game and the objective of modding. Modifications can range from small tweaks to complete overhauls.

Installing Mods

Mods can be acquired using the steam workshop (if using Steam version), a manual download from Bay 12 Forums or third party websites (like DFFD), or by creating one yourself.

Users of the Steam version can subscribe to mods on Steam Workshop, once the download is complete they will be available when creating a new world automatically. Otherwise, manually download the mod, then place the mod zip file or the unzipped mod folder into the Dwarf Fortress mod folder (if this folder doesn't exist, you can create it.) You can have more than one mod in the mod folder, including different version of the same mod. The game will detect all mods that are properly made in this folder and let the user select which mods to play (see bellow.)

Enabling Mods

world generation mod menu

When creating a world and choosing its initial parameters, if you have a mod available, there should be a Mods button at the bottom of the screen. Pressing this will let you select which mods you'd like to enable and what the load order should be. You should put mods at the end of the mod list after the vanilla objects if you don't have any further information, so that they can reference vanilla objects after those are loaded.

Something something load order basic

  • Mods are enabled per world and can not be disabled afterwards, however, it is possibly to manually modify the game file as we did in previous versions by applying the mods directly to <Dwarf Fortress>/data/vanilla. Be ware this method has the disadvantage of being a permanent change for all worlds and may break your game.
  • Unlike the previous versions of Dwarf Fortress, mods no longer live inside save files and must be installed on every computer where saves using those mods are going to be loaded. Once a world is created that uses mods, then the game will copy the mod to the <Dwarf Fortress>/data/installed_mods folder. That is the version that the game actually uses.

Modding

Dwarf Fortress supports mods in the form of new objects and tiles. Each mod is a zip file or unzipped folder with the required format (see below.)

Mod Format

Mods contain an info.txt file and either an "objects" folder or a "graphics" folder (or both.) All of the vanilla objects in the game now use this format. Your mod folder should look something like this:

Folder-orange.svg Mod Name
 ├ Text-x-generic.svg info.txt
 ├ Text-x-generic.svg preview.png
 ├ Folder.svg objects
 └ Folder.svg graphics

Mod info

Main article: Mod info token

Each mod must have a info.txt at the root of your mod folder. It has a few fields defining basic metadata information about the mod and can be edited using any text editor (like notepad++). See Example:

[ID:wiki_example]
[NAME:Wiki Example Mod]
[NUMERIC_VERSION:5001]
[DISPLAYED_VERSION:50.01]
[EARLIEST_COMPATIBLE_NUMERIC_VERSION:5001]
[EARLIEST_COMPATIBLE_DISPLAYED_VERSION:50.01]
[AUTHOR:Dwarf Fortress Wiki]
[DESCRIPTION:This is an example mod. This text shows up in-game.]

[STEAM_TITLE:Wiki Example Mod]
[STEAM_DESCRIPTION:This text shows up on Steam Workshop.]
[STEAM_TAG:mod] 
[STEAM_KEY_VALUE_TAG:test:stuff]
[STEAM_METADATA:metadata test]
[STEAM_CHANGELOG:Made some changes. Shown in 'Change Notes' tab.]

[STEAM_FILE_ID:#########]

Only ID and NAME are required to appear in the in-game mod menu.

STEAM tags are only used by Steam.

  • The STEAM_FILE_ID used to identify the mod in the Workshop. This is automatically managed when uploading to Steam the first time. And required if you wish to update an existing Steam Workshop mod.
  • The STEAM_TAG and STEAM_KEY_VALUE_TAG are used by Steams search engine and the categorization. You can use as many entries you want, use a separate tag for each one.
  • You can also create a thumbnail for your mod by creating an image called preview.png in the same level as your info.txt file. This image will become the thumbnail when the mod is uploaded to steam workshop. The image should be less than 1MB in size.

Objects and graphics folder

At the root of your mod folder you can have a objects\ and graphics\ folder, this is where all the raw files or graphics goes (exactly the same as objects from previous versions of Dwarf Fortress) allowing you to tweak or add new content for the game. It's beyond the scope of this short guide to go into what specific tags do, but the vanilla objects and previous mods by members of the community will give you plenty of examples to work with. See: modding.

Publish on Steam Workshop

To upload a mod to Steam Workshop, you need to add STEAM tags to the info.txt file (see above.) Afterward, you put the unzipped mod folder in the "mods/mod_upload" folder. Then select Mods from the title menu, and upload your mods using the button you'll see there. Other Steam users will be able to subscribe to your mod immediately once it is uploaded.

Once the upload process is completed successfully, you'll find a [STEAM_FILE_ID:#########] appended to your info.txt. Make sure this entry is included for future uploads if you want to make changes to your mod and have it overwrite the existing entry on the workshop. Otherwise you'll create a new entry every time you upload.