I need help to locate something in the game

Shiroifushicho

Chieftain
Joined
Mar 3, 2013
Messages
72
Im working into a nice whole rebuild of the japanese samurai. Can't wait for releasing it and people to embrace it ! : D

Everything is working fine so far ... But there is a last thing not right and im perfectionist. I will try to explain :

When your unit have a promotion, you click on the promotion icon, the promotion tree pop up, you follow me ?
Then just in front of each description, there is an icon. This icon art depends on what is the specific "family" of the promotion belong to. (Im not talking about the little gold flags, but the more detailed icon that have sword, shield, hearts, arrows, etc that pop only while tree is displayed)



Since i changed promotions in my mod, the old ones are kinda mistaking the user now, and i would like to choose some more appropriate ones in the same pool.

Q1 : Where can i find these art icons ? i can't find this art pool T .T

Q2 : Where is the code that assign a single promotion to its tree icon ? Because i looked in Sid Meier's Civilization VI\Base\Assets\UI\Icons\Icons_Promotions.xml and it appears to be it ... but there is not everything ... proof is there is not the one for warrior monks promotions.

For exemple, im taking a random line of this file's code :

<Row Name="ICON_PROMOTION_INCENDIARIES" Atlas="ICON_ATLAS_PROMOTIONS" Index="2"/>

That seem to allocate the silversword icon to the "incendiaries" promotion.

Q3 : Where does this variable (ICON_PROMOTION_INCENDIARIES) come from ? i never saw it elsewhere ... That frustrate me hard time ! There got to be somewhere this variable is attached to the specific incendiaries promotion ... but where ? certainly not in UnitPromotions.xml ...

Thanks for your help ! You won't regret the time invested in me !
 
Last edited:
Q1 : you need to download the civ vi development assets via steam. When you downloaded them, then you should find the icons, if I am right in the folder „textures“.

Q2 : warrior monks are not included in the base game, if I am right, then they was included in the Khmer and Indonesia DLC. So go to the folder of this dlc and search for the xml there

When you open a icon texture, then you will notice that there are many icons in this one texture. So for such a texture file ( Icon Atlas ) Index 0 is the first icon you see on the left and at the top of the icon texture file. Index 1 is the second icon from the left, at the top and index 2 is the third icon from the left, at the top. ( at least if I remember correct )
So you count from the left to the right for the first icons, then if there are for example six icons at the top, then index 8 would be the first on the left, and the second from the top.

I hope this helps a bit.
 
Last edited:
Thank you Lasttry, at least you confirmed me things i was doubting on and help me solve the Q1 !

I have now a good idea of what icons to use in these "ICON_ATLAS_PROMOTIONS" & i also knows the index i need to type for each of my promotions.

My biggest struggle that remain is how, in the game code, how do i place a specific icon for a specific promotions. I have a huge migraine because i manualy looked for this all afternoon in the game files ...

<Row Name="ICON_PROMOTION_ALPINE" Atlas="ICON_ATLAS_PROMOTIONS" Index="15"/>
<Row Name="ICON_PROMOTION_SENTRY" Atlas="ICON_ATLAS_PROMOTIONS" Index="18"/>
<Row Name="ICON_PROMOTION_GUERRILLA" Atlas="ICON_ATLAS_PROMOTIONS" Index="22"/>
<Row Name="ICON_PROMOTION_SPYGLASS" Atlas="ICON_ATLAS_PROMOTIONS" Index="17"/>
<Row Name="ICON_PROMOTION_AMBUSH" Atlas="ICON_ATLAS_PROMOTIONS" Index="5"/>
<Row Name="ICON_PROMOTION_CAMOUFLAGE" Atlas="ICON_ATLAS_PROMOTIONS" Index="26"/>
<Row Name="ICON_PROMOTION_BATTLECRY" Atlas="ICON_ATLAS_PROMOTIONS" Index="11"/>

This is an idea of what's inside this Icons_Promotions.xml. I now totally get how it works here. But since my promotions are new, i can't create a Name="ICON_PROMOTION_MY_CUTOM_ONE" and expect it to work just like this since i can't find a link between these variables and each actual promotion anywhere in the other game file, i don't know if you guys get what im trying to say ...
 
FOUND IT !!!!! If anyone wanna knows : D that's a great discovery for those who wanted to make full custom promotions. 2h30 seeking + a migraine.

These lines in UnitPromotionPopup.lua (Base\Assets\UI\Popups\) gave me the final hint

promotionInstance.PromotionSelection:SetOffsetVal((row.Column-1)*SIZE_NODE_X + SIZE_BORDER_X, (row.Level-1)*SIZE_NODE_Y + SIZE_BORDER_Y);
if (promotionDefinition ~= nil) then
promotionInstance.PromotionName:SetText(Locale.ToUpper(promotionDefinition.Name));
promotionInstance.PromotionDescription:SetText(Locale.Lookup(promotionDefinition.Description));
local iconName = "ICON_" .. promotionDefinition.UnitPromotionType;
local textureOffsetX, textureOffsetY, textureSheet = IconManager:FindIconAtlas(iconName,32);
if (textureOffsetX ~= nil) then
promotionInstance.PromotionIcon:SetTexture( textureOffsetX, textureOffsetY, textureSheet );
end
end

local iconName = "ICON_" .. promotionDefinition.UnitPromotionType;
local iconName = "ICON_" .. promotionDefinition.UnitPromotionType;
local iconName = "ICON_" .. promotionDefinition.UnitPromotionType;

that little ***** ! it means if you want a specific icon for your custom promotion, you have to make up a Name which start with ICON_ and then should only be the type you declared in UnitPromotions.xml. Exemple = ICON_PROMOTION_SAMURAI_CUSTOM1.
And put that full name in Icons_Promotions.xml

and that will be : <Row Name="ICON_PROMOTION_SAMURAI_CUSTOM1" Atlas="ICON_ATLAS_PROMOTIONS" Index="#"/>

where # is the index of the icon you want.

mystery solved ! No need to help me anymore. My mod is incoming soon i hope ...
 
Yes. The game automatically assumes "ICON_" in front of all Promotion Names, Building Names, Unit Names, etc., and assumes that table <IconDefinitions> is showing the Name column with "ICON_" added in front of the name of the Item so that if you define a promotion as PROMOTION_CHEESEBURGER you must define your icon reference in table <IconDefinitions> as
Code:
Name="ICON_PROMOTION_CHEESEBURGER"
The same will be true for a building, for example, so even though I defined two buildings as BUILDING_UNBUILDABLE_LRS_A and BUILDING_UNBUILDABLE_LRS_B in table <Buildings>, I must present my icon references in table <IconDefinitions> like this:
Code:
<GameData>
	<IconDefinitions>
		<Row Name="ICON_BUILDING_UNBUILDABLE_LRS_A" Atlas="ICON_ATLAS_BUILDINGS" Index="0"/>
		<Row Name="ICON_BUILDING_UNBUILDABLE_LRS_B" Atlas="ICON_ATLAS_BUILDINGS" Index="0"/>
	</IconDefinitions>
</GameData>
This is not really documented anywhere except various different "help" threads from when Civ6 first was released and we were all figuring out what the game requires.
 
thanks you for these precisions Lee S !
I coded everything but my mod still doesn't work ... i have the 3045188730 error : / it's another subject i guess. Im looking for a solution but it's vague even while looking at my logs' errors...
 
The numbers at the beginning of an error message line are time-stamps. They are not error codes. You must look at what the line(s) say in database.log after the [1234567.891]. With errors that are coming from an SQL file you need to compare the time-stamp in Database.log to the nearest timestamp in Modding.log to determine which file(s) likely contain the error.
 
Last edited:
Oh thank you~ I was looking for this ... i looked just in modding.log so far so that wasn't much useful. That Database.log seems better help.
So... it seems there are some nails in my code : /

Here is the last one.

[3623674.310] [Localization]: StartupErrorMessages.xml
[3623674.311] [Localization]: Input XML does not contain database entry tags. GameData, GameInfo or Database
[3623678.680] [Localization]: Validating Foreign Key Constraints...
[3623678.681] [Localization]: Passed Validation.
[3623678.694] [Configuration]: Validating Foreign Key Constraints...
[3623678.695] [Configuration]: Passed Validation.
[3623690.409] [FullTextSearch]: Initializing FullTextSearch
[3623691.031] [Gameplay]: Validating Foreign Key Constraints...
[3623691.046] [Gameplay]: Passed Validation.
[3623691.849] [Configuration]: Validating Foreign Key Constraints...
[3623691.850] [Configuration]: Passed Validation.
[3623694.593] [FullTextSearch]: FTS - Creating Context
[3623705.365] [Configuration]: Validating Foreign Key Constraints...
[3623705.366] [Configuration]: Passed Validation.
[3623706.934] [Gameplay] ERROR: UNIQUE constraint failed: ModifierArguments.ModifierId, ModifierArguments.Name
[3623706.934] [Gameplay] ERROR: UNIQUE constraint failed: ModifierArguments.ModifierId, ModifierArguments.Name
[3623708.754] [Gameplay]: Validating Foreign Key Constraints...
[3623708.773] [Gameplay]: Passed Validation.
[3623712.345] [FullTextSearch]: FTS - Creating Context
[3623712.745] [FullTextSearch]: FTS - Creating Context
[3623713.634] [FullTextSearch]: FTS - Creating Context

Does it look bad or ?

And yes that's my fisrt proper mod for civ6. Always loved to tweak it manually ... i often get my idea to work with editing game's xml files ... but doing some proper sql mod files seems lot harder.
 
It appears you are repeating a ModifierID & Name combination that the game already has in table ModifierArguments in at least one of your SQL files. You cannot repeat anything the game already has in the base files, in the DLC, or in any other mod. This is not a civ6 thing, it is an SQL thing. That is what these error messages are pointing to
Code:
[3623706.934] [Gameplay] ERROR: UNIQUE constraint failed: ModifierArguments.ModifierId, ModifierArguments.Name
 [3623706.934] [Gameplay] ERROR: UNIQUE constraint failed: ModifierArguments.ModifierId, ModifierArguments.Name
Once the game encounters a violation anywhere within a file (whether XML or SQL) of the Uniqueness requirements for a given game-table, the game ceases to read anything further from that file, with a result that the game's database has incomplete information for the stuff you were trying to load into the game from your SQL file(s) or XML file(s) -- with any number of undesirable consequences so far as creating a successful mod is concerned.

-------------------------------------

I cannot for example add a second civilization defined as CIVILIZATION_AMERICA because the game's database already has one of those. I cannot do this whether I directly edit the game's original files, or whether I do it from code within a mod. I get a UNIQUE constraint failed error and a failure of the relevant file to load completely whichever way I try to do it (from a mod or by edting the original game files).

I can however add a civilization called CIVILIZATION_AMERICA2 because there is no such thing already defined by Firaxis, though if two mod-makers tried to add a civilization called CIVILIZATION_AMERICA2 the second mod to load into the game would fail because it would then be violating the Uniqueness Requirements.
 
Last edited:
Okay what you just said makes sense ... i think i've found the line...
Annnnnnnnnd it's working ... Thanks to you !

Finally Yeay ! My first Civ6 mod ! im so happy : D

Thank you again LeeS, you helped me hard time. I spent the whole yesterday to try to find what was wrong ... i think i couldn't solve it alone without your last answer. I passed by that line like 20 times not knowing it was off ...
That was an already existing value i altered for warrior monks and i used an "INSERT TO" instead of a UPDATE just like you said ... i didn't know that. I will definitly bring you in special thanks.

Guess now i just have to upload my mod on steam workshop !

I enjoyed so much creating a whole new promotion tree ... the ones in the game sometimes sucks and it's a shame because training your fav unit can make you feel a touch of RPG game if the tree is worth it.
I wish i was better at modding civ6 got many other ideas ... but i need to improve.

till next time (i hope im fine now), take care !
 
One trick mighty JFD taught me years ago was to never call something BUILDING_WINDFARM in one of my mods when I am adding something new to the game. Call it BUILDING_LRS_WINDFARM. The LRS part is my initials, and this goes a long way to avoiding the uniqueness error issues. For example on the Civ5 Steam Workshop there were like 15 different mods all adding a building called BUILDING_WINDFARM.
 
Top Bottom