eu4-indexer
Indexes Europa Universalis IV (EU4) game scripts — and any loaded mods — into a
queryable SQLite database. It parses events, missions, decisions, modifiers and
every other common/ script type with CWTools,
records their full condition/effect trees, localisation in all languages, and
the exact override relationships between the base game and each mod.
The design is game-agnostic at its core (a GameAdapter abstraction); EU4 is the
only implementation today, with room to add CK3 / HOI4 / Stellaris / VIC3 later.
Projects
| Project | Language | Purpose |
|---|
Eu4Indexer.Core | F# | Parsing, extraction, override resolution, SQLite writer |
Eu4Indexer.Cli | F# (Argu) | index, detect, workshop, and playset commands |
Eu4Indexer.Tests | C# (xunit) | Unit + integration tests |
CWTools is referenced from source via a git submodule at external/cwtools
(a fork pinned to a build that
compiles against the current .NET SDK / FSharp.Core) because the published
NuGet (0.3.0, 2019) predates the rule format used by the current EU4 config repo.
Prerequisites
Usage
# Show what would be indexed (game dir, mods in load order, replace_paths)
dotnet run --project Eu4Indexer.Cli -- detect \
--game-dir /path/to/eu4 \
--mod /path/to/some_mod
# Build the index
dotnet run -c Release --project Eu4Indexer.Cli -- index \
--game-dir /path/to/eu4 \
--mod /path/to/mod_a \
--mod /path/to/mod_b \
--config-dir /path/to/cwtools-eu4-config \
--db eu4.db \
--verbose
Locating the game and mods
- Game: pass
--game-dir, or omit it to auto-detect. Auto-detection finds
the Steam client (via the Windows registry, or the default install location on
macOS / Linux), then reads its libraryfolders.vdf to locate every Steam
library — so the game is found even when installed on a non-default drive. If
detection fails (e.g. a non-standard client location), pass --game-dir
explicitly.
- Mods: pass
--mod <path> (repeatable — order is load order; a .mod
descriptor file or a content directory both work), or --workshop-id <id>
(repeatable) to pull a subscribed Steam Workshop mod straight from the
workshop content dir, or use --auto-mods to discover enabled mods from the
launcher's dlc_load.json / mod/*.mod descriptors under the Paradox
user-data directory. Load order is --mod, then --workshop-id, then auto.
- Workshop: run the
workshop command to list every installed Steam
Workshop item as <id> <name> (it reads each descriptor.mod name only — no
full parse), then feed the ids you want to --workshop-id. Pass ids as
positional args (workshop <id> ...) to show only those.
- Playset: pass
--playset <name-or-id> to index a launcher playset's
enabled mods (in the playset's load order), read straight from the
launcher's launcher-v2.sqlite. Run the playset command to list all
playsets (* marks the active one), or playset <name-or-id> to list a
playset's mods with their enabled (x) state and Workshop ids.
- Config:
--config-dir, or the EU4_CONFIG_DIR environment variable.
Mod-source load order when several are combined: --mod, then --workshop-id,
then --playset, then --auto-mods.
Later mods override earlier mods, and any mod overrides the base game. Override
relationships are recorded explicitly — see below.
Workshop and playset examples
The ids, names, and counts below are illustrative placeholders.
List every installed Steam Workshop mod (id + name; reads descriptor.mod only,
no full parse):
dotnet run -c Release --project Eu4Indexer.Cli -- workshop
Workshop items (3):
1000000001 Example Mod A
1000000002 Example Mod B
1000000003 Example Mod C
Pass ids positionally to show only those:
dotnet run -c Release --project Eu4Indexer.Cli -- workshop 1000000001 1000000003
List all launcher playsets (* marks the active one):
dotnet run -c Release --project Eu4Indexer.Cli -- playset
Playsets (2) [* = active]:
* My Playset
Another Playset
Show one playset's mods with their enabled state (x = enabled) and Workshop ids
— quote a name with spaces, or pass the playset id: