Editing Campaign File Part One
As part of creating a new custom campaign, we will walk through the
MOD_CAMPAIGN_STRATEGIC_ALLIES_00 instance located in
\Data\XML\Mod_Campaign_Strategic_Allies_00_Instances.xml in the "Petroglyph: Siege of Paris" sample custom campaign mod.
- Remember that the fastest/easiest way to create your own custom campaign mod is to just copy the entire directory structure of the "Petroglyph: Siege of Paris" into your mod and rename and edit files to match your custom campaign and what you would like to change.
<Instance Name="MOD_CAMPAIGN_STRATEGIC_ALLIES_00" Variant="Base_MOD_CAMPAIGN">
When comparing this instance to the ones used for the Shipped Campaigns (Examples: CAMPAIGN_STRATEGIC_ALLIES_00 and CAMPAIGN_STRATEGIC_CENTRAL_POWERS_00) you will notice a few missing tags. This is because we pulled a few of the common tags into Base_MOD_Campaign located in Instances.xml (same file where the base games instances are) to simplify the creation.
- Any tags with “TextID” refer to the text tags which are created and hooked up in a csv file. See
\Data\Text\MOD_CAMPAIGN_STRATEGIC_ALLIES_00.csvin the "Petroglyph: Siege of Paris" sample custom campaign mod for examples.
- The order of the tags inside the instance itself doesn't really matter, and you can reorganize if it makes it easier for you to understand your XML.
This is the Regions file that controls the starting strategic map. This file controls many things including which Faction owns which region, how many stars they have, what units start there, and what structures are there. To see additional examples of this file, look for
Regions_1916.XML which are what the normal 1915 and 1916 campaigns use. Note: You don't need to create your own unique setup, and it is ok to just plug in the name of an existing files.
These tags control which movies play at the start of the game and when the player Wins or loses a campaign. You can either create your own movies and include them in your mod in the
\Data\Art\Movies directory or you can use any of the existing movies. The IsWide tag (true/false) can be changed depending on the format of your video.
These two tags refer to the lua scripts that are used to manage the strategic events and the victory conditions of the campaign. These can either be customized or you can use the default names the normal campaigns use.
lua\MapScripts\FAR_STRATEGIC_EVENTS_FACTION_01.lua- This is the default events file (ignore the name, it controls both factions) although you probably will want to create a custom version depending on what you want to change to have your own starting events and to decide which of the other game events you want to play.
lua\MapScripts\TGW_Strategic_Victory_Conditions.lua- This is the default victory conditions and will end the game at 0 national will or with the capture of either of the two capitals. The main reason to change it is if you want the game to end based on the capturing of different regions like the "Siege of Paris" campaign considers it a win for the Allies if they capture Verdun and adds an additional loss condition if the Germans manage to capture Calais.
These tags control the information (description, date, image) on the campaign select screen in the main menu. The Images can either be added as part of the mod (
\Data\Art\Textures\SRGB folder) or you can use any of the existing campaign images.
- ui_campaign_frontline_1914.tga - This is the snowy version that is currently used for the 1914 campaigns.
- ui_campaign_frontline_1916.tga - This is the clear version that is currently used for the 1916 campaigns.
These tags control the information (name, description, date, image) on the campaign load screen. The Images can either be added as part of the mod (
\Data\Art\Textures\SRGB folder) or you can use any of the existing images in the game.
The only part that matters here is which faction is the player and which is the AI. The
<Faction> Faction1_Strategic </Faction> that is associated with
<Entry> MARKER_PLAYER_START_000 </Entry> is the player (so has
<AI>false</AI>) while the
<Faction> Faction2_Strategic </Faction> that is associated with
<Entry> MARKER_PLAYER_START_001 </Entry> is always the AI (so has
<AI>true</AI>). Therefore, if you want the player to be the Central Powers, set the faction with MARKER_PLAYER_START_000 to 2 and the other faction to 1.
This tag is used to set the starting Supply Bank for each faction. These values are intended to be the standard for SOLDIER difficulty level.
This tag is used to set the starting Gold for each faction. These values are intended to be the standard for SOLDIER difficulty level.
This tag is used to set the starting unspent Tech Points for each faction.
These tags are used to set the starting national will for each faction.
- StrategicStartingNationalWills - This is the value the campaign actually uses
- FactionStartingStrategicNationalWillDisplay - This is the value that the UI uses on the campaign selection screen. In most cases you want the two values to be the same, but this allows you to allow for modifiers to be added and still have the numbers match between selection screen and in game. For example, if I were to mod in a structure that raises national will while it exists, you could set the starting national will for the owning faction lower to compensate for that structure (for example 450-500 when the structure grants 50 NW) and set the display to read 500-500.
These tags are used to set the starting tech nodes for each faction. While you do NOT have to respect prerequisites for this section, it is suggested that you do so anyway to avoid strange behavior on the tech tree. The MOD_CAMPAIGN_STRATEGIC_ALLIES_00 instance has the full list of node names along with the default number of tech points it normally costs to unlock and a brief description and you can find additional details about what each tech does in
Strategic_Tech_Tree_Objects.XML. This is useful to see the object states or units are granted when the tech is given. Since there is no easy way to see the AI tech tree in game, it is recommended you swap the
<Key>Faction2_Strategic</Key> to the player faction to see each tree as you create it.
This is a more advanced (and completely optional) tag but is used if you want to give the player the tech tree nodes (without giving the bonuses that go with them). For example,
<entry>TECH_MECH_MechWarfare_1</entry> gives the player free tanks in their capitals and you might want to grant the player the tech without giving the player the free units.
This is another advanced (and completely optional) tag that is used to give additional starting player states. While the most common usages is with the above
<StartingTechMapDisabledBonuses> and give the object states that normally are granted with the tech, there are other use cases such as waiting to give the player object stats for scripting reasons (the tutorial instances) or if you want to give states that are normally granted via in game events that you might be skipping over (Americans has arrived).
These tags control the campaign starting month, year, and matching round. For reference, the game assumes that December 1914 is round one. Each month after that is the next round, so the starting point of May, 1916 would be turn 18. This is important because the world events manager uses the round number to determine when to unlock and potentially trigger game events, and the turn numbers are considered universal. Also note that the game’s hard round cap is December 1919 (turn 61).