PyLNP with Mod Loader

Usage

Spoiler: Development roadmap (click to show/hide) #####v0.5 (current)

* Can install multiple non-conflicting mods.

* Simplifies mods placed in the `LNP/Mods/` folder from a full installation or objects folder to the defined format. Mods in wrong format should be ignored.

* Comes with a GUI - as part of the PyLNP

* Gives the user live feedback on compatibility as order is modified (and allows reordering selection)

* Writes to `/raw/installed_mods.txt` noting the load order of mods in the mix.

* Detects special characters which break the merge function and handles by omission.

* Turn mods currently installed into an option (subtracting any others installed by the launcher if a log is present - does full analysis)

* Detects currently installed mods (from log, not analysis)



#####v0.6 - 0.8

Optional enhancements:

* Pre-process raw files before diffing - flattening or other.

* More improvements to mod formatter.

* Finalise the standard for `manifest.json` - a dictionary of useful or potentially useful metadata. (author, mod name, weblink, mod version, DF version, etc)

* Read and use the manifest, and create a default if none is found.

* Handle subfolders of `/raw/` differently to reflect the content (esp. if preprocessing)

* Handle the `data/` folder to allow for graphics packs - or otherwise make mods and graphics play together



#####v0.9

* Organise a standard package of simple known-good mods to include.

* Extensive community testing.



#####v1.0

* Merge into main PyLNP distribution. Starter Packs include optional mods by default.

Spoiler: Input Format (click to show/hide) Each mod has folder under `LNP/Mods/`. Within the top-level folder, which should have a meaningful name (eg `LNP/Mods/Generic_Stone`, `LNP/Mods/Gnome_Fortress`), a mod consists of:



* A `raw` folder, identically structured to the vanilla raws, containing a full copy of every file that has been changed from the vanilla raws.

* Absent files are presumed to be identical to vanilla, which allows very small disk size for minor mods. Files which the mods requires to be deleted should be replaced with an empty file of the same name. *This means the mod could be installed just by dropping it over vanilla DF.*

* An optional `readme.txt` describing the mod for human readers, and `manifest.json` for machines.



While any set of modded raws can be merged, for best results modders should make the minimum changes required for their mod, editing vanilla files in place instead of moving/renaming/replacing files or content within them. This reduces the risk of merge conflicts, increases the customisation available to users, and decreases the chance that the merged raws will be invalid. While the last is unlikely, it cannot be ruled out as the tool does not currently check raws for validity.



As well as the precise format described here, the launcher will automatically simplify mods in other common formats. These auxiliary formats are currently limited to a full install of the mod with all DF files - the preferred option - or an objects folder intended to replace the vanilla objects folder (absent files are assumed to be deletions).



Spoiler: Pic! (click to show/hide) Interface as of v0.3

Not seen: green, for mods which are entirely within vanilla files and merged OK.

Yellow mods add files, and were merged successfully. All these would be included if you hit 'install'.

Red is a rejected merge due to overlapping changes.

Orange was not attempted due to a previous conflict.

Not seen: green, for mods which are entirely within vanilla files and merged OK.Yellow mods add files, and were merged successfully. All these would be included if you hit 'install'.Red is a rejected merge due to overlapping changes.Orange was not attempted due to a previous conflict.

Loading and combining mods for Dwarf FortressThe idea is to make adding mods to Dwarf Fortress as easy as graphics packs - just select your desired load order, and the launcher merges as many as possible (giving you feedback on compatibility). As of v0.5, it's essentially finished and ready for public testing.The GUI is a fork of the PyLNP , hence the name, and the goal is to merge back in once this is stable enough. The input format was extensively discussed in this thread , which also saw much early development. It's simply a raw folder that could be installed by copying it over vanilla - and the launcher can convert an installed into this format, just like it does for graphics packs.Run `launch.py`, and use the mods tab.Mod installation: place mod under `LNP/Mods/`. Note that mods must either be in the input format described below, or installed with a working copy of DF - the script can turn the latter into the former.Contributions of all kinds most welcome!