Modding Documentation

Welcome to the modding documentation for Fall of an Empire. These guides cover everything from creating your first mod to packaging it for distribution.

Pages#

PageDescriptionGetting StartedSet up your first mod, learn AngelScript basics, build a trait from scratchContent TypesReference for traits, buildings, units, cultures, religions, diseases, and battle actionsInteractionsDiplomacy, espionage, person, and power bloc interactions, plus policies and edictsEventsScripted event system: context slots, effects, options, and event chainsAssets & PackagingDataTables, icons, localisation, PAK packaging, debugging, and distribution

What Can Be Modded#

Fall of an Empire supports 14 auto-discovered content types. Create an AngelScript class that extends a base type and it appears in-game automatically -- no registration code required.

CategoryContent TypesCharactersTraits, DiseasesSettlementsBuildingsMilitaryArmy Units, Battle ActionsWorldCultures, ReligionsActionsDiplomacy Interactions, Spy Interactions, Person Interactions, Power Bloc Interactions, Policies, EdictsNarrativeScripted Events

Mods can also add icons, glossary entries, loading tips, and other data through the DataTable merging system.

Quick Start#

  1. Create a folder: Mods/YourModName/
  2. Add a mod.json with your mod's metadata
  3. Create Script/ subdirectories for your content
  4. Write AngelScript classes that extend base types
  5. Launch the game -- your content is discovered automatically

For a full walkthrough, start with the Getting Started guide.

Example Mod#

The ExampleMod (included with the game in Mods/ExampleMod/) demonstrates a complete mod with a trait, building, diplomacy interaction, and scripted event. Use it as a template for your own mods.

Architecture#

Two C++ subsystems power the modding system:

SubsystemRoleUModLoadingSubsystemDiscovers mods in the Mods/ directory, mounts PAK files, registers script directories with AngelScriptUGameDataSubsystemAuto-discovers gameplay classes via GetDerivedClasses(), merges DataTables from content directories

Both run at startup before gameplay begins, so all mod content is available from the main menu onwards.