Reference - Pfadfinder-Adam/RTW-M2TW-Campaign-Editor GitHub Wiki

Reference - how each part works

The long description of every window and button (it stood in the README up to 0.35.3; it is kept up to date here now). The guides in the sidebar walk through the same step by step.

Scrolling: every list, table, page and text shows a scrollbar while there is more to see; every list, table, page and read-only text also scrolls by the mouse wheel, by dragging it with the left button (it follows the mouse, up / down and left / right) and by the middle button: press the wheel and move the mouse - the further from where you pressed, the faster it scrolls, both ways (held: it stops when you let go; a click: it goes on until the next click or Esc). A text you can type in keeps the left drag for selecting words. The map is as before (the right button moves it).

Your own look and language: Tools > Edit the editor's look... - a click picks any button, tick or label (yellow frame); drag it with the left button before or after any other piece, in any bar; its right click renames it, gives it a hover text, a width, its own colours, font and emoji, hides it or takes it back (Undo, Hidden pieces..., Back to how it was, Save / Load a look). It is kept for every start (CampaignEditor_look.json). Tools > Layout board... shows every page of the editor at once on one canvas (each work, its tabs, the Tools windows - no need to open them one by one): the wheel zooms, drag a piece and it stays exactly where you drop it - its edges stick to the lines the other pieces stand on, and to a grid when Grid is ticked (hold Alt to put it into a row instead) - drag its corners to size it, right click for the rest (its own colours, font and an emoji too); Appearance on its bar gives the whole editor its own colours and font at once, and Themes... (also in Settings > Look) puts on, saves, exports and imports whole themes; your changes are drawn on the board first and Accept puts them all on the editor (Discard drops them). Settings > Language of the window puts a language on every window; Words to translate... writes every word of the windows into a file to fill - a translation sent back comes with the editor.

A new faction, step by step

  1. Close the game and press Browse... to pick the mod's data folder (for example ...\Rome Total War Gold\HLR\data).
  2. Pick the campaign (usually imperial_campaign).
  3. Pick a template. The new faction gets its culture, units, buildings, character models, name lists and art - a clean clone: none of the template's trait / ancillary triggers or events.
  4. Fill in:
    • Internal name: lower case, no spaces, for example saba.
    • Name (full), Name (short) and Adjective, for example Sabaean Kingdom, Saba, Sabaean. The copied strings use them ("Sabaean Spy", "Your forces attack an army of Saba").
  5. Starting settlements: filter by owner (for example slave for rebel towns), Add > (or Enter) to add, then pick the capital; a double click (or Rename...) changes the names players see of the region and its town.
  6. Leader (and optionally the heir): first name and surname from the template's name list. The game crashes on a name that has no string, so the tool only accepts listed names.
  7. Press Preview changes to see every file and edit. Nothing is written yet.
  8. Press Create faction. Then start a new campaign; old saves don't know the faction.

A separate mod (recommended): press New mod folder... after loading the mod you build on (for example HLR\data). The tool makes <game>\HLR_Saba\ next to it and loads it; the faction goes there, and Start_HLR_Saba.bat (your base mod's start script with -mod:HLR_Saba) starts it. The green Start the game button (bottom right, beside Tools; it names the mod it starts, amber when no mod is loaded) starts it from the editor, after checking that the start script's exe is there and a Medieval II .cfg names the mod's folder. The base is never touched. With REX / M2EX the new mod gets no engine settings files (descr_ex.txt, descr_caps_ex.txt): the engine reads them only from the mod, so it runs on the engine's defaults; the editor writes the one line a change needs (the faction limit, Campaign rules), and Check mod files' Copy them in brings the game's whole list into the mod with every setting switched off, to switch on what you want for this mod alone. The game reads one -mod: folder and falls back to the game's own data, so a mod built on HLR holds all of HLR: every file is copied, so the new mod stands on its own (to share or zip). For a mod you keep to yourself, tick Hard links instead of copies: text files are copied, everything else is a hard link (the same file on disk under a second name - no extra space, same drive only); deleting the new mod folder never touches the game, but don't overwrite a linked texture in place from an image editor. Medieval II: the new mod goes into <game>\mods\<name> with <name>.cfg ([features] mod = mods/<name>) and Start_<name>.bat, which starts the game with that .cfg (under M2EX: M2EX.exe --features.mod=mods/<name>, like M2EX's own mods). A mod built on the plain game is a thin mod: nothing is copied (made at once, no disk space) - it holds only what you change, the game reads every other file from its own data; the editor puts a game file into it the first time you change it, and the map's other files (the map pictures, heights, descr_regions, descr_terrain - not map.rwm, which the game builds again there) the first time you change the map; a campaign's descr_strat, events, scripts and texts are never copied unless you change them. A file the game would read the same from its own data is never written either, and the editor's automatic fixes (faction-select slots, 'faction destroyed' pictures, a later faction holding a town) touch only files you changed. Files a thin mod holds that are still the game's own byte for byte (copies an older version made) are named by Check mod files, with Take them out (backed up - Restore puts them back). Before the first write into the game's own data or a mod it did not make, the editor asks once whether to make your own mod folder first.

Garrisons by hand: the Units & armies tab lists your chosen towns (or select one in Chosen and press Garrison...); pick a town and fill its garrison: the template's units as the game's own cards (upkeep under each, the full line on hover), click to add, click the garrison to take one out; a right click on a unit of the garrison sets its experience, armour and weapon (shown under its card), adds one or five more like it, takes every one like it out or replaces it with another; on the roster it adds several, fills the army or adds with experience - the same in an army's window; Suggest for a pick at random from the template's units by the numbers beside it (how many units, their upkeep together at most); take every card out to leave the town to the 'Leader's army' / 'Old garrisons' rules on the same tab. The leader's or heir's bodyguard comes on top in the towns they hold; elsewhere the old garrison's captain (or a new one from the name list) leads it. Pictures need Pillow (pip install pillow; the exe has it).

Buildings by hand: the Buildings tab shows, for the selected town, every building chain the faction may build (from export_descr_buildings.txt: the level's requires factions { } names the template, the new faction or its culture) with the game's picture of the chosen level (ui/<culture>/buildings/#<culture>_<level>.tga, falling back through descr_ui_buildings.txt's culture variants and the plain level name). Pick a level per chain or - for none; levels too big for the settlement are hidden unless you ask. Untouched towns keep their own buildings; Keep the town's own undoes your picks. The preview warns about a level the faction list or the settlement size does not allow.

Edit an existing faction: Factions at the top, its Edit faction tab (the first), and pick the faction. The window fills with what it is now (names, tooltip and campaign-screen text, colours, culture, AI, denari, playable, its towns); a new Culture brings the culture's town look, portraits, buildings and units with it in the game, and Preview says which units and buildings change. Change what you want; Units & armies replaces the garrison of any of its towns (a named character there keeps his bodyguard; a town nobody holds gets a captain), Buildings sets what stands in them. Add towns to Chosen to take them (their rebels leave; another owner's characters go to its other towns), take towns out to give them to the faction named in Removed towns go to (rebels by default; the faction's named characters move to one of its towns, a captain and his garrison go with the town). Capital puts that town first in the faction's block. Leader and heir can get new names (from the faction's name list) and ages. Their titles too (Leader's title / heir's: King, Duke, Emperor... - also for a new faction). Untouched fields and towns stay as they are. Preview changes, then Apply changes - with a backup, like a new faction. Names and texts change only in the chosen campaign's string tables.

Map: the Maps's Map tab shows the campaign map like a full-window minimap drawn tile by tile from map_ground_types.tga (the ground type of each tile: grass, forest, hills, mountains, desert, sea), cities, ports (the white pixels of map_regions.tga) and, with Political, each region in its owner's colour, see-through, with the towns you picked already in the new or edited faction's colour. Wheel zooms, a left drag moves the map, a click on a town adds it to the faction's towns while you pick them (Towns on the map... in Factions), a right drag (or Ctrl + left drag) moves characters, towns and ports (a character dropped on a town's sign goes into the town); a right click opens a menu of what can be done there - a town: add it or take it out, give it to any faction, its garrison, its buildings; a character: open it; a free tile: a new army, agent or fleet right there for any faction (the one holding the land, changeable - no faction has to be picked first); the line under the map describes the tile under the mouse (region, owner, ground, and whether an army may stand there). Characters shows everyone in descr_strat.txt: armies as flags in the faction's colour, agents as lettered dots (S spy, D diplomat, A assassin, M merchant), admirals as boats. In Edit the edited faction's characters are framed in yellow and can be dragged: the target tile turns green or red (an army needs a tile it may stand on or a town no other army holds, a fleet needs sea, agents any land), and the moves are written with Apply changes. Find above the map finds a town (also by the name its owner shows), a port, a general, agent or fleet, a unit in an army (e.g. "hastati"), a fort or a resource: pick a hit and the map zooms in close on it with a blinking ring (video). A double click on a town (or the right click's This town...) opens the town's own window: owner, city or castle (Medieval II), level, population, and - switched by its Buildings / Garrison tabs - the Buildings tab's editor and the Units & armies card picker, written with Preview and a backup. A double click on an army or fleet opens its units; on a fort, the army that holds it. An army in a town is a flag on the town's roof; right click the town > Take the army out (or Take an agent out, each by name and kind) and click a free tile.

New armies, agents and fleets: in the Maps - right click the map (for any faction; a new faction once it is created) - add a new character with a name from the faction's name list. Select it: an army gets its units from the land cards, a fleet from the ships (the own units / mercenaries / own + mercenaries filter next to the category picks whose units show; in mods that mark every ship a mercenary it turns to own + mercenaries by itself; Show above the list keeps armies, fleets or agents apart and a click on a heading sorts). Place on map opens the Map; click a tile: an army needs land it may stand on or a town no other army holds, a fleet needs sea, an agent any land or a town. Placed ones can be dragged there. Works for a new faction and in Edit; written with Create faction / Apply changes.

What is there already (Edit): a town's garrison opens as it stands now (marked unchanged until you click a card); As it was goes back to it. The faction's armies, fleets and agents already on the map are in Armies, agents & fleets too: pick one to change its units (a family member keeps his bodyguard), a right click on its row takes an agent, captain or admiral off the map (never a family member), drag them on the Map to move them. Apply changes asks first and lists the warnings, for example a town left without an army.

Regions: tick Regions on the Map: every region shows in its own colour with its borders. New region... asks for the names (region, settlement, their labels), the creator faction, the rebels, the region tags (hidden resources: descr_regions line 6, what buildings' resource / hidden_resource requirements ask for - not the goods drawn on the map; picked from the mod's own under the arrow beside the box, or typed), triumph value, farming level, the owner at the start (or none - the game then makes it a rebel village) and the settlement level; the tool picks an unused colour. Paint its land with a left drag (brush 1-6 tiles; only land changes hands, never a town or port), then Place its town and, on the coast, Place its port and click the tile (a see-through marker under the mouse shows green where it may go, red with the reason where not; the same when placing a new army, agent or fleet). Borders hides the dark borders while painting. The same brush moves the border between two existing regions: right click a region to paint with it, right drag moves the map. Preview lists what is written: map_regions.tga, descr_regions.txt (8 lines), the campaign's descr_regions_and_settlement_name_lookup.txt (the names are appended, so existing ones keep their places), the labels in <campaign>_regions_and_settlement_names.txt, a settlement in descr_strat.txt for an owner, and map.rwm removed. It warns when a region falls into pieces. Borders are not stored anywhere - they are where the colour changes - so the view draws them again as you paint. To change only the map, stay in New faction mode with no faction named: Apply changes then writes the map alone (the line beside the work bar says so). A new region is in the towns list on the Edit / New faction tab at once (marked new - written with Apply): a new faction can start there and an edited one take it, all written by one Apply together with the map. Edit region... (on the Map's region bar for the region in Paint with, or under the towns list for the selected town) opens a new region's data again - names, builder, rebels, tags, triumph, farming, owner, size; a renamed one is renamed on the map, in the towns and garrisons too - and for a region of the map the names players see of the region and its town (the campaign's names text - Rename... beside the towns list, or right click a town, opens the same) and its descr_regions.txt lines (builder, rebels, region tags, triumph, farming) and its Owner at the start (descr_strat.txt; a change is written with the next Apply, as the Map's Give this town to). A new region given to the faction you edit is one of its towns at once (garrison, buildings, capital) and is written with it in one Apply; its builder, rebels and religions come from the region its land is cut from unless you pick others. Check mod files, Restore a backup, Game manifest and Log are in the Tools menu.

Settlement level and population: the Buildings tab has both for the selected town. A governor's building (the core_building chain) that needs a bigger settlement grows it by itself - a town with a governor's palace becomes a large town - and lifts the population to that level's threshold (town 400, large town 2000, city 6000, large city 12000, huge city 24000). A level or population typed by hand wins; the preview warns if it is too small for the building.

Moving towns and ports: drag a town (the hall) or a port (the anchor) on the Map to another tile; a click still picks the town. A town goes on its own region's land (no river, ford, cliff, sea or mountain), a port on its region's coast (sea next to it). The tool repaints the two pixels of map_regions.tga (black = town, white = port), moves the characters standing in a moved town with it, and removes map.rwm - the game's compiled map, which it rebuilds on the next start (the first start takes a little longer). All of it is backed up and Restore puts it back. map_regions.tga in world/maps/base serves every campaign that has no own copy.

Regions without a settlement block: some campaigns leave regions out of descr_strat.txt (vanilla: Galatia with Ancyra, Dalmatia, Arabia and others); the game makes each a rebel village with no buildings. They are listed as "village, not in descr_strat" and can be taken like any rebel town: the tool writes the village into the faction's block. Their town window (a double click on the Map) and Edit region... (the Owner row) write the town for an owner you pick - the rebels too, the village as the game makes it - so it can be edited like any town after the next Apply.

Wastelands (Rome with REX, Medieval II with M2EX): a town deleted with its region (right click it on the Map > Delete this town with its region..., or many at once with Select) can leave its region as a wasteland - the default with an engine: the region and its land stay, with no town, owner, rebels or economy; the AI never goes for it, no victory counts it, no neighbour grows, armies can still walk over it (the engines' wasteland word in descr_regions.txt). Goes to a neighbour gives its land to a neighbour instead (the only way of the original exes). Right click a wasteland's land > Give it its town here... writes its town on that tile again.

Family (Edit): the Family tree button of the Edit faction tab (see Family tree below) lists everyone of the faction - the characters on the map (with their traits and ancillaries) and the family members off the map (character_record) - and draws the family tree the way the game shows it: husband and wife side by side, their children in the row below, the leader and heir marked. Click a card or a row to edit the person: name (from the faction's name lists - the game crashes on a name it has no string for), age, sex (off the map), traits with their level (only traits of the mod for that kind of character, never one with its opposite) and ancillaries. Add a person... (step by step: a son, daughter, wife, husband, brother, sister, parents, uncle or aunt of someone, or the head of a new family - someone already in the faction, like a new faction's heir as its leader's son, or new family members off the map, written in the file's own form), Take off the tree and Leave out change the tree; a renamed person is renamed on every relative line, also when the leader or heir is renamed on the Edit / New faction tab. The tree is checked before writing: everyone on it is someone of the faction, a husband is a man and a wife a woman, nobody has two sets of parents or is their own ancestor; a parent less than 14 years older than a child is a warning. Rome and Medieval II alike.

Characters: Characters at the top: pick any faction (rebels too). The same list, person form and family tree as the faction's Family tree, with the portraits the game shows: in Rome the game gives every character one picture of its culture's pool (ui/<culture>/portraits/portraits/young|old/generals|civilians|rogues/NNN.tga, picked at random when the campaign starts - the tree shows one of them, and says so), and family members off the map the family picture (ui/<culture>/portraits/family/wife|son|daughter.tga). In Medieval II a character on the map can have a portrait of his own: Replace... under young, old or dead takes a PNG, JPG or TGA, writes it in the size of the mod's portraits to ui/custom_portraits/<faction>_<name>/portrait_young.tga (the ages not given get the same picture) and adds , portrait <folder> to his line - the game's own way (vanilla norman_prologue does it for William, Rufus and Harold). The editor writes on its own Apply with a backup, like the unit and building editors; the faction's Family tree writes with the faction.

Terrain editor: the Terrain tab of the Maps paints the campaign map itself, tile by tile (ground, rivers, climates); its Coast & heights tab holds Land and sea and Heights (one editor in two tabs: one Undo, one Apply). Ground: low / medium / high fertility, wilderness, sparse and dense forest, hills, mountains, high mountains, swamp, beach (on the land along the coast, as both games lay it), and the three kinds of sea; Rivers, cliffs, volcanoes...: rivers, fords (the tiles where armies cross a river), river sources, cliffs, volcanoes, land bridges (Medieval II: armies walk across a narrow strait, like the Bosporus - a straight strip of 3 tiles, land, sea, land), or nothing to rub one out; Climates: the mod's own climates from descr_climates.txt (trees, winter snow, heat), shown on the map in their colours - with Climates on the water on the sea too (the file keeps a climate there, and new land made there starts with it), painted there like on the land. Climate library... lists every climate with its slot and how much of the map it covers, and shows what one gives the game, file by file and line by line with the pictures: its colour, heat and winter, the campaign map's trees and ground textures (from the default block where it has none), the mountains' own textures, the battle map's ground, plants, grass and water, the weather, sounds, town trees and disasters - a climate is not one switch, every file finds it by its name. Heights: a spray brush on map_heights.tga - hold the left button and the land rises (Raise) or sinks (Lower) the longer you hold, strongest in the middle; Smooth evens out bumps, Level to height brings the land towards a set height (right click is an eyedropper for the height of the point under the mouse; brush size n is n points of the heights picture across (2 x 2 points a tile), round and snapped to the points - 1 one point, 2 a square of 2 x 2 - the outline shows exactly the points it takes, and the line under the map gives that point's grey, metres or water depth); only land changes. Left drag paints (brush 1-12), right click picks the ground of a tile, right drag moves the map, Rivers (also over the heights) and Grid on or off. Land and sea: the shape brush draws the coast where you want it, smooth in the game (the game cuts every square of four heights points into two triangles and lays the water at 0; the brush sets the heights near the water by their distance from its edge, so the shore falls on it - exact in map_heights.hgt; tiles and ground follow, towns keep their land), Pull drags the coast with the mouse like a painter's liquify and Push grows the land into the water (or the water into the land), Smooth the coast rounds an old stepped coast, the map shows the heights point by point (no towns or other signs on it) with a Shore line exactly where the game will draw it (from 500 % zoom; Settings > Campaign map changes it); Land / Sea turn whole tiles: sea made land (a new island, a longer coast) or land made sea (a bay, a strait) - each tile changes map_regions.tga (the region picked in new land joins: with REX / M2EX by default nobody - the wasteland, ONE region of free land with no town or owner, made on Apply when there is none; or the nearest region's, or one you pick; or the sea's), the ground and the heights round it together (map_heights.hgt too), never under a town, port, character, fort or resource, never a region's last land or a port's last land. New land takes the climate most land round it has (New land: neighbours' climate, on by default; off: it keeps the climate that lay under the water; a climate painted on that water first always stays). The Ground brush keeps land as land and sea as sea, and on the coast paints only the points on its own side of the waterline; Find ground on the wrong side of the coast rings every point where the ground and the heights disagree (land texture on the water, holes of sea in the land) and, on a yes, gives each the ground round it - the heights lead. Nothing the game refuses is put under a town, port or character. Preview warns about a river tile that touches no other river. Apply writes map_ground_types.tga (a tile is the 3 x 3 block around its middle), map_features.tga and map_climates.tga (the same 3 x 3 blocks), and deletes map.rwm so the game builds its map again on the next start. A heights change writes map_heights.tga and moves the same points in map_heights.hgt (the game's own copy of the heights, which it reads instead of the picture and never makes again - it is kept, never deleted); land never goes down to black (the game may take it for sea). Painting mountains does not raise the land by itself - use the Heights brush there too. Checked in the game on Rome and Medieval II: rivers, fords, cliffs, a height map.

Portrait library: Portrait library... in Characters shows every portrait of a culture the way the game keeps them - young, old and dead, for generals, civilians and rogues (ui/<culture>/portraits/portraits/... with the small cards in .../cards/...; the same number is the same man at every age). The game hands them out at random when a campaign starts. Add portraits... puts new ones in: any PNG, JPG or TGA is made the size and depth of the culture's own (vanilla 69 x 96 and a 44 x 63 card), under the next free number in every folder of the group at once (the dead one greyed unless you give one), so the game can hand them out too. In Medieval II Use for gives the picked one to the picked character as his own portrait. Written with Apply and a backup.

Faction logos: the shield in diplomacy, on the scrolls and on the faction button (sprites on the game's sheets) is always on the Art tab; Replace... gives the faction a logo of its own - with REX / M2EX's text sheets or, on the plain games, in the game's own binary sprite lists, which the editor reads and writes; a faction that shared the logo keeps the old picture.

Faction emblem - one picture everywhere: the Art tab's button makes every place the emblem is shown (menu buttons in all four states, loading screen, faction screen, panels, logos) from one picture, each in its own size, the button states made like the mod's own - fitted by hand first (move, size, turn, shape, ground, magic wand, paint bucket). On Rome the symbol also goes onto the campaign map's flag, the faction's 3D battle banners, the flag on its towns in battle, the 3D symbol on the campaign map and the captains' cards and portraits (each from a clean white template; the routing and rebel flags stay as they are), made from the game's blank white banner dyed in the faction's colour - plain or a pattern (tricolours upright, across or slanting, quarters, crosses, a border). On Medieval II its battle banner sheet comes along: a white template made from the mod's own banner sheets, dyed in the faction's colours, the symbol on every banner shape of its units (a sheet other factions share becomes its own copy).

Banner...: the Art tab's button makes the faction's battle banners new from a white banner, both games: the cloth dyed in a pattern of up to three colours (plain, tricolours upright, across or slanting, quarters, crosses, a border), a symbol on it if you like, dragged into place with the mouse (snapped to a grid of three sizes, or freely; the wheel sizes it) - or your own drawing on the saved white template (Save the template... / Put in my own drawing...). Rome: the game's blank white banners (Roman, barbarian, eastern), the own and the allies' banner. Medieval II has no white banner, so the template is taken from the mod's own banner pictures (what they all share stays, each faction's heraldry goes); every banner and pennant of the sheet is dyed on its own and seen in 3D on its model; a sheet other factions share becomes the faction's own copy.

Recolour a faction's pictures: Recolour all its pictures... on the Art tab (or Recolour in the top row) moves the faction's unit cards, battle textures, symbols, banners and captain cards from the colours they carry now to new ones - for a faction cloned from a template: from the template's colours (found by itself) to the faction's own; the colours each picture carries now are found for each picture by itself (a template's copy, a unit brought from another mod), no list to pick them from. A part counts as the faction's colour when it is coloured and its hue is near the old colour; where the same picture exists for other factions, only what differs between them changes, so faces, horses, metal and leather stay. Light and shade are kept; black and white faction colours change too on cards and textures, and a battle texture made black / white starts from the same model's texture of the faction whose colours are nearest (the artist's own black and white, folds and faces kept). Before / after of every picture; a battle texture is never written over: the original is copied, the copy recoloured and put in the mod, the faction's line pointed at it. Written in each file's own format (TGA, DDS with its mipmaps, Medieval II's .texture) with a backup.

Your own pictures: the tool does not draw art. A new faction starts with copies of its template's pictures (unit cards, icons, symbols, banners, the campaign-select map), and a new unit or building with the pictures of the one it was copied from. To make them its own, draw or find the pictures yourself and put them in with Replace... on the Art tab, Import... in the Units and Buildings editors, or Replace... for a portrait: the tool converts them to the size and format the game wants and writes them to the right place - no copying over the existing files in ui/ by hand. Battle models are swapped with Replace model... in Units, and Your own files... puts a texture or a model file you made in another program in place of a unit's (converted, named and written in); the tool does not draw textures, models or strat-map banners. To keep or edit what is there first, every Import / Replace has a save beside it: Save a copy... for pictures (as they are, or as a PNG), Save its files... for a battle model (meshes and every faction's texture), Save... for a name call, a click on a portrait.

Settlements (top row): every region and its town - the names in the files, the names players see, the owner, names by culture; Owner shows only the towns one faction holds. Names players see... (or a double click) changes what the game shows; Rename in the files... (also in Edit region...: the two "name in the files" fields) changes the system names everywhere the mod uses them (descr_regions, descr_strat, the names lookup and texts, mercenaries, win conditions, scripts, trait and ancillary conditions) - whole words only, comments, descriptions and people's names (the name lists, a character named like the town) untouched - shown in Preview and written with a backup. Keep both names alike where you can.

Roster (Edit): the Roster tab lists every unit and building level of the mod and whether the faction has it (by its own name, its culture or everyone). Give / Take away (or a double click). A unit is really the faction's only when three places agree, and Apply changes keeps them in step: its ownership in export_descr_unit.txt, the recruit "<unit>" ... requires factions { } lines in export_descr_buildings.txt that let the faction train it, and its cards (ui/units/<faction>/#<dictionary>.tga, ui/unit_info/<faction>/<dictionary>_info.tga, copied from an owner's). A building level is the faction's through its requires factions { } list. When only this faction loses what its culture (or everyone) had, the list is written out as the other factions. The preview warns about armies and towns that already hold it (they keep it) and about a unit that no building level of the faction recruits. The Units & armies and Buildings tabs offer what the faction will have. Building levels pull their chain along: giving a level gives the levels below it, taking one takes the levels above (the game builds a chain level by level). The Roster's By buildings tab shows the faction's chains, a chain's levels and each level's units as cards: a click on a unit under All units writes it into the picked level and every level above (recruit / recruit_pool lines; a new line for the faction alone takes the numbers of the unit's line one level lower; the game trains only what the current level lists), the x on a card takes it from that level and above, + Building / the x on a tile / the + and x on a level give or take building levels.

Unit and building editors - as text: the lines' window shows the block as Fields, or as it is written in the file - Text: this block or Text: the whole file (line numbers, colours, Undo / Redo, Ctrl+F, a wrong line underlined red with its reason); both show the same changes and Apply writes them. Open in Notepad++... opens the file at the block's line (Notepad when Notepad++ is not installed). A right click on any line says what it means, its form (the values in order, commas or spaces), a line like it from the file, and the words it may take (a click adds one).

Unit and building editors - lines: Add line... puts a line in its place: in a building level a recruit line (unit, experience, factions and more conditions; factions that do not own the unit yet get it and its cards), a capability (bonus; the keys the mod uses, with an example value), an upgrade, or another line of the level - a capability / upgrades block is made when the level has none. In a unit, any key the mod's units use. x removes a line, except the ones every unit or level of the mod has. Tied to it (a button beside Stats (every line of the block); it folds away again) shows who owns and recruits a unit (or may build each level), what requires a chain, and how many armies or towns hold it at the start. A change drags along what is tied to it: a unit's new type reaches its recruit lines, the armies of every campaign, the mercenary pools and the rebels; a new dictionary copies its texts and cards; factions added to ownership get the cards; a chain's new name reaches the towns and the requirements. A line naming a unit or building the mod has not is refused.

Buildings and garrisons for many towns: on the Map (also Many towns at once... on the Buildings tab): tick Select and drag a box with the left button, as in a strategy game - towns, armies, agents, fleets, resources and forts inside it are selected (the kinds ticked in what...; it adds to the selection, Shift takes away); a right click gives the towns to another faction, adds a building to them all, gives them garrisons, or takes the characters / resources off the map). Every town of the campaign on the left, filtered by owner, level, city / castle (Medieval II) or name; the chosen ones on the right with what will happen in each. A building: a level added to all of them (or raised to it; or a chain taken out) - a town too small for the level, a castle's building in a city (or the other way), a level the owner's faction list does not allow (unless you tick it), a port building where the town has no port: left out, and the list says why. Garrisons: 2 to 6 units per town (any range) drawn at random from the units each owner may recruit - a rebel town from the nearest rebel armies (local troops) - their upkeep together under a limit you set (500, 1000...); added to the army in the town or replacing it, a town nobody holds gets a captain. Only descr_strat.txt is written, with a backup.

A faction from another mod: New faction > From another mod... - pick a mod of the same game and one of its factions (Barbarian Invasion's Celts into Rome, for example). The window fills with its names, colours and descriptions, the template becomes your faction of its culture, and Apply brings everything that is the faction's own: its units (shared when your mod has the very same, else brought with their models and cards), name lists, figures on the campaign map and in battle, battle flags, map flags, icons and pictures; its whole family (leader, heir, generals, wives, children, the family tree) stands by the capital you pick, and its towns' garrisons are 3-6 of its own units, drawn as for an empty town. Its towns are picked on your map like any new faction's; its armies stay in the other mod.

Bring from another mod: the Units and the Buildings each have Bring from another mod...: a window of six steps (which mod, which units or chains, names here, who has them, where they are recruited / which units they recruit, check and write). The other mod is only read. A recruit place or a unit your mod lacks is picked from your own (or left out, and said); a building's levels get free names when yours are taken (the game needs each once); its texts for every culture and its level pictures come along. Step by step with pictures: the wiki page Move units and buildings between mods.

Unit packs: in the Units, pick a unit (or narrow the list with Show / Find) and press Export pack...: the unit - or every unit the list shows - goes into one .zip with its models, textures, sprites, mount, engine or animal, cards, texts and recruit places. Import pack... in another mod of the same game shows the units with their names in that mod (taken names get a free one you can change), asks which factions or cultures own them, and Preview / Write it in puts them in with a backup. A model that exists with other lines is added under a new name; a file that exists is kept, never overwritten; recruit lines go into the same building and level where the mod has them (else the preview says to add them in Buildings).

Battle model and voice (Units): in one row with the unit's card and description picture (four alike frames, wrapping on a narrow window; the explanations on a ? beside each title, problems in sight), Battle model shows each soldier and officer model with a texture of an owner, how the model and the unit sit (foot, horse, camel, elephant, chariot) and a warning where they do not fit. Replace model... picks another model of this mod or of another mod of the same game - it comes with every file it names, and every faction owning the unit gets a texture on it - shown before it is written. Recolour... under a texture moves that one texture into the faction's colours (also on the Models tab's figure textures). Your own files... puts your own texture (every faction or one), Medieval II's weapons texture and your own .cas / .mesh in place of the model's - the unit gets a model of its own when others share it. View in 3D... (both games: Medieval II's .mesh, Rome's .cas - Rome in the T pose or as the file stands, chariots with their horses and crew, siege engines whole - Medieval II's play their moves, standing, moving, loading and shooting, with their crew at their places) turns the model with the mouse, zooms with the wheel, shows each faction's texture (Rome: where the model has no texture line, the one its .cas names), the game's detail levels, weapons and shield on or off, and on Medieval II "Another man" for the next mix of heads and bodies, or Face and parts to pick each head, body ... by hand; Mount's colour shows each of the mount's own textures. Every armour upgrade's model is listed under the soldiers with its own View in 3D.... Voice in battle lists what the unit says for each accent (Medieval II, descr_sounds_accents.txt) or culture (Rome) of its owners: Play its own name call ("Khan's Guard!") or any order, straight from the game's sound packs; Put in my own... makes your .wav files its name call (export_descr_sounds_units_voice.txt gets the unit its own lines; data/sounds/events.dat is removed with a backup, and the game builds it again on the next start). The voice class is the unit's voice_type line.

Locked factions: on Load, a campaign whose factions cannot be picked (the unlockable / nonplayable lists of descr_strat.txt - Rome's Egypt, Gauls and the rest; Barbarian Invasion's Celts, Burgundii...; Medieval II's Aztecs) offers to open them to play, with a backup (Restore locks them again). The Roman Senate, the Pope, the rebels and any faction that starts with no town stay locked; Edit faction's Playable tick changes one at a time.

Campaign rules: Campaign rules (top row) lists every value of the campaign's settings files by group, each with a plain explanation: the top of the campaign's descr_strat.txt in both games (start and end date, timescale, brigands and pirates, the switches as on / off); Medieval II's descr_campaign_db.xml (recruitment, religion, bribery, ages and the family tree, ransom, autoresolve, sacking, revolts, hordes, merchants, agents, crusades), descr_settlement_mechanics.xml (each line of the town scrolls - growth, public order, income - with its weight, min and max), descr_diplomacy.xml, descr_recruitment.xml; Rome under REX its descr_settlement_mechanics.xml (the people each settlement level needs); REX / M2EX descr_unit_sizes.txt (the Unit size choices) and the engines' own settings descr_ex.txt and descr_caps_ex.txt (ages, bribery, hordes, camera, max factions, recruitment slots, feature switches - each explained by the engine's own comment). Find looks through all of them; a value that differs from the game's own shows the game's beside it with Reset. Every change waits for Apply changes by itself (the changes go into the session's list; Apply changes in the main window writes them with everything else waiting - one backup set, Undo this write puts them back): only the value's characters change.

Special places (Map editor, REX / M2EX): a right click on land > Special place here...: any campaign-map model (a tower, a keep, a wonder, a mine, your own .cas) drawn on that tile, its own window on a double click at the screen's left on the game's own scroll - picture across the whole width, name, what it gives, text, who holds it - and money a turn for its holder if you like; drag its gold diamond to move it.

Add-ons: the Add-ons button beside the editors lists ready-made scripts that add something new to the game. Pick the settings, Preview, Put it in (a backup first); Update it changes them later, Take it out removes it; an add-on an earlier editor put in is marked (old), and Load offers to bring every such one up to this version, its settings kept. Scripts in the game... lists every script in the game's script/modules (any author's) - change its settings, turn it off / on, delete it; the test mod's scripts go with one press. Sack Settlement (Medieval II) (M2EX; the same kind of module in the game's script/modules, where M2EX loads it for every mod) does the same in Medieval II - its button, drawn from the game's own pieces under Occupy / Sack / Exterminate, says Raze Settlement. Avoid Growth (Rome + REX, Medieval II + M2EX): a tick on your town's scroll, drawn with the game's own box and tick - the people it has now become its ceiling: it may shrink and grows back, never past that (border towns on auto-manage stay as they are). Player Diplomacy (Rome + REX): the computer stops attacking you when it makes no sense - a truce after a ceasefire, client kingdoms never invade you, far weaker factions keep away (alliances still count). Sack Settlement (Rome + REX; a REX module in the game's script/modules, where REX loads it for every mod): a 4th choice on the capture scroll - the town is exterminated the game's own way, torn down to the chains you keep (walls and roads by default - picked from the mod's own buildings; the governor's building always stays, and any building in the town is read, also one brought from another mod), 600 people left at least, you get a reward per building and inhabitant, and the ruins go to the rebels with a garrison the game raises itself. Who may sack: only the player (default), everyone, only factions without a town of their own (hordes), the player and hordes, only the computer, or the factions you pick - a computer faction allowed to sack does it whenever it exterminates.

Module builder: Module builder (top row, in the main window) (or Add-ons > New module (no code)...) makes your own add-on without writing code, for both games (REX and M2EX run the same script). It looks like Scratch: coloured blocks dragged from the left into the module, fitting into each other (Look: Lists shows the same module as lists). Pick WHEN something happens (the player's turn starts - once a turn -, every faction's or a town's turn starts, a general takes a town, a building is finished, a unit is trained, a battle ends, a town riots, rebels or grows, a faction is destroyed or gets a new leader, a son comes of age; and from the engines themselves: a new round begins, a character dies, a faction is wiped out, a new campaign begins), then FOR EACH town or army of a faction, or each faction, if you like (as Scratch's repeat), add IF conditions - all of them, any one of them or none of them, not before a line turns it round - (who the faction is, its money or towns, the turn, a chance, the town's people, which town, the capital, a building it has, who lost the town) and DO actions (money, people added, taken or capped, a building built or a chain torn down, new units, the town given away, war / peace / alliance, a trait or retinue member, the game's message scroll, a log line, a console command) and ELSE actions for when the IF does not hold. Names (units, buildings, towns, traits, factions) are picked from the mod's own files; In plain words says what it will do, and what is missing is said before anything is written. Beyond these blocks, an IF line can be any condition of the engines' own list and a DO line any console command or any campaign-script command (hundreds - kill_character, set_event_counter, Trait, I_TurnNumber...): Pick... lists them with a search, the form of each line and a sample (and the engine's own description when the game has its documentation folder - the engines write it with the console command dump_docudemon); a line the engines would not take is said before anything is written. Tick any number or text to make it a setting the player changes on the Add-ons page. Start from one of nine examples (help when broke, loot for a town, plague in big cities, a free unit for a new barracks, gold for the capital, a message on turn 10, rebellion punished, a trait for the conqueror, Avoid Growth for chosen towns). Show the script, Check it, Save to my add-ons, Put it in the game (a backup first; its messages go into the mod's text/custom_messages.txt), Share... as a zip. Each time it acts, the game's log gets a line starting with its name.

Changes waiting for Apply: a * on Factions, Units or Buildings marks work not written yet. When more than one holds changes, Apply changes lists them with ticks and writes them one after another (the editors first, then the faction and the map), each with its own backup; Preview shows them all. Picking another faction in Edit with changes not written asks: apply them, drop them, or stay. Switching between the works (Maps, Edit faction, New faction, the other editors) drops nothing: each keeps its work not written yet until you come back.

Look: Dark / Light at the right of the work bar (kept for the next start). The Map's Layers panel (colours and what is shown; it stays open while you tick) also draws the ground tile by tile (one square = one tile, the ground at its middle - what the tool checks), relief from map_heights, rivers, fords and cliffs from map_features, and a tile grid when zoomed in. The Units and Buildings editors' lists filter (Show: a faction, a culture, a category or class, mercenaries apart; building chains by who may build them, their kind, recruiting or not) and sort.

The mod is remembered: the last mod and the campaign picked in it load at the next start; Mod at the top lists every mod of the game folder (the game itself, bi, alexander, HLR, the mods made with New mod folder..., Medieval II's mods/...).

Diplomacy: the Diplomacy tab lists every faction with its Status at the start - neutral, alliance or war on the first turn (faction_relationships, both games; one pick sets it both ways) - and the AI feeling both ways (Rome core_attitudes, lower is better: -10 own house, 0 allied, 100 friendly, 200 neutral, 310 wary, 410 dislike, 600 enemies; Medieval II faction_standings, -1.0 hate to 1.0 love). Every value is shown with its meaning, e.g. 600 (enemies); hover a column's ? for more. Picking a status pulls the feelings along: an alliance lifts them to the allied level, a war drops them to the enemies' level, neutral takes them out - they can still be set by hand. Changed cells get a blue frame; only the lines naming the faction are rewritten. A new faction 'neutral to all' gets the rebels' lines the way the campaign's own factions have them (Medieval II: faction_standings -1.0 and at_war_with slave). The Diplomacy colours on the Map show how the faction stands towards each owner (an alliance or a war first). Trade rights have no start line in either game.

Family tree: the Edit faction / New faction tab's Family tree button opens the faction's people and family in the form's place (Back to the faction returns); it stays folded otherwise, so the form has the room.

Victory: the Edit faction / New faction tab's Victory block shows what the player must do to win the long and the short campaign (descr_win_conditions.txt): regions to Hold, how many to Take, factions to Outlive, and in Rome the Senate's Goal (be emperor / take Rome). Pick regions and factions from a list, or the towns to hold straight on the map (On the map...); Take offers the usual 15 / 25 / 50 / 75 / 100 (any number may be typed); a region or faction that does not exist is refused (the game crashes on it). A new faction starts from its template's conditions.

Mercenaries: Mercenaries (top row), or a right click on the map > Mercenaries for hire in ..., shows who is for hire where (descr_mercenaries.txt), in two tabs. For hire in a region (the right click opens it on that region) makes the region's list the way a garrison is made: the mercenaries' cards on the left - a click adds one - and the units for hire there on the right - a click picks one for its numbers, a right click takes it out. A region shares its list with the other regions of its pool; the tab says which, and A list of its own takes the region out of the pool with a copy of the list (a region in no pool gets its own list with the first card). Pools - a pool is a group of regions that share one hire list. Pick a pool: its regions are selected on the map (Select switches on, they show yellow), so they are changed the map's own way - a box adds, Shift + box takes away - and Take the map's selection gives the pool exactly that (Add the map's selection only adds). New pool from the map's selection (also the map's right click with Select: New mercenary pool from the selected regions...) makes a pool of them; a region stands in one pool only, so it leaves its old one (a pool left without a region goes). Each unit for hire shows its numbers in plain words - how many at the start, at most, how fast they come back (one every N turns), the price, the experience, and in Medieval II the years, religions, crusading and events it needs; pick one to change them, Add another mercenary of the mod (units with mercenary_unit), take one out, rename or delete a pool. A mistake the game would stumble on is said in red; every change waits for Apply changes by itself (the changes go into the session's list; Apply changes in the main window writes them with everything else waiting - one backup set, Undo this write puts them back); lines not changed stay as they were.

Rebels: Rebels (top row, beside Mercenaries), or a right click on the map > Rebels in ...: the rebel types (descr_rebel_factions.txt) - their units, kind, chance and the name players read - new, copied, renamed (its regions follow) or deleted (its regions get another), and which region has which type (descr_regions.txt), many at once with a faction filter or the map's selection. Preview; every change waits for Apply changes by itself, which writes it with a backup.

A mod from zero: Tools > A mod from zero, step by step... lists the steps in their order - your own mod folder, the map (keep it or Map from zero), factions (a clean copy of one you pick, or one from another mod), units and buildings, Check mod files, the game - with how far the loaded mod is at each and a button that opens the editor's own place for it.

Map from zero: Map tools > Map from zero... on the map's bar replaces the campaign's map with a small one to grow yourself: an island in the sea, one region with its town, a port and a resource, one faction (Rome: the Gauls, Medieval II: France - or another you pick) and the rebels with one army - or more: Regions and Other factions cut the island into that many regions, each faction on its own capital with its leader, the rest the rebels' towns (Rome wants 5 factions for its Faction Rankings 'Top 5' view; no game needs a number of regions to load); every map picture at its size, the heights, descr_terrain, the regions, the start, the win conditions and the mercenaries written; a backup first, Restore puts the old map back. Start a NEW campaign in the game.

Interface: Interface (top row, beside Events - a work shown in the main window): the game's menu screens (data/menu/Rome.lnt, Medieval II mtw2.lnt) page by page as the game lays them out, with their pictures and their words in the game's own letters. Click a piece, drag it, size it by its corner, nudge it with the arrows; its right click sets its place, size, the page it opens, its words and tooltip; Copy makes the next numbered piece, Remove takes one out; Faction slots... (right click on a faction's slot) adds as many slots as you need on the same grid, so every playable faction can be picked; a double click on a button opens its page. The main window's Undo / Redo, Preview changes and Apply changes act on it as on every work; the menu backdrop shows where the game plays its video (a picture only in Barbarian Invasion). Check mod files says a button leading nowhere or a missing menu picture. A button under the mouse shows its mouse-over picture; Buttons shown draws them pressed or ticked, and Pictures of its states... (right click) sets each state's picture; Replace picture... gives a piece a picture of your own - a file or one of the Picture library (the game's own menu pictures and yours, kept for every mod) - and keeps what it does (the page it opens, its words); Back to the game's picture undoes it. Its Sprite sheets tab shows every interface picture of the sprite sheets the game reads, page by page and culture by culture, with the box and name of each - Find, open big, save as PNG; its right click replaces a sprite's picture or the whole page's, or sets a sprite's place and size (and the size the game shows it at, on an engine's sheet) (Apply writes them into the mod's own copy, Undo / back to the files undo it). HD sheets (an engine's tw / th, loose sprites) are read as the game reads them. Its Campaign HUD tab shows the campaign map's bottom panel as the game draws it (the engines' own places, both games), from the mod's own pictures - right click a piece to replace its picture or set its place and size; Screen shows it stretched to a bigger screen as the game does; Screenshot over it... lays your own game screenshot over it to compare (slider / [ ] how much, O shows or hides it); save it as a PNG. The HUD lies on a board as on Obsidian Canvas: the wheel zooms at the mouse, the middle or right button (or Space + left) moves it, Fit / 1:1 / + / - sit in its corner (Shift+1 everything, Shift+2 the picked piece, Shift+0 100 %); the screenshot is a card you can drag aside to compare them side by side - it lands on the grid and sticks to the HUD's edges (Snap to grid; Alt held: anywhere). The file is written byte-exact - only the lines changed. The idea comes from Wholesome Queen's RTW Sprite & HUD Studio.

Make the campaign map 3 x bigger (beta): Map tools > Bigger map (x3)... (Maps, beside the zoom) turns every tile into a 3 x 3 block in five steps you press one by one - grid, smoothing, heights, rivers, objects - each written with a backup and checked, the map in the editor between them to look at and fix by hand, for room between the towns for new regions and factions. The coast, rivers drawn as sea and the borders of regions, ground types and climates come out smooth (how smooth is a value in the window, with the heights, crags, valleys and volcanoes beside it - never in 3 x 3 squares; a border that ran along a river stays on it), rivers bend and meander, the heights and map_heights.hgt (the game's own copy of them) are made at the new size, and the hills, mountains and sea floor 3 x higher so the slopes stay as they were (a value in the window). Towns, armies, agents, resources, forts and event positions keep their places in the middle of their blocks, ports stay on their region's shore, rivers stay 1 pixel wide (the game crashes on a 2-pixel river), every picture of the map grows with exact colours, descr_terrain.txt gets the new size and map.rwm is removed (the game builds it again). Press Make the map 3 x bigger in its window (Preview lists every file first); one backup, and Put the old map back undoes it at once. The campaign's scripts follow: spawned armies, moved characters, the camera, revealed tiles and 'near a tile' conditions go to their blocks (battle positions stay; lines it cannot read for sure are listed). Past 510 tiles the original exes need REX / M2EX. Change size... under the map grows the map at any edge by whole tiles (deep sea) or cuts it - drag the map's edges on the map itself or type the numbers - everything on the map and in the campaign's scripts moved with it (what stands on the part cut off is ringed red on the map; it goes with the cut after a question - towns with their regions, armies, agents, resources, forts, events; family members move to their faction's nearest town). When it is written, a message says what to look over by hand (no rule draws every map 100 % right) and which brushes fix it.

The game's log in plain words (Tools): the game's newest system.log.txt for this mod read and explained - a crash first, errors grouped, what each means and what to do, and for a Script Error the mod's line as it reads now. With a report, it is the quickest way to the cause of a crash.

Check mod files (Tools; called Check mod before 0.24.0): reads every file the tool uses and reports what it found (factions, cultures, units, buildings, regions, towns, ports, characters, diplomacy) and anything it cannot make sense of - a settlement without a region, a unit an army names but the unit file lacks, a character after a family tree, a faction missing from the playable / nonplayable lists, a family member off the map the game would leave out, a building recruiting a unit that does not exist. Where the game has its own error text, the problem quotes it. The deep check also rehearses, in memory, an edit and a new faction for every faction and checks the result the way the game reads it (minutes on a big mod). Nothing is written. The answer lists the problems worst first, grouped by when the game would meet them (it would not start, the campaign loads with something lost, in battle, while playing), each with a button that opens the place to put it right; Full report... shows everything that was read.

Undo, keys, help: Undo / Redo (Ctrl+Z, Ctrl+Y or Ctrl+Shift+Z) step back through towns picked, garrisons, buildings, settlement sizes, map moves, armies and diplomacy. Ctrl+P preview, Ctrl+S apply, F5 load again, Ctrl+1..9 the tabs on show, F1 or Tools > Help for a short guide. Far out on the map only towns are drawn; ports and characters show from zoom 4.

Log: the tool keeps CampaignEditor.log in CampaignEditor\CampaignEditor_logs next to the exe (its own folder; versions up to 0.33 kept it right beside the exe - the editor asks once to move it in), together with the logs zips and the sessions (or in %APPDATA%\RTW-M2TW-Campaign-Editor where the exe's folder cannot be written): what was loaded, previewed and written, and every error with its details. Tools > Log shows it; send it along with the game's system.log.txt when something goes wrong.

Undo: press Restore a backup... Backups sit in CampaignEditor_backups next to data (older versions' backups are listed too). Pick the write to go back to: it and every later one are undone in one go.

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