Modifying the Localization Database
Changing the Localization database is a lot like changing the gameplay database. You just use theUpdateText action instead.
Because the Localization database is separate from the gameplay database, we must make a new file to store the changes we want to make.
- Create a folder in the the same place as the
.modinfofile. Name ittext. - Depending on whether you want to use SQL or XML, create a file named
antiquity-text.xmlorantiquity-text.sqlin thedatafolder.
.modinfo file, so the game knows to load this new file. In this instance, since we already have everything set-up from the previous section, we can actually go ahead and edit the ActionGroup we previously made in the .modinfo, adding a new UpdateText block! So whenever the Action Group is triggered and the game goes to load our gameplay changes, it will also load our text changes.
Here’s the excerpt of the modified ActionGroups section in the .modinfo.
Now for the actual database changes. The way text works, is most text entries in the game are assigned a
Tag: we did this for our Policies in the Traditions table, where we gave a Name, and a Description to each new TraditionType.
The game will look up the Tag in the Localization database, and retrieve the text in the appropriate language. In this case American English (en_US).
If working with XML
Here’s the XML we’ll be using to add new text. There is aRow for each new tag we want to add. We set the Tag and Language attributes as needed. Then add a Text child element with the new text we want to assign to the tag.
If working with SQL
And the equivalent in SQL. We define ourTag, Language, and Text as columns, and provide our rows as a set of values surrounded by parentheses in the same order we initially listed the columns.
Note: What are those funny[icon:YIELD_FOOD]things? Those are the inline icons: the yield symbols interspersed in the game’s text! The yield icons are simple, just change fromYIELD_FOODtoYIELD_INFLUENCEorYIELD_SCIENCEfor example. There are other icons if you look around in the game files as well.
Note: LocalizedText? But the game files use EnglishText! Good eye! TheAnd that’s it! That’s our social policy mod done! A completed version of it is be available as a sample mod, with bothEnglishTexttable is a shorthand for adding an entry into theLocalizedTexttable withen_USin theLanguagecolumn. You can use either table if you’re working with English, they’re basically the same, with theEnglishTexttable omitting theLanguage. But you’ll need to usedLocalizedTextwith the appropriate language tag (eg.es_ESorzh_Hans_CN) if you want to provide translations. You do not need a new file to provide translations.
.xml and .sql so you can take a examine how things are done in either language.
Modifying the Icons and Color Databases
Here are examples of Color and Icon database files respectively, both in.xml. You still use both .xml and .sql here though!
Note: Existing player colors can be found inplayerstandardcolors.xmlWhen defining newColors, theColorentries are used for UI controls, whereasColor3Dentries are used for the team color on 3D models in game.
Note: NewUse the.pngfiles for icons will need to be imported via theImportFilesin the.modinfofile. ThePathto the file will befs://game/+ the mod Id + the path to the file in that mod. So in the example above, the mod’s Id would bedenmark, and the.pngfile is in the icons folder of that mod.
UpdateColors and UpdateIcons actions to update Colors and Icons respectively.