[SOLVED] Localization & Icons not working

niklas153021

Chieftain
Joined
May 23, 2016
Messages
37
Location
Germany
Hi!

I'm currently making a mod as a test on how to add city states.

After the winter patch, I looked into some of the Viking DLC files where CS are added and tried to add my own by copying some of the code by basicly changing names and adding custom icons.

However, the city states appear in game but the localizations and icons are not loaded. They show up with either a quesstion mark or some vanilla city state icon and their names only show up in a LOC_CIVILIZATION_SOME_CS_NAME format.

I checked the logs and neither Database.txt nor Modding.txt show any errors, I doble-checked the names of every LOC_-variable and checked my .modinfo file if it was loading the correct file names.

I hope you can help me in some way, as I really can't see what could have gone wrong anymore...

Thanks in advance

Niklas
 

Attachments

Two things to consider, whithout having looked at your actual code:
1) When loading a game except for the very first time after starting the game from the desktop, the localizations will not load.
2) Localization for mods doesn't work at all in Hotseat. This last one took me a whole day to figure out...
 
Code:
		<LocalizedText id="NCSLocalization">
			<Properties>
				<Ruleset>RULESET_STANDARD</Ruleset>
			</Properties>
			<Items>
				<File>Data/Europe_CitySatesText.xml</File>
			</Items>
		</LocalizedText>
No such file name in your mod. You forgot a 't' in CitySates in order to match the actual file name as what you have in the listing of the mod's files.
Code:
	<Files>
		<File>Data/Europe_CityStates.xml</File>
		<File>Data/Europe_CityStatesText.xml</File>
Except perhaps in the modding.log you don't get error messages for un-found files. And missing localization text tags does not cause the game to generate an invalid reference, it just treats the "LOC_TAG_SOMETHING" as the literal text to display when it cannot find it in the <LocalizedText>.

This is essentially the same behavior as you would get in civ5.
 
Code:
        <LocalizedText id="NCSLocalization">
            <Properties>
                <Ruleset>RULESET_STANDARD</Ruleset>
            </Properties>
            <Items>
                <File>Data/Europe_CitySatesText.xml</File>
            </Items>
        </LocalizedText>
No such file name in your mod. You forgot a 't' in CitySates in order to match the actual file name as what you have in the listing of the mod's files.
Code:
    <Files>
        <File>Data/Europe_CityStates.xml</File>
        <File>Data/Europe_CityStatesText.xml</File>
Except perhaps in the modding.log you don't get error messages for un-found files. And missing localization text tags does not cause the game to generate an invalid reference, it just treats the "LOC_TAG_SOMETHING" as the literal text to display when it cannot find it in the <LocalizedText>.

This is essentially the same behavior as you would get in civ5.

Thanks! As you suggested, fixing the typo fixed the text issues.
However, the icons still do not load, now they all show up as question marks. Is there a special compression you have to use? I used BC2/DTX3 like I was used to from CiV, but neither that nor no compression fixed my problem
 
I'm in the exact same boat as you with the City State icons. Did you figure any solution out?
 
No, unfortunately not. My guess is that it is currently not possible for us to add icons to city states as everyone adding city states has to spare out icons. I think we should go with the ? texture for now, but it is really a shame that there is no way to add icons.
 
niklas153021 below is the code necessary to add CS icons:

Modinfo
Code:
    <Components>
        <UpdateIcons id="ICONS">
            <File>Data/New_Icons.xml</File>
        </UpdateIcons>
        <ImportFiles id="DDS">
            <File>Textures/New_Icons.dds</File>
        </ImportFiles>
    </Components>

    <Files>
        <File>Data/New_Icons.xml</File>
        <File>Textures/New_icons.dds</File>
    </Files>

Obviously the xml is in a folder called data and the new dds is in a folder called textures.

New_Icons.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<GameInfo>
    <IconTextureAtlases>
        <Row Name="ICON_ATLAS_NEW_CIVILIZATIONS" IconSize="256" IconsPerRow="4" IconsPerColumn="4" Filename="New_Icons.dds"/>
    </IconTextureAtlases>
    <IconDefinitions>
        <Row Name="ICON_CIVILIZATION_AAA"         Atlas="ICON_ATLAS_NEW_CIVILIZATIONS" Index="0"/>
        <Row Name="ICON_CIVILIZATION_BBB"         Atlas="ICON_ATLAS_NEW_CIVILIZATIONS" Index="1"/>
        <Row Name="ICON_CIVILIZATION_CCC"        Atlas="ICON_ATLAS_NEW_CIVILIZATIONS" Index="2"/>
    <IconDefinitions>
</GameInfo>

So far I am getting by with the 256 size showing up everywhere and the game auto resizing. I will eventually add the smaller size atlases.
The game automatically associates ICON_ with the CIVILIZATION_XXX after it.
 
The Auto-assertion of "ICON_" with "CIVILIZATION_LETTUCE_SANDWICHES" into "ICON_CIVILIZATION_LETTUCE_SANDWICHES" for icon specification is also true with Units, Buildings, etc. So, "BUILDING_TANNNERY" would need a designation of "ICON_BUILDING_TANNNERY" in order for the game to properly make the linkage.

If all else fails, take a look at JanBoruta's BCI (Better Civ Icons) Mod because I believe he is adding or at least altering a city-state icon in there to a new one.
 
Last edited:
If all else fails, take a look at JanBoruta's BCI (Better Civ Icons) Mod because I believe he is adding or at least altering a city-state icon in there to a new one.

Oh boy did I try retrofitting BCI. But it seems he included A LOT of things that may have been unnecessary: the blps, xlp, dep, artdef etc, that I didn't end up needing. Perhaps that was necessary for civ icons, not just CS icons. The next issue I am having is modding the FontIcons.xml... I can mod the base file and get my fonticons to show up but I haven't successfully updated fonticons through a mod.
 
T H A N K Y O U !
Seriously, thank you so much. I've been having trouble with the icons for literal months, but after reading your reply and proofreading my modinfo like 15 times and noticing a typo in all of my file names, correcting that and realising what an idiot I am this helped me getting my icons to work in a bit less than 40 minutes.
 
Oh boy did I try retrofitting BCI. But it seems he included A LOT of things that may have been unnecessary: the blps, xlp, dep, artdef etc, that I didn't end up needing. Perhaps that was necessary for civ icons, not just CS icons. The next issue I am having is modding the FontIcons.xml... I can mod the base file and get my fonticons to show up but I haven't successfully updated fonticons through a mod.

Have you made any progress with the FontIcons? I'm having the same issue. I can update the DDS, add it to a BLP and load that, but then need to edit the base FontIcons.xml to get them to come up.

Editing the base DDS is not good because (a) there's not much space, and (b) someone else's mod could overwrite your changes.

So far I have had no luck with using a different DDS or loading the XML through a mod. Also, I tried making the DDS bigger and that really screwed things up.
 
Have you made any progress with the FontIcons? I'm having the same issue. I can update the DDS, add it to a BLP and load that, but then need to edit the base FontIcons.xml to get them to come up.

Editing the base DDS is not good because (a) there's not much space, and (b) someone else's mod could overwrite your changes.

So far I have had no luck with using a different DDS or loading the XML through a mod. Also, I tried making the DDS bigger and that really screwed things up.

I saw in this week's patch notes that they added support for ImportFiles in the frontend, so I haven't tried updating FontIcons.xml on the frontend since the update. But I've tried updating it with updateuserinterface/text/icons/art ImportFiles update database everything. It seems like it's not possible yet.

However I would like to know how to update a base dds through a mod, that would be extremely helpful.
 
For the FontIcons, once I updated the actual image I saved it as a TGA. Then through the Asset Editor I created a new Texture (Class Name = UserInterface), and set the Source File Path to the TGA ... then lots of messages to sync my pantry. Whatever that means.

So I created a folder in the SDK install folder and copied my TGA into that ... and then tried again. Success! New texture and a DDS. Oh, make sure it's called the same as what the game already uses - 'FontIcons.dds' for the file, and 'FontIcons' for the Name in the texture. Hope that makes sense.

Then, and still in Asset Editor, I created 2 new XLPs (both XLPs Class = UITexture) and added my newly created texture using the 'Add Existing' button on the 'Entries' tab. Now comes the bit that took me ages to figure out ... the 'Package Name' needs to be set to the same value as used by the default game files. In the case of FontIcons this needs be 'UI/Icons' in one XLP and 'UI/UI_Icons' in the other. I have no idea why there needs to be 2 files.

When you save your XLPs you can give them any name you want, just make sure they're in the 'XLPs' folder.

In ModBuddy there's no need to include the XLPs or the textures (DDS/TEX) in your project inside of ModBuddy.

Now in your Mod.Art.xml, under the <gameLibraries> element, find the 'UITextures' element and under that in <relativePackagePaths> add:

Code:
<Element text="UI/Icons.blp"/>
<Element text="UI/UI_Icons.blp"/>

This should be the 'Package Name'.blp ... don't worry that they don't exist, ModBuddy will create them for you when you build your project.

Finally, in the 'properties' of the project I added an in-game action 'UpdateArt' and added the '(Mod Art Dependency File)' that is auto-generated at build time.

Build, manually edit FontIcons.xml, and there they are in game.

Hopefully that all makes sense!

I'm going to guess you can do the same for other images, but in most 'ICON' cases there's no need as they use 'atlases' defined in the XML. So you can use completely different and unique DDS/TEX files. If only FontIcons worked this way too.....
 
I guess my first step should be to get asset editor to actually work... I don't know how to open it lol. I do all my modding in notepad++.

Btw I'm wanting to update the dds for city state type icons and envoy bonus icons for new city state types. I'll have to look into getting asset editor to open.
 
I started off in notepad++ but recently switched to ModBuddy from the SK, now I find everything so much easier. That being said the Asset Editor is a pain, and seriously confusing. You need to have both the 'Development Tools' and the 'Development Assets' to get it to work properly.

Once you have a project open in ModBuddy you can just use the Tools > Launch Asset Editor menu item and it should open - eventually (once it's done some config stuff). The biggest problem I had with it is 'sync your pantry' errors. To get round them:
  1. All my new images (TGAs) get copied into a folder in the 'Development Assets' install directory (e.g. Sid Meier's Civilization VI SDK Assets > MyStuff)
  2. If I need to update a DDS/TEX that I previously created I delete it first and then recreate it
 
Back
Top Bottom