ModSync/For guide authors/Walkthrough: writing a guide
Walkthrough: writing your first guide
This walkthrough takes you from an empty folder to a tested instruction file. It follows a small build of three made-up mods, so each step has something concrete to look at. The mod names, archive names and links in the examples are invented: copy the shape, not the names.
Step 1: Plan your build
Before you write anything, decide four things for each mod.
- Order.
Dependenciesnames components that must be installed first.InstallBeforeandInstallAfteradjust the install order further. When two mods write the same game file, order decides which one wins, so check it.modsync conflictslists every game file that more than one component writes, in install order. - Choices. An option is a variant chosen inside one mod, such as two HUD styles. A separate mod is its own component with its own
Guidand its own selection. - Where the archive comes from. Note the download page and the file name for each archive. Some hosts, such as Nexus, DeadlyStream and MEGA, are browser workflows for players. The guide links to them; ModSync does not download from them.
- Which page owns what. The guide holds the structure: names, IDs, install steps, dependencies and links. The mod's own page holds its long write-up, screenshots and update history. Keep
Descriptionshort, and useDirectionsfor install notes that players see while that mod installs.
Step 2: Start from a Markdown guide
If your build exists as a prose guide, a Markdown file that says install this, then copy that, ModSync can draft the instructions for you. Start with the draft command:
modsync convert guide.md draft.json --parse-directions
The output is a JSON guide. Every component the drafter could read gets generated instructions, and every draft is flagged for review. Drafts are never trusted automatically, and installation stays blocked until each one has been reviewed.
Components that have no instructions at all can also be inferred from archives you have already downloaded. This proposes extraction, file moves, folder choices and patcher steps, and prints a report for each component. Run it on a guide file that already lists the components:
modsync convert guide.toml generated.toml --auto-generate-local --source-path /path/to/mods
A draft is a starting point. A generated draft is not proof that the prose was understood correctly. Check every generated action and path, then validate the guide before anyone installs it.
Step 3: Review drafts
Go through each drafted component. When you have checked its actions, mark it reviewed and write the result to a new file:
modsync convert draft.json reviewed.toml --review-draft example-texture-pack
Repeat --review-draft for each component you have checked. A component that still has unparsed gaps or conditional drafts is not cleared by review; fix those steps by hand first.
If the archives are already downloaded, you can clear review in bulk for drafts that a fresh replay of the archive reproduces exactly. This needs --source-path pointing at the folder that holds the archives:
modsync convert draft.json reviewed.toml --source-path /path/to/mods --review-verified-drafts
Only exact matches are cleared, and each cleared draft records a Verification receipt. The command prints a cleared and skipped count on stderr. Everything it skips stays for manual review.
Step 4: Or write TOML by hand
Writing TOML directly gives you the most control. The example below is a complete instruction file for three made-up mods:
- Example Texture Pack extracts a ZIP and copies its loose textures into
Override. - Example Patcher Mod extracts a ZIP and runs its TSLPatcher-style installer.
- Example HUD Options has a
Choosestep that applies whichever HUD style the player picks.
[metadata]
title = "Example build (made-up mods)"
# Example mod 1: a texture pack shipped as a ZIP
[[thisMod]]
Guid = "example-texture-pack"
Name = "Example Texture Pack"
Author = "Example Author"
Description = "Made-up example. Copies three textures into Override."
Tier = "1"
Category = ["Textures"]
IsSelected = true
[[thisMod.Instructions]]
Action = "Extract"
Source = ["<<modDirectory>>/example-texture-pack.zip"]
[[thisMod.Instructions]]
Action = "Copy"
Source = ["<<modDirectory>>/example-texture-pack/*.tga"]
Destination = "<<gameDirectory>>/Override"
# Example mod 2: a TSLPatcher-style patcher, installed after the texture pack
[[thisMod]]
Guid = "example-patcher-mod"
Name = "Example Patcher Mod"
Author = "Example Author"
Description = "Made-up example. Edits game files with a patcher."
Tier = "2"
Category = ["Gameplay"]
IsSelected = true
InstallAfter = ["example-texture-pack"]
[[thisMod.Instructions]]
Action = "Extract"
Source = ["<<modDirectory>>/example-patcher-mod.zip"]
[[thisMod.Instructions]]
Action = "Patcher"
Source = ["<<modDirectory>>/example-patcher-mod/example-installer.exe"]
Destination = "<<gameDirectory>>"
# Example mod 3: an optional mod where the player picks one of two options
[[thisMod]]
Guid = "example-hud-options"
Name = "Example HUD Options"
Author = "Example Author"
Description = "Made-up example. The player picks one HUD style."
Tier = "Optional"
Category = ["Interface"]
IsSelected = false
Dependencies = ["example-patcher-mod"]
[[thisMod.Instructions]]
Action = "Extract"
Source = ["<<modDirectory>>/example-hud-options.zip"]
[[thisMod.Instructions]]
Action = "Choose"
Source = ["example-hud-classic", "example-hud-modern"]
[[thisMod.Options]]
Guid = "example-hud-classic"
Name = "Classic HUD"
IsSelected = true
[[thisMod.Options.Instructions]]
Action = "Copy"
Source = ["<<modDirectory>>/example-hud-options/classic/*.tga"]
Destination = "<<gameDirectory>>/Override"
[[thisMod.Options]]
Guid = "example-hud-modern"
Name = "Modern HUD"
IsSelected = false
[[thisMod.Options.Instructions]]
Action = "Copy"
Source = ["<<modDirectory>>/example-hud-options/modern/*.tga"]
Destination = "<<gameDirectory>>/Override"
Extracting an archive creates a folder named after it, next to the archive. That is why the Copy and Patcher steps point into example-texture-pack/ and example-patcher-mod/. Instructions run in the order they are written.
Component fields (each one is a key inside a [[thisMod]] table):
| Field | What it does |
|---|---|
Guid | The unique ID. Dependencies, restrictions, install order and Choose steps refer to it, so keep it stable. |
Name, Author, Description | What players see on the selection page. |
Directions | Install notes for that mod, shown while it installs. |
Tier | Used by the bulk selection buttons. 1 to 4 and Optional are the known tiers and select cumulatively; any other label matches exactly. |
Category | A list of categories, used for filtering and bulk selection. |
IsSelected | The default choice on the selection page. |
Dependencies | Components that must be installed first. A missing component, or a loop, fails validation. |
Restrictions | Components that cannot be installed together with this one. |
InstallBefore, InstallAfter | Adjust the install order around the named components. |
Instructions | The steps for this mod, in [[thisMod.Instructions]] tables. |
Options | Variants a player can pick, in [[thisMod.Options]] tables. Each option has its own Guid, Name, IsSelected and Instructions. |
ResourceRegistry | Download links for the mod's archives, keyed by URL. See the links step below. |
Instruction fields (each step in Instructions):
| Field | What it does |
|---|---|
Action | What the step does, such as Extract, Copy, Patcher or Choose. The full list is in Instruction actions. |
Source | A list of paths. * and ? match within one folder level. |
Destination | The target folder for Copy and Move, and <<gameDirectory>> or empty for Patcher. Leave it out for Extract, Choose and Delete. |
Arguments | Extra input for the action. For Patcher, a namespace index or an INI file name. For Execute and Run, command-line arguments. |
Overwrite | Defaults to true, which replaces an existing file. false keeps the existing file; a Copy or Move skips it with a warning. |
Dependencies, Restrictions (on a step) | The step runs only when its dependencies are selected and its restrictions are not. |
Folder placeholders. Paths start from one of two placeholders, so the same file works on every computer: <<modDirectory>> is the folder that holds the downloaded archives, and <<gameDirectory>> is the game folder. The older spelling <<kotorDirectory>> is still accepted, but use <<gameDirectory>> in new guides.
Step 5: Add download links, checksums and torrent info
Each archive gets a ResourceRegistry entry, keyed by its download URL. Record the archive's SHA-256 so that downloads can be checked against it. To get the hash, run one of these on the archive you uploaded:
Get-FileHash -Algorithm SHA256 example-texture-pack.zip # Windows PowerShell
sha256sum example-texture-pack.zip # macOS and Linux
Then add the entry inside the mod's block. This excerpt belongs to the Example Texture Pack component:
[thisMod.ResourceRegistry."https://example.org/files/example-texture-pack.zip"]
ContentHashSHA256 = "<64 hex characters from the hash command>"
If you also share the exact archive by BitTorrent, run torrent-seed on that same file. It prints a magnet link, the SHA-256 and torrent info, then keeps seeding until you press Ctrl+C:
modsync torrent-seed example-texture-pack.zip --tracker <http-announce-url>
Record the values in the same registry entry. Magnet and ContentHashSHA256 are needed for peer downloads; TorrentInfo is optional, and lets ModSync check the torrent against the archive.
[thisMod.ResourceRegistry."https://example.org/files/example-texture-pack.zip"]
ContentHashSHA256 = "<64 hex characters>"
Magnet = "magnet:?xt=urn:btih:<from torrent-seed>"
TorrentInfo = "<base64 from torrent-seed>"
By default, peer traffic goes through a SOCKS5 proxy, so peers see the proxy's address rather than yours, and the command fails if no working proxy is found. --no-proxy connects directly, which shows your IP address to peers.
Hash the exact file you share. If you repack the archive, its hash and magnet link change. Update the guide whenever the file changes.
Step 6: Test it safely
Never test against a real game install. Make empty stand-in folders for the game and the archives, the same way the README's isolated install does:
mkdir -p demo-work/game/Override demo-work/mods
Copy the test archives named in your guide into demo-work/mods. Then run the full check against those folders:
modsync validate --input guide.toml --game-dir demo-work/game --source-dir demo-work/mods --json
validate runs the full check without installing anything. Read the JSON output, fix whatever it flags, and run it again.
Two things trip people up. First, the CLI selects every top-level component unless you pass --select or --use-file-selection, which honors IsSelected. Second, options are turned on with --option and a GUID. Dependencies must be selected explicitly, or validation stops. For the example build, this selects the parent mod and the Modern HUD option:
modsync validate --input guide.toml --game-dir demo-work/game --source-dir demo-work/mods --select example-texture-pack example-patcher-mod example-hud-options --option example-hud-modern --json
When validation is clean, run the same command with install in place of validate, and check that demo-work/game/Override holds the files you expect. If an install fails partway, modsync restore --game-dir demo-work/game --source-dir demo-work/mods puts the folders back. An external patcher program (--patcher) also needs --allow-processes.
Use stand-in folders only. Installs change the folders you point them at. Keep the test on demo-work, not on your real game or mod folders.
Step 7: Convert to other formats
Save the finished guide in the format you need. TOML and YAML keep the build-level [metadata] table. JSON writes only the array of components, so keep the build in TOML or YAML when it has metadata.
modsync convert guide.toml guide.json
modsync convert --input guide.toml --output guide.xml --format xml
modsync convert --stdin --format yaml < guide.json
After any conversion, validate the converted file as well. Do not assume it behaves the same as the original.
Step 8: Publish
The instruction file belongs to the build you publish. Put it in the same folder as the build's mods and documentation, not inside ModSync's own program folder. Players load it in ModSync, either with Load guide in the desktop or with --input on the command line. They never need to edit it.
Publish the file as it is. Leave out your test folders, and do not ask players to change any paths, because the placeholders make the same file work on every computer. Keep each archive's download link, SHA-256 and torrent values together in the file so that downloads can be checked.
Step 9: Checklist before you publish
- Every component has a unique
Guid, and no GUID changes after publishing. - Every name used in
Dependencies,Restrictions,InstallBefore,InstallAfterandChoosepoints at a component or option that exists. - Every
Choosestep lists option GUIDs from the same component, and the options it should offer are declared underOptions. - Every path starts with
<<modDirectory>>or<<gameDirectory>>, spelled exactly. Destinationis left out forExtract,ChooseandDelete.- Every drafted component has been reviewed, and no draft is left blocked.
- Every archive has a download link and a
ContentHashSHA256that matches the file you upload. - Torrent values, if any, come from
torrent-seedon that exact archive. modsync validate --jsonruns clean against empty stand-in folders, andmodsync conflictsshows no conflict you did not intend.- The file is saved in the format you publish, and it validates after conversion.
When the checklist is complete, read the Instruction files page for the wider picture, and the Command line page for every option mentioned here.