CIv6 ModInfo Schema

Something I just wasted an hour discovering:

If the optional "id" attribute is used for a component, it must start with a letter and contain no spaces or special characters, as it is sent directly to sqlite to create a save point.
 
Thank you for posting this information. It's been real helpful.
 
A useful thingy I found that's not mentioned in the OP:

Code:
<Properties>
	<AffectsSavedGames>0</AffectsSavedGames>
</Properties>

I added this to all installed mods - of course it's a bad idea to add this to mods that add new units etc., but I don't use any of these, only UI, AI and map generation ones - so it became possible to switch mods on and off on a game in progress without the game complaining.
 
I take a break from this game a bit and now the modinfo structure seems completely different, with ActionCriteria (wth that might be), InGameActions etc.
Is that new schema explained somewhere?
 
It appears that the Summer '17 update broke dependencies. I say "appears", because they were working yesterday and today they're completely ignored. This is the best place I've found for info on the modinfo structure.
 
Yes, Id really like to gear about this too. I have a personal mod that alters the Apadana slightly and I need to how how to do "dependencies" now. Included my modinfo file.

\Skodkim
 

Attachments

It seems to me that the new way of managing dependencies is via ActionCriterias combined with LoadOrder. Using both you can create a mod that works with both vanilla game and Rise & Fall, or any other DLC.

Here is what I use with Finnish language pack:

HTML:
<?xml version="1.0" encoding="utf-8"?>
<Mod id="8ED00BF3-99F6-4360-81BF-709791A90FBF" version="5">
   <Properties>
       <Name>LOC_MOD_TITLE</Name>
       <Teaser>LOC_MOD_TEASER</Teaser>
       <Description>LOC_MOD_DESCRIPTION</Description>
       <Authors>LOC_MOD_AUTHORS</Authors>
       <EnabledByDefault>1</EnabledByDefault>
       <AffectsSavedGames>0</AffectsSavedGames>
   </Properties>
   <!-- enable detection of Rise & Fall expansion by a criteria -->
   <ActionCriteria>
       <Criteria id="Expansion1">
           <GameCoreInUse>Expansion1</GameCoreInUse>
       </Criteria>
   </ActionCriteria>
   <!-- these are loaded before displaying the main menu, but not before the initial "Loading game, please wait" -->
   <FrontEndActions>
       <!-- Vanilla -->
       <UpdateText id="FrontendTextFinnish">
           <Properties>
               <LoadOrder>10</LoadOrder>
           </Properties>
           <!-- <File /> ... -->
       </UpdateText>
       <!-- Rise & Fall -->
       <UpdateText id="Expansion1TextFinnish" criteria="Expansion1">
           <Properties>
               <LoadOrder>20</LoadOrder>
           </Properties>
           <!-- <File /> ... -->
       </UpdateText>
   </FrontEndActions>
   <!-- these are loaded when starting to play a game -->
   <InGameActions>
       <!-- Vanilla -->
       <UpdateText id="TextFinnish">
           <Properties>
               <LoadOrder>10</LoadOrder>
           </Properties>
           <!-- <File /> ... -->
       </UpdateText>
       <!-- Rise & Fall -->
       <UpdateText id="Expansion1TextFinnish" criteria="Expansion1">
           <Properties>
               <LoadOrder>20</LoadOrder>
           </Properties>
           <!-- <File /> ... -->
       </UpdateText>
   </InGameActions>
   <LocalizedText>
       <Text id="LOC_MOD_TITLE">
           <en_US>Civilization VI suomeksi</en_US>
       </Text>
       <Text id="LOC_MOD_TEASER">
           <en_US>Finnish Language Pack</en_US>
       </Text>
       <Text id="LOC_MOD_DESCRIPTION">
           <en_US>This language pack providers the glorious Finnish language to the game.</en_US>
       </Text>
       <Text id="LOC_MOD_AUTHORS">
           <en_US>Vesa Piittinen</en_US>
       </Text>
   </LocalizedText>
   <Files>
       <!-- <File /> ... -->
   </Files>
</Mod>

With LoadOrder I ended up with values 10 and 20: both texts are loaded after all other texts. Using negative LoadOrder can cause game not to begin when a lot of DLCs.

Then, with Expansion1 criteria I can tell to only load Rise & Fall text if there is Rise & Fall available in the game. This works perfectly: the game loads the correct strings in both cases :) For DLCs it is easy enough to clone these criterias; for other mods, well, I don't know: I'm outside the regular modding ring of people so there are probably conventions that I do not know of. Anyway, I think the criteria system is far superior to the old dependencies system since you can actually have conditional loading of files.

Note that Rise & Fall uses a LoadOrder of -100, but it is not related to LocalizationDatabase.

There doesn't seem to be a lot of interest for localizations, but I'll add some additional info below for those who are interested in that.

I had to use FrontEndActions to load new strings for main menu, while InGameActions are executed as soon as you start to load a game. It seems the game reloads localizations in both of these cases so when doing a language pack as a mod you have to do both as well. Also, since a mod does not allow to add an actual new language you have to replace English. This is not possible possibly because LocalizationDatabase tables are locked except for LocalizedText once the game is initialized (before any mods are applied). You can add a new language via Civ 6 user Text directory, but that defeats the purpose of easiness with Steam Workshop as you'd force users to locate a specific directory, add a new directory and download a file there from elsewhere. This sucks.

Final notes: I use EnabledByDefault as I find it just silly if a language pack is not enabled automatically. Also, AffectsSavedGames is a great feature for language packs :)
 
Last edited:
Could be, I didn't double check that one when I added LoadOrder to fix a bug :) I'll update the post (and my mod) once I check it. Partially incorrect LoadOrder didn't happen to break things with the language pack as I'm running just a lot of <Replace /> and not things like <Row />.

Edit!
And that is done, thanks for pointing it out. It actually has no relation to LocalizationDatabase at all, so proper values to use appear to be -10 (to load before any R&F texts) and 10 (to load after R&F texts). I'm not sure if Priority attributes have any meaning between mods/DLCs, and if you can use negative Priority values. Those might be the other way to control localization order. Maybe I end up testing that sometime if I ever throw an attempt to change from <Replace /> to <Row /> (in an attempt to make the language pack work better as both a mod and alternatively as a bunch of files in Text folder, since you can actually add a real new language via user Text folder).

Rise & Fall runs a couple of <Delete />s which is why LoadOrder matters a bit if using <Row /> to add stuff. <Row /> throws if trying to add a duplicate Tag.
 
Last edited:
Has anybody figured out how to get this to work with Rise & Fall?

Code:
    <AddMap id="DWContinents">
      <Properties>
        <Name>Continents - Detailed</Name>
        <Description>Continental maps with a few larger continents and generally two distict areas divided by oceans</Description>
        <Group>StandardMaps</Group>
      </Properties>
      <File>Maps/DWContinents.lua</File>
    </AddMap>

The nice thing about using Addmap in the modinfo is that you don't need to modify the maps.xml file and you can force the map to work without needing the extra XML file. I just can't get it to appear in the Rise & Fall ruleset without going back to the old XML config file method. I've tried everything I could think of for <Group> - StandardMaps matches the xml file name in the base game, changing it to Expansion1_StandardMaps (and many variations of that) doesn't work, nor does using <Domain> instead of <Group>.

Hopefully I'm just missing something simple :)
 
Here are a few guesses since I've only done localization stuff and nothing else:
  • <AddMap /> needs to be in <FrontEndActions /> (although Viking scenario seem to work with the older <Settings /> tag with files within <Items />)
  • <Group /> might be Expansion1Maps (this based on Expansion1_EarthMaps.xml)
  • You may need to copy <ActionCriteria /> to modinfo and have <AddMap criteria="Expansion1" ...> if the map targets Rise & Fall specifically (but this may make the map only work with R&F)
There is probably a trick to make map work with both Vanilla and R&F but maybe try to get something working first before figuring that one out :)
 
I have my mod working, I just had to resort to the "old" way of having the settings xml file so the game would let you select the map, I just saw a new way and wanted to use it :)

I tried all sorts of variations on the "Expansion1Maps" based on what I could find in the other xml and lua files without luck. I am able to control map visibility using the <AddMap> blocks for the standard ruleset and scenarios without any issues, just can't seem to figure out what R&F is expecting.
 
All example of a well formed .modinfo file correctly using all available elements:

Code:
<?xml version="1.0" encoding="utf-8"?>
<Mod id="79a96bee-c555-45b4-ae34-5221c115ef92" version = "1">

<!--Localizable mod property text. Only Name and Description seem to be shown in game-->
<Properties>
<!--Required and displayed in game-->
<Name>LOC_NAME</Name>
<Teaser>LOC_TEASER</Teaser>

<!--Optional, really for Fixaris Use Only
<Trusted>1784197304</Trusted>
<ShowInBrowser>AlwaysHidden</ShowInBrowser>
<DisabledAtStartup>0</DisabledAtStartup>
<EnabledByDefault>0</EnabledByDefault>
-->

<!--Common but not used by game-->
<Stability>LOC_STABILITY</Stability>
<Description>LOC_DESCRIPTION</Description>
<Authors>LOC_AUTHORS</Authors>
<SpecialThanks>LOC_SPECIAL_THANKS</SpecialThanks>
</Properties>

<!--Referenced mods. This mod will load after referenced mods if both are enabled-->
<References>
<Mod id="79a96bee-c555-45b4-ae34-5221c115efa0" title="somemod0" />
</References>

<!--Required mods-->
<Dependencies>
<Mod id="79a96bee-c555-45b4-ae34-5221c115efa2" title="somemod2" />
</Dependencies>

<!--Incompatible mods.-->
<Blocks>
<Mod id="79a96bee-c555-45b4-ae34-5221c115efa4" title="somemod4" />
</Blocks>

<!--List of all files used in the mod-->
<Files>
<File>SomeDatabaseUpdate1.xml</File>
<File>SomeDatabaseUpdate2.sql</File>
<File>SomeSound.wem</File>
<File>SomeIcon.pgn</File>
<File>SomeArtdef.artdef</File>
<File>SomeUI.xml</File>
<File>SomeUI.lua</File>
<File>SomeText.xml</File>
<File>SomeScript.lua</File>
<File>SomeFileOverride1.xml</File>
<File>SomeFileOverride2.lua</File>
<File>SomeConfigDatabaseUpdate1.xml</File>
<File>SomeConfigDatabaseUpdate2.sql</File>
<File>SomeMap.Civ6Map</File>
<File>SomeWorldbuilderFile.xml</File>
</Files>

<!--Objects loaded after the game starts-->
<Components>
<!--Updates to the main game database (DebugGameplay.sqlite)-->
<UpdateDatabase id="Arbitrary_UpdateDatabase">
<Properties>
<RuleSet>RULESET_SOME_RULESET</RuleSet>
<!--No idea what LoadOrder does, it's optional-->
<LoadOrder>100</LoadOrder>
</Properties>
<Items>
<File>SomeDatabaseUpdate1.xml</File>
<File Priority="2">SomeDatabaseUpdate2.sql</File>
</Items>
</UpdateDatabase>

<!--Some Audio thing, Wem files under Base/Platforms/Windows/Audio maybe?-->
<!--No idea how this would work with different platforms-->
<UpdateAudio id="Arbitrary_UpdateAudio">
<Properties>
<RuleSet>RULESET_SOME_RULESET</RuleSet>
</Properties>
<Items>
<File>SomeSound.wem</File>
</Items>
</UpdateAudio>

<!--Files related to Logitech ARX for view game info on mobile devices-->
<UpdateARX id="Arbitrary_UpdateARX">
<Properties>
<RuleSet>RULESET_SOME_RULESET</RuleSet>
</Properties>
<Items>
<File>SomeIcon.pgn</File>
</Items>
</UpdateARX>

<!--.dep file for .artdef files. The .artdef files themselves aren't included
in .modinfo at all, only in the mod's directory -->
<ModArt id="Arbitrary_UpdateModArt">
<Properties>
<RuleSet>RULESET_SOME_RULESET</RuleSet>
</Properties>
<Items>
<File>SomeArtdef.artdef</File>
</Items>
</ModArt>

<!--New UI files-->
<UserInterface id="Arbitrary_UserInterface">
<Properties>
<RuleSet>RULESET_SOME_RULESET</RuleSet>
<Context>InGame</Context>
</Properties>
<Items>
<File>SomeUI.xml</File>
<!--SomeUI.lua is implied-->
</Items>
</UserInterface>

<!--Localized Text-->
<LocalizedText id="Arbitrary_LocalizedText">
<Properties>
<RuleSet>RULESET_SOME_RULESET</RuleSet>
</Properties>
<Items>
<File>SomeText.xml</File>
</Items>
</LocalizedText>

<!--Scripts to run when the mod starts or reloads-->
<GameplayScripts id="Arbitrary_GameplayScripts">
<Properties>
<RuleSet>RULESET_SOME_RULESET</RuleSet>
</Properties>
<Items>
<File>SomeScript.lua</File>
</Items>
</GameplayScripts>

<!--Overrides of files under the main Assets folder-->
<ImportFiles id="Arbitrary_ImportFiles">
<Properties>
<RuleSet>RULESET_SOME_RULESET</RuleSet>
</Properties>
<Items>
<File>SomeFileOverride1.xml</File>
<File>SomeFileOverride2.lua</File>
</Items>
</ImportFiles>

<!--Adds icons-->
<Icons id="Arbitrary_Icons">
<Properties>
<RuleSet>RULESET_SOME_RULESET</RuleSet>
</Properties>
<Items>
<File>SomeIcons.xml</File>
</Items>
</Icons>

</Components>

<!--Objects loaded on game set up-->
<Settings>
<!--Updates to Configuration database (DebugConfiguration.sqlite)-->
<Custom id="Arbitrary_Custom">
<Items>
<!--Some peopler are putting <Component> tags here,-->
<!--But they're not even read into the Mods.sqlite database.-->
<File>SomeConfigDatabaseUpdate1.xml</File>
<File>SomeConfigDatabaseUpdate2.sql</File>
</Items>
</Custom>

<!--Custom map-->
<Map id="Arbitrary_Custom_Map">
<Properties>
<Group>Some_Map_Group</Group>
<Name>LOC_MAP_NAME1</Name>
<Description>LOC_MAP_DESCRIPTION1</Description>
</Properties>
<Items>
<File>SomeMap.Civ6Map</File>
</Items>
</Map>

<!-- Localized Text for configuration screens -->
<LocalizedText id="Arbitrary_LocalizedText2">
<Items>
<File>ConfigTextFile.xml</File>
</Items>
</LocalizedText>

<!--No real idea-->
<WorldBuilder id="Arbitrary_WorldBuilder">
<Items>
<File>SomeWorldbuilderFile.xml</File>
</Items>
</WorldBuilder>

<!--Adds icons needed during game set up-->
<Icons id="Arbitrary_Icons2">
<Items>
<File>SomeIcons.xml</File>
</Items>
</Icons>

<!--.dep file for .artdef files needed during game setup.
The .artdef files themselves aren't included
in .modinfo at all, only in the mod's directory -->
<ModArt id="Arbitrary_UpdateModArt2">
<Items>
<File>SomeArtdef.artdef</File>
</Items>
</ModArt>
</Settings>

<!--Localized text for values used in .modinfo itself-->
<!--Seems limited to Mod/Properties and Mod/Settings/Map/Properties-->
<LocalizedText>
<Text id="LOC_NAME">
<en_US>Mod Name</en_US>
</Text>
<Text id="LOC_STABILITY">
<en_US>Beta, etc.</en_US>
</Text>
<Text id="LOC_TEASER">
<en_US>Description Shown In Game</en_US>
</Text>
<Text id="LOC_DESCRIPTION">
<en_US>Full Description (Not Shown Anywhere)</en_US>
</Text>
<Text id="LOC_AUTHORS">
<en_US>Authors</en_US>
</Text>
<Text id="LOC_SPECIAL_THANKS">
<en_US>All the little people</en_US>
</Text>
<Text id="LOC_MAP_NAME1">
<en_US>Custom Map Name</en_US>
</Text>
<Text id="LOC_MAP_DESCRIPTION1">
<en_US>Custom Map Description</en_US>
</Text>
</LocalizedText>
</Mod>

Your example is great, but it lacks FrontEndActions. My problem is that I have found no way to include FrontEnd-XMLs and UI-context Lua-scripts in one modinfo file.

Edit: Ok, sorry! The solution is simply using <FrontEndActions> outside of <Components>. So your modinfo file can look something like this:
Spoiler :

Code:
<?xml version="1.0" encoding="utf-8"?>
<Mod id="4b05c20e-b4ef-4080-92a2-c7973a7d5000" version="1">
  <Properties>
    <Name>Tiras [COLOR_FLOAT_CULTURE]Test[ENDCOLOR] Script</Name>
    <Description>For test purposes only!!!</Description>
    <Teaser>For test purposes only!!!</Teaser>
    <Authors>Tiramisu</Authors>
  </Properties>
    <Settings />
    <FrontEndActions>
    <UpdateDatabase id="ModdedMapSettings">
       <Properties>
            <LoadOrder>100</LoadOrder>
       </Properties>
       <Items>
            <File>MapSizes.sql</File>
       </Items>  
    </UpdateDatabase>
  </FrontEndActions>
    <Components>            
        <AddGameplayScripts id="TirasTestScript">
          <File>TirasTestScript.lua</File>  
          <File>TirasEnhancedAStar.lua</File>  
        </AddGameplayScripts>
        <ImportFiles id="Import">
          <File>TutorialScenarioBase.lua</File>
        </ImportFiles>
        <UserInterface id="TirasUIFunctions">
          <Properties>
            <Context>InGame</Context>
          </Properties>
          <Items>
            <File>TirasUIFunctions.xml</File>
          </Items>
        </UserInterface>
    </Components>
  <Files>
    <File>TirasTestScript.lua</File>
    <File>TirasEnhancedAStar.lua</File>
    <File>TutorialScenarioBase.lua</File>
    <File>TirasUIFunctions.xml</File>
    <File>TirasUIFunctions.lua</File>
    <File>MapSizes.sql</File>
  </Files>
</Mod>

The only problem you get is when you are trying to use <Components> and <InGameActions> environments in the same modinfo file. In this case the files in the <InGameActions> environment would be not loaded correctly and you would get the
Code:
ERROR: Attempted to evaluate a path for a mod that doesn't actually contain that path.
error.
 
Last edited:
Here is an XSD that can be used to validate .modinfo files

Hey, thanks for the XSD. It helped me a lot, though it's incomplete. E.g. this is a valid modinfo (the mod works 100%) and in contains some elements that are missing in the schema you posted:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<Mod id="049dde02-909b-4ca5-a835-f305b79cf6ab" version="1">
  <Properties>
    <Name>Player Start Gold Boost</Name>
    <Description>A simple mod that boost the gold of the player. This mod is created in order to give the player an advantage over the AI when using my other mod "Better Gold Start". Should work with any save game so be careful when loading it on your current save game. automatically at the start/load, your money will change to the given amount. (Can be edited to your preference)</Description>
    <Teaser>A simple mod that boost the gold of the player.</Teaser>
    <Authors>Fairace</Authors>
    <EnabledByDefault>1</EnabledByDefault>
    <EnabledAtStartup>1</EnabledAtStartup>
    <CompatibleVersions>1.2,2.0</CompatibleVersions>
  </Properties>
  <References>
    <Mod id="c8a9f4b8-6083-4213-be5d-eb414ff0f438" title="Better Per-Era Gold Start" />
  </References>
  <InGameActions>
    <AddGameplayScripts id="NewAction">
      <File priority="1">PlayerGoldBoost.lua</File>
    </AddGameplayScripts>
  </InGameActions>
  <Files>
    <File>PlayerGoldBoost.lua</File>
  </Files>
</Mod>

Did you create that schema yourslef or is there an authoritative/official file I can get @PlotinusRedux?
 
Did you create that schema yourslef or is there an authoritative/official file I can get @PlotinusRedux?

The official way is use Modbuddy build which will generate the .modinfo file for you so that there is no need to directly edit it.
 
The official way is use Modbuddy build which will generate the .modinfo file for you so that there is no need to directly edit it.
I might be blind but I just created an empty mod with recent modbuddy and I can't find an option to generate modinfo. Care to explain where to find such an option?

EDIT 27.2.21: Aah nevermind. I figured out that when you build solution with modbuddy it'll deploy the mod with .modinfo file to Documents/My Games/ Civ 6/ Mods folder. Very poorly documented for newcomers though :(
 
Last edited:
Back
Top Bottom