Structure of a .modinfo file
Mod
The root element in a.modinfo file is always the <Mod> element. It should have the following attributes:
id-
The
idis an identifier used to distinguish mods. It must be unique to distinguish it from other mods. It’s recommended that the id be composed solely of ASCII characters and be less than 64 characters. It’s also recommended to use solely lower case letters, and to use dashes instead of underscores or spaces. It’s also good practice to adopt a developer prefix (an informal identifier for yourself, something likefxs,suk,lime) for all your mods. So instead of giving your mod the idmy-cool-mod, you’d give it the idfxs-my-cool-modto ensure your mod id is completely unique.
-
The
version- The version number for the mod.
xmlns- The XML namespace. This should always be set to
ModInfo.
- The XML namespace. This should always be set to
Properties
TheProperties element contains much of the additional information about the mod. It consists of the following child elements. All these elements are technically optional, but at minimum, you should include Name, Description, and Author.
Name- The name of the mod. If this element is left empty, the mod will not show up in the Add-Ons screen, though the game can still load it.
Description- A brief description of what the mod does. It will be displayed in the Add-Ons screen.
Authors- The name of the author(s).
AffectsSavedGames-
Determines whether the mod affects existing saved games.
Mods with this element set to
1cannot be removed or added to games that are already in progress. Mods that affect the Gameplay database should have this set to1. Mod with this element set to0can be added or removed at any time. This is usually for mods that ONLY affect the game’s UI and/or Localization database. Set to1or0. If this element is excluded, it defaults to1.
-
Determines whether the mod affects existing saved games.
Mods with this element set to
Package- This field is not currently used by the game’s UI. It would allow for mods with the same package value to be grouped together.
PackageSortIndex- This field is not currently used by the game’s UI. It would determines the order in which mods are shown in the browser.
ShowInBrowser- Determines whether the mod should be shown on the Add-Ons screen.
Set to
1or0. If this element is excluded, it defaults to1.
- Determines whether the mod should be shown on the Add-Ons screen.
Set to
EnabledByDefault- Determines if the mod is enabled by default if it has not been enabled/disabled in the game previously.
Set to
1or0. If this element is excluded, it defaults to1.
- Determines if the mod is enabled by default if it has not been enabled/disabled in the game previously.
Set to
Dependencies
TheDependencies element consists of a list of Mod child elements. This mod will have those mods as dependencies. This means those mods will need to be activated for this mod to be activated. Additionally, those mods will be loaded before this mod.
Each child Mod element should have the following attributes:
id- This is the id of the mod that this mod will reference. This should match the mod id in the
Modroot element of that mod’s.modinfofile
- This is the id of the mod that this mod will reference. This should match the mod id in the
title- This is the name of the mod that this mod will reference on. This should match the
Namein thePropertieselement of that mod’s.modinfofile
- This is the name of the mod that this mod will reference on. This should match the
corebase-standardage-antiquityage-explorationage-modern
References
TheReferences element consists of a list of Mod child elements. This mod will have those mod as references. This means those mods will be loaded before this mod.
Each child Mod element should have the following attributes:
id- This is the id of the mod that this mod will depend on. This should match the mod id in the
Modroot element of that mod’s.modinfofile
- This is the id of the mod that this mod will depend on. This should match the mod id in the
title- This is the name of the mod that this mod will depend on. This should match the
Namein thePropertieselement of that mod’s.modinfofile
- This is the name of the mod that this mod will depend on. This should match the
ActionCriteria
TheActionCriteria element consists of Criteria child elements.
Criteria are a set of conditions that need to be met for a mod to execute an ActionGroup (see the ActionGroups section of this document).
Each criteria must have an id property. The id must be unique on a per mod basis. So a single mod should not have multiple criteria with the same id; but it may have an id that matches a criteria in another mod without conflict.
Criteria element must be met for an Action with that criteria to activate. You can add an any="true" property to the criteria and it will instead be met if any of the conditions are met.
There are several types of conditions/criterion you can use:
AlwaysMet
As the name states, this criterion is always met. ActionGroups that you always want active, should be assigned a Criteria with this criterion.
NeverMet
As the name states, this criterion is never met.
AgeInUse
This criterion is met when the game age matches the provided age. This should be one of AGE_ANTIQUITY, AGE_EXPLORATION, AGE_MODERN. Mods may add new Ages that can be used here as well.
AgeWasUsed
This criterion checks whether the provided age was previously played. It does not account for the current age. So if the provided value is AGE_EXPLORATION and you are currently playing in the Exploration Age, the criterion will not be met.
Additionally, Advanced Starts do not count towards this criterion. An Exploration Era Advanced Start will NOT trigger an AgeWasUsed condition set to AGE_ANTIQUITY.
AgeEverInUse
A combination of AgeInUse and AgeWasUsed. Checks whether the provided Age matches either the current Age, or a previously played Age.
ConfigurationValueMatches
Checks if a game configuration parameter matches the provided values. This criterion needs three separate values:
Group, this should match theConfigurationGroupof the desired parameter.ConfigurationId, this should match theConfigurationKeyof the desired parameter.Value, this should match the value you want to check for.
Parameters table in the frontend/shell database for valid configuration values.
For example, a criterion that checks if the game is set to standard speed would look like this.
ConfigurationValueContains
Almost identical to ConfigurationValueMatches, but it instead takes a comma delimited list for the Value field. The criterion is met if the parameter matches any of the provided values
For example, a criterion that checks if the game is set to Governor or Viceroy difficulty would look like this.
MapInUse
Checks whether the current map type matches the provided value. The value provided should be match the File column of the Maps table in the frontend database.
RuleSetInUse
Checks if the given ruleset is in use. By default the only ruleset available is RULESET_STANDARD, but more may be added by mods or DLC. You can reference the Rulesets table in the frontend/shell database for valid rulesets.
GameModeInUse
Checks whether the game mode matches the provided value. The value MUST be one of WorldBuilder, SinglePlayer, HotSeat, or MultiPlayer
LeaderPlayabe
Checks whether provided leader is a valid configuration option (can you set up a game with this leader as a player?)
CivilizationPlayable
Checks whether provided civilization is a valid configuration option (can you set up a game with this civilization as a player?).
This is affected by Game Age, CIVILIZATION_HAN would not be a valid option in an Exploration Age game.
ModInUse
This criterion is met when a mod with an id matching the provided value is active. The meaning of ‘mod’ here is broad. This can be user created mods, or official Firaxis DLC such as shawnee-tecumseh.
it can optionally also take a Version property. In which case it will check to see if the mod version MATCHES EXACTLY before being met. It must be exact. Version 1 will not match version 1.0.