[Vanilla] Localization won't work

Lukasdb

Chieftain
Joined
Feb 13, 2021
Messages
25
Hello, can someone take a look at my localization mod. It just won't work no matter what i try, both for en_US or pl_PL.

<GameData>
<LocalizedText>
<Replace Language="en_US" Tag="LOC_TRAIT_LEADER_DIVINE_WIND_DESCRIPTION">
<TEXT>test</TEXT>
</Replace>
</LocalizedText>
</GameData>

Modinfo is configured as well
 

Attachments

  • Przechwytywanie.PNG
    Przechwytywanie.PNG
    40.3 KB · Views: 31
1st, if you are running Gathering Storm the LOC-KEY needed is LOC_TRAIT_LEADER_DIVINE_WIND_EXPANSION2_DESCRIPTION
2nd, you have no LoadOrder setting on your UpdateText Action.

Code:
    <UpdateText id="Localization">
      <Properties>
        <LoadOrder>300</LoadOrder>
      </Properties>
      <File>Localization.xml</File>
    </UpdateText>
and
Code:
<GameData>
	<LocalizedText>
		<Replace Language="pl_PL" Tag="LOC_TRAIT_LEADER_DIVINE_WIND_DESCRIPTION">
			<Text>test</Text>
		</Replace>
		<Replace Language="en_US" Tag="LOC_TRAIT_LEADER_DIVINE_WIND_DESCRIPTION">
			<Text>Test that Devine Wind is being re-described</Text>
		</Replace>

		<Replace Language="en_US" Tag="LOC_TRAIT_LEADER_DIVINE_WIND_EXPANSION2_DESCRIPTION">
			<Text>Test that Devine Wind is being re-described</Text>
		</Replace>
	</LocalizedText>
</GameData>
This is also incorrect
Code:
	<RequirementSetRequirements>
		<Row>
			<RequirementSetId>UNIT_POLISH_HUSSAR_JAPAN_REQUIREMENTS</RequirementSetId>
			<RequirementId>REQUIRES_PLAYER_HAS_CIVIC_MERCENARIES</RequirementId>
			<RequirementId>REQUIRES_PLAYER_HAS_DISTRICT_LAVRA</RequirementId>
		</Row>
	</RequirementSetRequirements>
You need one row for each RequirementId that is being attached to the Set of Requirements
Code:
	<RequirementSetRequirements>
		<Row>
			<RequirementSetId>UNIT_POLISH_HUSSAR_JAPAN_REQUIREMENTS</RequirementSetId>
			<RequirementId>REQUIRES_PLAYER_HAS_CIVIC_MERCENARIES</RequirementId>
		</Row>
		<Row>
			<RequirementSetId>UNIT_POLISH_HUSSAR_JAPAN_REQUIREMENTS</RequirementSetId>
			<RequirementId>REQUIRES_PLAYER_HAS_DISTRICT_LAVRA</RequirementId>
		</Row>
	</RequirementSetRequirements>
You can never under any circumstances state the same column-name more than once within the same row, regardless of what table you are using.
 
Last edited:
This seems to make sense so far as it goes
Code:
	<Modifiers>
		<Row>
			<ModifierId>BORROW_UNIT_POLISH_HUSSAR_JAPAN</ModifierId>
			<ModifierType>MODIFIER_PLAYER_ADJUST_VALID_UNIT_BUILD</ModifierType>
			<OwnerRequirementSetId>UNIT_POLISH_HUSSAR_JAPAN_REQUIREMENTS</OwnerRequirementSetId>
		</Row>
	</Modifiers>
	<ModifierArguments>
		<Row>
			<ModifierId>BORROW_UNIT_POLISH_HUSSAR_JAPAN</ModifierId>
			<Name>UnitType</Name>
			<Value>UNIT_POLISH_HUSSAR_JAPAN</Value>
		</Row>
But this bit after that makes no real sense to me as to what it is you are trying to accomplish
Code:
		<Row>
			<ModifierId>TRAIT_GAINS_FOUNDER_BELIEF_MAJORITY_RELIGION</ModifierId>
			<Name>ModifierId</Name>
			<Value>UNIT_POLISH_HUSSAR_JAPAN</Value>
		</Row>
	</ModifierArguments>
	<DynamicModifiers>
		<Row>
			<ModifierType>MODIFIER_PLAYER_GAINS_FOUNDER_BELIEF_MAJORITY_RELIGION</ModifierType>
			<CollectionType>COLLECTION_OWNER</CollectionType>
			<EffectType>EFFECT_ATTACH_MODIFIER</EffectType>
		</Row>
	</DynamicModifiers>
Esp since TRAIT_GAINS_FOUNDER_BELIEF_MAJORITY_RELIGION already exists within the game as a defined ModifierId. And UNIT_POLISH_HUSSAR_JAPAN is defined in your code as a UnitType rather than as a ModifierId.
 
Ok, text it fixed and working, never crossed my mind, that there was an update in description after an update.

At this point am not sure what to do with this religion UU. What I was trying to do was to create a dynamic modifier(MODIFIER_PLAYER_GAINS_FOUNDER_BELIEF_MAJORITY_RELIGION, but with attach modifier effect), that attaches a modifier when conditions are met. the modifier was meant to be a loose trait, that is not attached to any civ.

P.S. i don't know why that loadorder keeps dissapearing... I added it again.
 
Regarding localization:

It works mostly, just for some reason menu will not update description. I guess the items in menu refer to some other location but i couldn't find the file responsible for menu .

Loading and in-game fine, both english and polish:
upload_2021-2-17_16-50-15.png


Leader selection bonked. Polish description is original and unique buildings are different:
upload_2021-2-17_16-55-37.png


Loading menu in english picks spanish(not sure) to describe the building for some reason...

I feel like am 2 steps away from being done haha

Code:
<?xml version="1.0" encoding="utf-8"?>
<GameData>
    <LocalizedText>
        <Replace Language="en_US" Tag="LOC_TRAIT_LEADER_DIVINE_WIND_DESCRIPTION">
            <Text>May not build Encampment, gain Great Prophets, or found Religions. Gains all Beliefs of any Religion that has established itself in a majority of his cities. May purchase naval units with [ICON_FAITH] Faith.</Text>
        </Replace>
        <Replace Language="pl_PL" Tag="LOC_TRAIT_LEADER_DIVINE_WIND_DESCRIPTION">
            <Text>Nie może budować dzielnic wojskowych, zyskiwać wielkich proroków i zakładać religii. Otrzymuje wszystkie wierzenia dowolnej religii, która stała się dominująca w państwach tego przywódcy. Pozwala kupować jednostki morskie za [ICON_FAITH] wiarę. </Text>
        </Replace>
        <Replace Language="en_US" Tag="LOC_TRAIT_LEADER_DIVINE_WIND_EXPANSION2_DESCRIPTION">
            <Text>May not build Encampment, gain Great Prophets, or found Religions. Gains all Beliefs of any Religion that has established itself in a majority of his cities. May purchase naval units with [ICON_FAITH] Faith.</Text>
        </Replace>
        <Replace Language="pl_PL" Tag="LOC_TRAIT_LEADER_DIVINE_WIND_EXPANSION2_DESCRIPTION">
            <Text>Nie może budować dzielnic wojskowych, zyskiwać wielkich proroków i zakładać religii. Otrzymuje wszystkie wierzenia dowolnej religii, która stała się dominująca w państwach tego przywódcy. Pozwala kupować jednostki morskie za [ICON_FAITH] wiarę. </Text>
        </Replace>
        <Replace Language="en_US" Tag="LOC_TRAIT_LEADER_DIVINE_WIND_NAME">
            <Text>Religious Usurper </Text>
        </Replace>
        <Replace Language="pl_PL" Tag="LOC_TRAIT_LEADER_DIVINE_WIND_NAME">
            <Text>Religijny Uzurpator </Text>
        </Replace>
        <Replace Language="en_US" Tag="LOC_DISTRICT_LAVRA_DESCRIPTION">
            <Text>A district unique to Japan. Replaces Holy Site district, and is cheaper to build. Provides +1 [ICON_PRODUCTION] Production for each adjacent recource. Provides +2 [ICON_GreatPerson] Great General points. Can build walls but is not able attack.</Text>
        </Replace>
        <Replace Language="pl_PL" Tag="LOC_DISTRICT_LAVRA_DESCRIPTION">
            <Text>Unikalna dzielnica Japonii o charakterze religijnym. Zastępuje dzielnicę świątynną, a jej wzniesienie jest tańsze. Zapewnia +1 [ICON_PRODUCTION] Produkcji za każde sąsiadujące pole z zasobem. Zapewnia +2 punkty [ICON_GreatPerson] Wielkiego Generała. Może wybudować mury, lecz nie jest w stanie atakować.</Text>
        </Replace>
        <Replace Language="en_US" Tag="LOC_TRAIT_CIVILIZATION_DISTRICT_LAVRA_NAME">
            <Text>Japanese unique district: Jinja</Text>
        </Replace>
        <Replace Language="pl_PL" Tag="LOC_TRAIT_CIVILIZATION_DISTRICT_LAVRA_NAME">
            <Text>Unikalna dzielnica japońska: Jinja</Text>
        </Replace>
        <Replace Language="en_US" Tag="LOC_DISTRICT_LAVRA_NAME">
            <Text>Jinja</Text>
        </Replace>
        <Replace Language="pl_PL" Tag="LOC_DISTRICT_LAVRA_NAME">
            <Text>Jinja|jinji|jinji|jinję|jinją|jinji|jinja|jinji|jinji|jinję|jinją|jinji</Text>
            <Gender>feminine</Gender>
            <Plurality>1</Plurality>
        </Replace>
        <Replace Language="en_US" Tag="LOC_TRAIT_CIVILIZATION_BUILDING_STAVE_CHURCH_NAME">
            <Text>Japanese unique building: Dojo</Text>
        </Replace>
        <Replace Language="pl_PL" Tag="LOC_TRAIT_CIVILIZATION_BUILDING_STAVE_CHURCH_NAME">
            <Text>Unikalny budynek Japonii: Dojo</Text>
        </Replace>
        <Replace Language="en_US" Tag="LOC_BUILDING_STAVE_CHURCH_DESCRIPTION">
            <Text>A building unique to Japan. Provides additional +4 [ICON_PRODUCTION] Production.</Text>
        </Replace>
        <Replace Language="pl_PL" Tag="LOC_BUILDING_STAVE_CHURCH_DESCRIPTION">
            <Text>Unikalny budynek Japonii. Zapewnia dodatkowe +4 [ICON_PRODUCTION] Produkcji.</Text>
        </Replace>
        <Replace Language="en_US" Tag="LOC_BUILDING_STAVE_CHURCH_NAME">
            <Text>Dojo</Text>
        </Replace>
        <Replace Language="pl_PL" Tag="LOC_BUILDING_STAVE_CHURCH_NAME">
            <Text>Dojo</Text>
        </Replace>
    </LocalizedText>
</GameData>
 
In order to get anything to change in the Leader/Civilization selection screens you need to make UpdateDatabase and UpdateText actions in FrontEndActions as well as those in InGameActions.

What items are listed and shown on the leader selection screen is entirely dependant upon what is in FrontEndActions Database table PlayerItems. The text that is shown requires the matching Localization Tags added in the FrontEnd as UpdateText actions.

Here in a FrontEnd UpdateDatabase action I am adding two new buildings to Rome/Trajan
Code:
<GameInfo>
	<PlayerItems>
		<Row Domain="Players:StandardPlayers" CivilizationType="CIVILIZATION_ROME" LeaderType="LEADER_TRAJAN" Type="BUILDING_ROMAN_FORUM" Icon="ICON_BUILDING_ROMAN_FORUM" Name="LOC_ITEM_ROMAN_FORUM_NAME" Description="LOC_ITEM_ROMAN_FORUM_DESCRIPTION" SortIndex="30" />
		<Row Domain="Players:StandardPlayers" CivilizationType="CIVILIZATION_ROME" LeaderType="LEADER_TRAJAN" Type="BUILDING_ROMAN_THERMAE" Icon="ICON_BUILDING_ROMAN_THERMAE" Name="LOC_ITEM_ROMAN_THERMAE_NAME" Description="LOC_ITEM_ROMAN_THERMAE_DESCRIPTION" SortIndex="40" />

		<Row Domain="Players:Expansion2_Players" CivilizationType="CIVILIZATION_ROME" LeaderType="LEADER_TRAJAN" Type="BUILDING_ROMAN_FORUM" Icon="ICON_BUILDING_ROMAN_FORUM" Name="LOC_ITEM_ROMAN_FORUM_NAME" Description="LOC_ITEM_ROMAN_FORUM_DESCRIPTION" SortIndex="30" />
		<Row Domain="Players:Expansion2_Players" CivilizationType="CIVILIZATION_ROME" LeaderType="LEADER_TRAJAN" Type="BUILDING_ROMAN_THERMAE" Icon="ICON_BUILDING_ROMAN_THERMAE" Name="LOC_ITEM_ROMAN_THERMAE_NAME" Description="LOC_ITEM_ROMAN_THERMAE_DESCRIPTION" SortIndex="40" />

		<Row Domain="Players:Expansion1_Players" CivilizationType="CIVILIZATION_ROME" LeaderType="LEADER_TRAJAN" Type="BUILDING_ROMAN_FORUM" Icon="ICON_BUILDING_ROMAN_FORUM" Name="LOC_ITEM_ROMAN_FORUM_NAME" Description="LOC_ITEM_ROMAN_FORUM_DESCRIPTION" SortIndex="30" />
		<Row Domain="Players:Expansion1_Players" CivilizationType="CIVILIZATION_ROME" LeaderType="LEADER_TRAJAN" Type="BUILDING_ROMAN_THERMAE" Icon="ICON_BUILDING_ROMAN_THERMAE" Name="LOC_ITEM_ROMAN_THERMAE_NAME" Description="LOC_ITEM_ROMAN_THERMAE_DESCRIPTION" SortIndex="40" />
	</PlayerItems>
</GameInfo>
Note that I need to repeat the basic info for all three expansions as a different "Domain" value.

In a FrontEnd UpdateText action I have this
Code:
<GameData>
	<LocalizedText>
		<Row Tag="LOC_ITEM_ROMAN_FORUM_NAME" Language="en_US">
			<Text>Forum</Text>
		</Row>
		<Row Tag="LOC_ITEM_ROMAN_FORUM_DESCRIPTION" Language="en_US">
			<Text>Unique Building to Rome replacing the Town Square: Provides +2 [ICON_Housing] Housing, +2 [ICON_Amenities] Amenity, +1 [ICON_Culture] Culture, [ICON_Production] Production, [ICON_Gold] Gold, [ICON_Science] Science, and [ICON_Food] Food to the city.</Text>
		</Row>
		<Row Tag="LOC_ITEM_ROMAN_THERMAE_NAME" Language="en_US">
			<Text>Thermae</Text>
		</Row>
		<Row Tag="LOC_ITEM_ROMAN_THERMAE_DESCRIPTION" Language="en_US">
			<Text>Unique Building to Rome replacing the Bathhouse: Provides +3 [ICON_Amenities] Amenity, +1 [ICON_Culture] Culture and +2 [ICON_Food] Food to the city.</Text>
		</Row>
	</LocalizedText>
</GameData>
FrontEnd UpdateIcons
Code:
<GameData>
	<IconDefinitions>
		<Replace Name="ICON_BUILDING_ROMAN_FORUM" Atlas="ICON_ATLAS_BUILDINGS" Index="11"/>
		<Replace Name="ICON_BUILDING_ROMAN_THERMAE" Atlas="ICON_ATLAS_BUILDINGS" Index="30"/>
	</IconDefinitions>
</GameData>
I am re-using existing building icons so I do not have to define the Atlas in table IconTextureAtlases -- I can just refer to the existing Atlas and the Icons within it.

Both of these buildings are Unique versions of new buildings I added to the game in my personal mods.
 
Ok, am getting to work then. What about that dynamic modifier, that adds permament trait? Do you think that would be possible?
 
I think I'm getting somewhere. This is what I created so far.

Code:
<?xml version="1.0" encoding="utf-8"?>
<GameInfo>
    <Modifiers>
        <Row>
            <ModifierType>MODIFIER_PLAYER_ATTACH_MODIFIER</ModifierType>
            <CollectionType>COLLECTION_OWNER</CollectionType>
            <EffectType>EFFECT_ATTACH_MODIFIER</EffectType>
        </Row>
    </Modifiers>
</GameInfo>

And

Code:
<GameInfo>
    <Modifiers>
            <ModifierId>MODIFIERID_PLAYER_ATTACH_UNIT_POLISH_HUSSAR</ModifierId>
            <SubjectRequirementSetId>REQUIREMENT_PLAYER_HAS_CIVILIZATION_OR_LEADER_TRAIT</SubjectRequirementSetId>
            <ModifierType>MODIFIER_PLAYER_ATTACH_UNIT_POLISH_HUSSAR</ModifierType>
    </Modifiers>
    <ModifierArguments>
        <Row>
            <ModifierId>MODIFIERID_PLAYER_ATTACH_UNIT_POLISH_HUSSAR</ModifierId>
            <Name>TraitType</Name>
            <Value>TRAIT_CIVILIZATION_UNIT_POLISH_HUSSAR_BORROW</Value>
        </Row>
    </ModifierArguments>
    <DynamicModifiers>
        <Row>
            <ModifierType>MODIFIER_PLAYER_ATTACH_UNIT_POLISH_HUSSAR</ModifierType>
            <CollectionType>COLLECTION_OWNER</CollectionType>
            <EffectType>EFFECT_ADJUST_PLAYER_VALID_UNIT_BUILD</EffectType>
        </Row>
    </DynamicModifiers>
</GameInfo>

I'm thinking of using the REQUIREMENT_PLAYER_FOUNDED_OUR_RELIGION, that you provided earlier. What I will try to accomplish, is to create 2 modifiers, 1 loose, that is not assigned to any nation. The second one will attach that modifier to Japan once it meets requirements=player founded our religion+dojo built(custom building).

i will keep you posted on progress!
 
Ok, I think I made a modifier, that if Poland becomes dominant religion it attaches another modifier called TRAIT_CIVILIZATION_UNIT_POLISH_HUSSAR_BORROW.
Correct me if I made a mistake somewhere

Code:
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<GameInfo>
    <Modifiers>
        <Row>
            <ModifierType>MODIFIER_PLAYER_ATTACH_MODIFIER</ModifierType>
            <SubjectRequirementSetId>POLAND_IS_RELIGION_MAJORITY</SubjectRequirementSetId>
            <ModifierType>MODIFIER_PLAYER_ATTACH_MODIFIER</ModifierType>
        </Row>
    </Modifiers>
    <ModifierArguments>
        <Row>
            <ModifierType>MODIFIER_PLAYER_ATTACH_MODIFIER</ModifierType>
            <CollectionType>COLLECTION_OWNER</CollectionType>
            <EffectType>EFFECT_ATTACH_MODIFIER</EffectType>
        </Row>
    </ModifierArguments>
    <DynamicModifiers>
        <Row>
            <ModifierId>MODIFIERID_PLAYER_ATTACH_UNIT_POLISH_HUSSAR</ModifierId>
            <Name>ModifierType</Name>
            <Value>MODIFIER_PLAYER_ATTACH_UNIT_POLISH_HUSSAR</Value>
        </Row>
    </DynamicModifiers>
    <RequirementSets>
        <Row>
            <RequirementSetId>POLAND_IS_RELIGION_MAJORITY</RequirementSetId>
            <RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType>
        </Row>
    </RequirementSets>
    <RequirementSetRequirements>
        <Row>
            <RequirementSetId>POLAND_IS_RELIGION_MAJORITY</RequirementSetId>
            <RequirementId>REQUIRES_POLAND_IS_RELIGION_MAJORITY</RequirementId>
        </Row>
    </RequirementSetRequirements>
    <Requirements>
        <Row>
            <RequirementId>REQUIRES_POLAND_IS_RELIGION_MAJORITY</RequirementId>
            <RequirementType>REQUIREMENT_PLAYER_FOUNDED_OUR_RELIGION</RequirementType>
        </Row>
    </Requirements>
    <RequirementArguments>
        <Row>
            <RequirementId>REQUIRES_POLAND_IS_RELIGION_MAJORITY</RequirementId>
            <Name>CivilizationType</Name>
            <Value>1</Value>
        </Row>
    </RequirementArguments>
</GameInfo>
 
Last edited:
Ok, i tried to make a sensible code. It makes sense to me, but either I made a mistake somewhere or the requirements/modifiers do not provide what it seems.

For the life of me I don't know how to associate religion with a Leader or civilization. I'm attaching a zip file with other attempts to approach this from different position.

Code:
<?xml version="1.0" encoding="utf-8"?>
<GameInfo>
    <Types>
        <Row Kind="KIND_MODIFIER" Type="MODIFIER_PLAYER_ATTACH_UNIT_POLISH_HUSSAR"/>
    </Types>
    <Modifiers>
        <Row>
            <ModifierId>MODIFIER_ID_PLAYER_ATTACH_UNIT_POLISH_HUSSAR</ModifierId>
            <OwnerRequirementSetId>REQUIREMENT_SET_POLISH_HUSSAR_JAPAN</OwnerRequirementSetId>
            <ModifierType>MODIFIER_PLAYER_ATTACH_UNIT_POLISH_HUSSAR</ModifierType>
        </Row>
    </Modifiers>
    <ModifierArguments>
        <Row>
            <ModifierId>MODIFIER_ID_PLAYER_ATTACH_UNIT_POLISH_HUSSAR</ModifierId>
            <Name>UnitType</Name>
            <Value>UNIT_POLISH_HUSSAR</Value>
        </Row>
    </ModifierArguments>
    <DynamicModifiers>
        <Row>
            <ModifierType>MODIFIER_PLAYER_ATTACH_UNIT_POLISH_HUSSAR</ModifierType>
            <CollectionType>COLLECTION_OWNER</CollectionType>
            <EffectType>EFFECT_ADJUST_PLAYER_VALID_UNIT_BUILD</EffectType>
        </Row>
    </DynamicModifiers>
    <RequirementSets>
        <Row>
            <RequirementSetId>REQUIREMENT_SET_POLISH_HUSSAR_JAPAN</RequirementSetId>
            <RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType>
        </Row>
    </RequirementSets>
    <RequirementSetRequirements>
        <Row>
            <RequirementSetId>REQUIREMENT_SET_POLISH_HUSSAR_JAPAN</RequirementSetId>
            <RequirementId>REQUIRES_IS_SAME_RELIGION</RequirementId>
        </Row>
        <Row>
            <RequirementSetId>REQUIREMENT_SET_POLISH_HUSSAR_JAPAN</RequirementSetId>
            <RequirementId>REQUIRES_IS_JAPAN</RequirementId>
        </Row>
    </RequirementSetRequirements>
    <Requirements>
        <Row>
            <RequirementId>REQUIRES_IS_SAME_RELIGION</RequirementId>
            <RequirementType>REQUIREMENT_PLAYER_FOUNDED_OUR_RELIGION</RequirementType>
        </Row>
        <Row>
            <RequirementId>REQUIRES_IS_JAPAN</RequirementId>
            <RequirementType>REQUIREMENT_PLAYER_TYPE_MATCHES</RequirementType>
        </Row>
    </Requirements>
    <RequirementArguments>
        <Row>
            <RequirementId>REQUIRES_IS_JAPAN</RequirementId>
            <Name>LeaderType</Name>
            <Value>LEADER_HOJO</Value>
        </Row>
    </RequirementArguments>
</GameInfo>
 

Attachments

  • Changes gameplay.zip
    7.3 KB · Views: 22
Top Bottom