What it changes - Pfadfinder-Adam/RTW-M2TW-Campaign-Editor GitHub Wiki

What it changes in the game's files

File Change
descr_sm_factions.txt / .json Copies the template block (colours optional), inserted before slave
descr_character.txt Copies the template's block under every character type
descr_names.txt Copies the template's name lists, so every name already has a string
export_descr_unit.txt Adds the faction to every ownership line that has the template
export_descr_buildings.txt Adds the faction to every factions { } list that has the template
descr_model_battle.txt, descr_model_strat.txt Copies the template's texture lines
descr_banners.txt, descr_lbc_db.txt, descr_offmap_models.txt, descr_building_battle.txt Copies the template's entries
export_descr_character_traits.txt, export_descr_ancillaries.txt Not touched by a new faction (a clean clone takes none of the template's triggers)
data/text/*.txt Copies every string whose key names the template ({PARTHIA}, {EMT_PARTHIA_SPY}, ...) and rewrites the name. The tooltip goes to {<FACTION>_DESCR} (over the faction icon), the full description to {<CAMPAIGN>_<FACTION>_DESCR} in campaign_descriptions.txt (the campaign screen)
descr_strat.txt Adds the playable/nonplayable entry, a new faction block, the diplomacy lines and the leader and heir, and moves the chosen towns (details below)
descr_win_conditions.txt Copies the template's conditions; edit them by hand afterwards
Art Copies files and folders named after the template under data/ui, data/menu, data/loading_screen and the campaign folder (map_parthia.tga becomes map_saba.tga, ui/units/parthia/ becomes ui/units/saba/); a folder left from an earlier attempt is filled in file by file (optional)
Unit cards For every unit the faction owns, checks ui/units/<faction>/#<dictionary>.tga and ui/unit_info/<faction>/<dictionary>_info.tga and copies a missing one from the template (or any faction that has it)

How the chosen towns are moved in descr_strat.txt:

  • The whole settlement { } block moves, so no region ends up with two settlements.
  • A settlement holds one army at the start. The leader holds the capital; the heir holds the second chosen town, or stands next to the capital when there is only one.
  • The leader's army (a town left with no garrison of your own - or press Suggest): sized like the leader armies of factions with about as many towns (median size and upkeep), from the template's bodyguard and the cheapest units of its own starting armies.
  • Old garrisons: the capital's old garrison leaves; in other towns its captain stays with the template's cheapest units.
  • A general or agent of the previous owner is moved to one of that owner's other towns, or next to it when that town already has an army.
  • "Next to" is the flattest free tile of the town's region within 4 tiles: no river, ford or cliff (map_features.tga), no sea or mountain (map_ground_types.tga), a height range inside the tile of at most 25 (map_heights.tga).

After building, the tool checks:

  • the braces balance in descr_strat.txt;
  • every region has exactly one settlement;
  • every unit in the new armies exists in export_descr_unit.txt;
  • how many factions there are now.

Command line

python campaign_editor.py list    --data PATH          # factions, campaigns, backups
python campaign_editor.py towns   --data PATH --owner slave
python campaign_editor.py names   --data PATH parthia  # names a leader may use
python campaign_editor.py example > saba.json          # a config to edit
python campaign_editor.py new saba.json --data PATH    # preview
python campaign_editor.py new saba.json --data PATH --apply
python campaign_editor.py restore --data PATH
python campaign_editor.py scan gaetulii --data PATH    # every mention of a faction in the whole mod
python campaign_editor.py newmod HLR_Saba --data PATH  # a separate mod folder built on PATH's mod
python campaign_editor.py slim --data NEWMOD\data        # plain-game mods: keep only the changed files
python campaign_editor.py manifest GAMEFOLDER        # a game manifest (rtw_manifest.json.gz) of a clean game folder
python campaign_editor.py selfcheck report.txt          # the editor checks itself (the exe: RTW-M2TW-Campaign-Editor.exe selfcheck report.txt)

Where a faction is named (in Check mod files when a faction is picked; on the command line scan) reads every text file of the mod (not only data) and lists where the faction is named: places the tool does not handle (check these by hand), places it does, files and folders named after the faction, and files the faction's models, textures and unit cards point at that do not exist. It tells every file apart - the game's own (unchanged), changed by the mod, REX's, or the mod's own - from the game manifests that come inside the tool (a manifest made on your PC with Game manifest... wins). It writes nothing. Folders and files you want it to skip go in CampaignEditor_ignore.txt next to data (button Ignore list... in the Check mod files window; one rule per line: folder/, name/ for that folder name anywhere, or a mask like *.bak). The list only affects the scan.

The Windows .exe is the window only. Use Python for the command line.

⚠️ **GitHub.com Fallback** ⚠️