Empires Modding: Difference between revisions
Line 62: | Line 62: | ||
== Adding Units == | == Adding Units == | ||
Before starting, if your custom scenario doesn't already contain these files, copy them from the game install folder (as above, do not edit them directly in your game installation): | |||
* DATA\UNITS.CSV | |||
* DATA\UNITVISUALS.CSV | |||
* DATA\FACTIONS.CSV | |||
To add a new unit, start by adding a new row to your UNITS.CSV, or copying the row describing a similar unit. You must fill in these fields: | |||
* ID - This must be a unique number greater than zero, start with something well beyond the range of values in the standard unit list to avoid conflicts later, ex 10000. | |||
* Alias - This must be a unique and descriptive string starting with "ID_UNI_" that you will use to identify this unit later in other data files. | |||
* Name - This is a reference to the name used for this unit type. Add a new, unique string id in this table (by convention, starting with IDS_UNIT_NAME_ and ending with the unique portion of the Alias) and then define a new string with this id in your scenario's TEXT1.TXT file. | |||
* Text - This is a reference to the description used for this unit type. Add a new, unique string id in this table (by convention, starting with IDS_UNIT_TEXT_ and ending with the unique portion of the Alias) and then define a new string with this id in your scenario's TEXT1.TXT file. | |||
To complete your new unit, or if you are simply modifying an existing unit, also set these fields: | |||
* FOG2_Name - This is the type of unit this will be exported as when a battle is exported to Field of Glory 2. This must match a value in the Name column of Field of Glory II\Data\Squads.csv, or copy a value from a similar unit if you are unsure. | |||
* FOG2_QualityMOD - When exported to Field of Glory 2, this is the base quality of a unit relative to the type given above, as a percentage. Set this to 100 if you are unsure. | |||
* AGEOD_Cost - When exported to Field of Glory 2, this is used in the calculation of how many units are created in FOG2 for each Empires unit. | |||
* Family - The category of this unit, possibly values are: $famInfantry, $famHvyInfantry, $famArcher, $famSkirmisher, $famLtCavalry, $famSkirmisherCavalry, $famCavalry, $famHvyCavalry, $famHvyBeast, $famSiege, $famLtWarship, $famWarship, $famHvyWarship, $famTransport | |||
* EvolveFamily - If non-zero - if this unit becomes obsolete it can be replaced by another unit with the same value, or another unit with the same value becomes obsolete it can be replaced by this unit. | |||
* EvolvePriority - If an EvolveFamily is set, it is used to pick the best unit to evolve an obsolete unit to. | |||
* UpdgradeNext - Used in Event/Decision driven unit upgrades. | |||
* MoveSpeed - The movement speed of the unit. | |||
* Hits - The maximum number of Hits of the unit. | |||
* Effectiveness - The maximum Effectiveness value of the unit. | |||
* Attack - The base Attack value of the unit. | |||
* Defense - The base Defense value of the unit. | |||
* IsSupport - Does the unit behave as a support unit in combat. | |||
* DistanceToCenter - Low values will cause a unit to be deployed near the center of combat, high values will deploy the unit near the flanks. | |||
* AssaultDistanceToCenter - As DistanceToCenter, but used during assaults. | |||
* Siege - The Siege value of the unit. | |||
* SiegeResist - The Siege Resist value of the unit. | |||
* SupplyUsage - The amount of supply consumed by the unit per turn (1 food typically provides 5 supply, before bonuses and penalties). | |||
* AttackingRange - During the ranged attack phase of combat, can the unit target the opponent front line (0), support line (1), or reserves (2). | |||
* RangedAttack - The Ranged Attack score of the unit, or 0 for units without a ranged attack. | |||
* RangedDefense - The Ranged Defense score of the unit. | |||
* RangedMaxDamages - The limit of Effectiveness damage done by the unit during the ranged attack phase. | |||
* FlankingModifier - A bonus used when calculating flanking or pursuit damage inflicted by this unit. | |||
* Modifier[0 - 3] - | |||
== Adding Structures == | == Adding Structures == |
Revision as of 20:36, 5 June 2019
Modding Guide
Getting Started
Empires saves user files in your Documents\My Games\FieldOfGloryEmpires folder, which will be referred to as your 'user' folder. In addition to saved games, logs, and options files, this is where user created mods are located. Editing files directly in the game install folder (ex C:\Program Files (x86)\Slitherine\Field of Glory Empires) is NOT recommended, doing so may prevent multiplayer games from working correctly and interfere with game updates.
Before you begin modding, you may wish to open the USER.TXT file in your user folder and the following line to enable additional debugging tools:
DEBUGMODE 1
Create a Scenario
Empires currently only support mods by the creation of a new, modified scenario. The quickest way to create a new scenario and get started modding is to copy an existing scenario. For example, to start with the grand campaign, browse to the Scenarios folder in your game install folder (ex. C:\Program Files (x86)\Slitherine\Field of Glory Empires\Scenarios). Copy the d310BCGrandCampaign folder into the SCENARIOS folder of your user folder (ex Documents\My Games\FieldOfGloryEmpires\SCENARIOS). Rename the pasted folder to something new (it is recommended the new folder name not contain spaces). You should also make sure this new folder and its contents are not Read-Only. Inside this folder, you should see a number of files:
MYSCENARIO │ SCENARIO.BSF │ TEXT1.TXT │ TEXT1_FRE.TXT │ TEXT1_GER.TXT │ TEXT1_SPA.TXT │ SCENARIO.TXT ├───DATA │ │ SETUP.csv │ │ SETUP_FACTIONS.csv │ │ REGIONS.csv │ │ SETUP_GROUPS.csv │ └───SCRIPTS │ Events_Plugin.BSF
A good place to start would be to open TEXT1.TXT in a text editor. Here you can give your mod a unique name, description, and starting message. See Modding#Custom_Text for details on modifying string files in the Archon engine. TEXT1_FRE.TXT, TEXT1_GER.TXT, and TEXT1_SPA.TXT contain the translations of the strings in TEXT1.TXT. If you do not plan to translate your mod into other languages, you should just remove these three files and the strings entered in TEXT1.TXT will be used for all languages.
SCENARIO.BSF is another place you can make some quick edits to you scenario. Refer to Scripting for a description of the Archon scripting language. The InitScenario function near the beginning of this file sets up a number of parameters for your scenario, try changing gTurnInfos.dateFirstTurn to adjust the starting date for your mod.
If you start the game and select Scenarios, your modified scenario should now appear near the bottom of the list and be selectable for play.
Changing the Scenario Setup
Three files of particular interest when changing the setup of the scenario are found in the DATA folder - SETUP.csv, SETUP_FACTIONS.csv, and REGIONS.csv. These files are semi-colon separated CSVs and can be opened and edited in most spreadsheet software (ex Excel, OpenOffice), be sure to save them in the same format.
SETUP_FACTIONS.CSV
This file defines which factions are available in your scenario.
Coming soon
REGIONS.CSV
This file specifies the basic properties of each region on the map.
- Alias: This is used as a reference to this region elsewhere. It is not recommended that you change this column, as it is used to associate this region with an area in the map used by this scenario.
- Name: This is a reference to the name used for this region. To edit the name, do not change the reference itself, but create a new entry with this id in the TEXT1.TXT file you edited above.
- Terrain: This is the terrain type of this region. For a list of valid terrain types, see DATA\TERRAINS.CSV, although some terrain types are not valid to assign directly to a region. Note that the reference must begin with $. This is generally the case when referring to an Alias from another CSV.
- Res[0], Res[1], Res[2], Res[3]: These are the natural resources present in the region. For a list of possible resources, see DATA\RESOURCES.CSV.
- Disabled: This controls which regions defined in the map are included in the scenario.
- Faction: This is the faction which initially owns this region (see SETUP_FACTIONS.CSV)
- CitizensID[0], CitizensAmount[0]: CitizensID[0] is the ethnicity of a the citizens to add, see DATA\ETHNICS.CSV for a list of possible ethnicities. CitizensAmount[0] is the number of citizens of the given ethnicity to add. Citizens will initially be distributed among the four possible jobs. To add citizens of multiple ethnicities, use CitizensID[1-3] and CitizensAmount[1-3].
- SlavesID[0], SlavesAmount[0]: add slaves to the region, similar to citizens above, although they will only be initially assigned to Agriculture or Infrastructure.
- City_Name: This is a reference to the name of the city in this region. As with the region name, you can override the name by adding a new entry to your TEXT1.TXT file.
SETUP.CSV
This file defines the initial placement of structures and groups (armies and navies) in your scenario.
Coming soon
Adding Units
Before starting, if your custom scenario doesn't already contain these files, copy them from the game install folder (as above, do not edit them directly in your game installation):
- DATA\UNITS.CSV
- DATA\UNITVISUALS.CSV
- DATA\FACTIONS.CSV
To add a new unit, start by adding a new row to your UNITS.CSV, or copying the row describing a similar unit. You must fill in these fields:
- ID - This must be a unique number greater than zero, start with something well beyond the range of values in the standard unit list to avoid conflicts later, ex 10000.
- Alias - This must be a unique and descriptive string starting with "ID_UNI_" that you will use to identify this unit later in other data files.
- Name - This is a reference to the name used for this unit type. Add a new, unique string id in this table (by convention, starting with IDS_UNIT_NAME_ and ending with the unique portion of the Alias) and then define a new string with this id in your scenario's TEXT1.TXT file.
- Text - This is a reference to the description used for this unit type. Add a new, unique string id in this table (by convention, starting with IDS_UNIT_TEXT_ and ending with the unique portion of the Alias) and then define a new string with this id in your scenario's TEXT1.TXT file.
To complete your new unit, or if you are simply modifying an existing unit, also set these fields:
- FOG2_Name - This is the type of unit this will be exported as when a battle is exported to Field of Glory 2. This must match a value in the Name column of Field of Glory II\Data\Squads.csv, or copy a value from a similar unit if you are unsure.
- FOG2_QualityMOD - When exported to Field of Glory 2, this is the base quality of a unit relative to the type given above, as a percentage. Set this to 100 if you are unsure.
- AGEOD_Cost - When exported to Field of Glory 2, this is used in the calculation of how many units are created in FOG2 for each Empires unit.
- Family - The category of this unit, possibly values are: $famInfantry, $famHvyInfantry, $famArcher, $famSkirmisher, $famLtCavalry, $famSkirmisherCavalry, $famCavalry, $famHvyCavalry, $famHvyBeast, $famSiege, $famLtWarship, $famWarship, $famHvyWarship, $famTransport
- EvolveFamily - If non-zero - if this unit becomes obsolete it can be replaced by another unit with the same value, or another unit with the same value becomes obsolete it can be replaced by this unit.
- EvolvePriority - If an EvolveFamily is set, it is used to pick the best unit to evolve an obsolete unit to.
- UpdgradeNext - Used in Event/Decision driven unit upgrades.
- MoveSpeed - The movement speed of the unit.
- Hits - The maximum number of Hits of the unit.
- Effectiveness - The maximum Effectiveness value of the unit.
- Attack - The base Attack value of the unit.
- Defense - The base Defense value of the unit.
- IsSupport - Does the unit behave as a support unit in combat.
- DistanceToCenter - Low values will cause a unit to be deployed near the center of combat, high values will deploy the unit near the flanks.
- AssaultDistanceToCenter - As DistanceToCenter, but used during assaults.
- Siege - The Siege value of the unit.
- SiegeResist - The Siege Resist value of the unit.
- SupplyUsage - The amount of supply consumed by the unit per turn (1 food typically provides 5 supply, before bonuses and penalties).
- AttackingRange - During the ranged attack phase of combat, can the unit target the opponent front line (0), support line (1), or reserves (2).
- RangedAttack - The Ranged Attack score of the unit, or 0 for units without a ranged attack.
- RangedDefense - The Ranged Defense score of the unit.
- RangedMaxDamages - The limit of Effectiveness damage done by the unit during the ranged attack phase.
- FlankingModifier - A bonus used when calculating flanking or pursuit damage inflicted by this unit.
- Modifier[0 - 3] -
Adding Structures
Coming soon?
Adding Events
Coming soon?
Advanced Modding
Many files not specifically covered elsewhere can still be overridden in a modified scenario. Generally, if a file is found anywhere in the Data folder of the game installation, you can place a modified version of that file in the same relative location of the DATA folder of your modified scenario and your scenario will use that instead.
The Editor
Coming soon??