[HELP] New to modding and ModBuddy, need help creating and updating a Policy Card.

Planas

Chieftain
Joined
Apr 25, 2017
Messages
22
I wanted to improve ally trade routes, since I couldn't find an easy way just changing values into the .xml games files, I decided to give ModBuddy a try and improve my skills. I built the mod, but when I go into the tab Additional Content instead of Illumination it's the generic name "Example - New Policy", when I join a new game the card is there, the slot is correct, it's obsolete with Arsenal of Democracy, but all the text is LOC_POLICY_ILLUMINATION_NAME, and LOC_POLICY_ILLUMINATION_DESCRIPTION, the same happens on the Civilopedia, nothing happens when I use the card and send a trade route to an ally.

Later on, I would like to improve Arsenal of Democracy to give increased buffs to science and culture for allies trade routes.

Here is the code I created based on the POLICY_ARSENAL_OF_DEMOCRACY:

NewPolicy_Gameplay.xml
Spoiler SPOILER :

<?xml version="1.0" encoding="utf-8"?>
<GameData>
<Types>
<Row Type="POLICY_ILLUMINATION" Kind="KIND_POLICY" />
</Types>

<Policies>
<Row PolicyType="POLICY_ILLUMINATION" Name="LOC_POLICY_ILLUMINATION_NAME" Description="LOC_POLICY_ILLUMINATION_DESCRIPTION" PrereqCivic="CIVIC_HUMANISM" GovernmentSlotType="SLOT_DIPLOMATIC" />
</Policies>

<ObsoletePolicies>
<Row PolicyType="POLICY_ILLUMINATION" ObsoletePolicy="POLICY_ARSENAL_OF_DEMOCRACY" />
</ObsoletePolicies>

<PolicyModifiers>
<Row>
<ModifierId>ILLUMINATION_TRADEROUTESCIENCETOALLY</ModifierId>
<ModifierType>MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_DESTINATION_YIELD_FOR_ALLY_ROUTE</ModifierType>
</Row>
<Row>
<ModifierId>ILLUMINATION_TRADEROUTECULTURETOALLY</ModifierId>
<ModifierType>MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_DESTINATION_YIELD_FOR_ALLY_ROUTE</ModifierType>
</Row>
<Row>
<ModifierId>ILLUMINATION_TRADEROUTESCIENCEFROMALLY</ModifierId>
<ModifierType>MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_ORIGIN_YIELD_FOR_ALLY_ROUTE</ModifierType>
</Row>
<Row>
<ModifierId>ILLUMINATION_TRADEROUTECULTUREFROMALLY</ModifierId>
<ModifierType>MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_ORIGIN_YIELD_FOR_ALLY_ROUTE</ModifierType>
</Row>
</PolicyModifiers>

<Modifiers>
<Row>
<ModifierId>ILLUMINATION_TRADEROUTESCIENCETOALLY</ModifierId>
<ModifierType>MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_DESTINATION_YIELD_FOR_ALLY_ROUTE</ModifierType>
</Row>
<Row>
<ModifierId>ILLUMINATION_TRADEROUTECULTURETOALLY</ModifierId>
<ModifierType>MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_DESTINATION_YIELD_FOR_ALLY_ROUTE</ModifierType>
</Row>
<Row>
<ModifierId>ILLUMINATION_TRADEROUTESCIENCEFROMALLY</ModifierId>
<ModifierType>MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_ORIGIN_YIELD_FOR_ALLY_ROUTE</ModifierType>
</Row>
<Row>
<ModifierId>ILLUMINATION_TRADEROUTECULTUREFROMALLY</ModifierId>
<ModifierType>MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_ORIGIN_YIELD_FOR_ALLY_ROUTE</ModifierType>
</Row>
</Modifiers>

<ModifierArguments>
<Row>
<ModifierId>ILLUMINATION_TRADESCIENCETOALLY</ModifierId>
<Name>YieldType</Name>
<Value>YIELD_SCIENCE</Value>
</Row>
<Row>
<ModifierId>ILLUMINATION_TRADESCIENCETOALLY</ModifierId>
<Name>Amount</Name>
<Value>2</Value>
</Row>
<Row>
<ModifierId>ILLUMINATION_TRADEROUTECULTURETOALLY</ModifierId>
<Name>YieldType</Name>
<Value>YIELD_CULTURE</Value>
</Row>
<Row>
<ModifierId>ILLUMINATION_TRADEROUTECULTURETOALLY</ModifierId>
<Name>Amount</Name>
<Value>2</Value>
</Row>
<Row>
<ModifierId>ILLUMINATION_TRADEROUTESCIENCEFROMALLY</ModifierId>
<Name>YieldType</Name>
<Value>YIELD_SCIENCE</Value>
</Row>
<Row>
<ModifierId>ILLUMINATION_TRADEROUTESCIENCEFROMALLY</ModifierId>
<Name>Amount</Name>
<Value>2</Value>
</Row>
<Row>
<ModifierId>ILLUMINATION_TRADEROUTECULTUREFROMALLY</ModifierId>
<Name>YieldType</Name>
<Value>YIELD_CULTURE</Value>
</Row>
<Row>
<ModifierId>ILLUMINATION_TRADEROUTECULTUREFROMALLY</ModifierId>
<Name>Amount</Name>
<Value>2</Value>
</Row>
</ModifierArguments>
</GameData>


mod.art.xml
Spoiler SPOILER :

<id>
<name text="Illumination"/>
<id text="a0b755a5-b54c-4a21-aa4f-3b964cf0b1a2"/>
</id>


NewPolicy_Icons.xml
Spoiler SPOILER :

<?xml version="1.0" encoding="utf-8"?>
<GameData>
<!-- To be consistent, we're going to define our policy's icon as the standard military slot policy icon.-->
<IconDefinitions>
<Row Name="ICON_POLICY_ILLUMINATION" Atlas="ICON_ATLAS_POLICIES" Index="1"/>
</IconDefinitions>
</GameData>


NewPolicy_Text.xml
Spoiler SPOILER :

<?xml version="1.0" encoding="utf-8"?>
<GameData>
<LocalizedText>
<!-- The name of the policy. -->
<Row Tag="LOC_POLICY_MOD_EXAMPLE_NAME" Language="en_US">
<Text>Example Mod Policy</Text>
</Row>

<!-- The description of the policy. -->
<Row Tag="LOC_POLICY_MOD_EXAMPLE_DESCRIPTION" Language="en_US">
<Text>This is an informative description of the example mod policy.</Text>
</Row>

<!-- Civilopedia information about the policy. -->
<Row Tag="LOC_PEDIA_GOVERNMENTS_PAGE_POLICY_MOD_EXAMPLE_CHAPTER_HISTORY_PARA_1" Language="en_US">
<Text>Paragraph 1 of my policy. Woop woop text and more text.</Text>
</Row>
<Row Tag="LOC_PEDIA_GOVERNMENTS_PAGE_POLICY_MOD_EXAMPLE_CHAPTER_HISTORY_PARA_2" Language="en_US">
<Text>Moar text because I love text. Blah blah text.</Text>
</Row>
</LocalizedText>
</GameData>
 
Last edited:
<PolicyModifiers>
<Row>
<ModifierId>ILLUMINATION_TRADEROUTESCIENCETOALLY</ModifierId>
<ModifierType>MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_DESTINATION_YIELD_FOR_ALLY_ROUTE</ModifierType>
</Row>

this is why your policy does nothing, in PolicyModifiers you should put
PolicyType and ModifierId, not ModifierId and ModifierType ( the modifier type comes into play in <Modifiers>)

as a result, nothing that is written below that point will work

for future reference: check your Database log file (there should be a "Logs" foldere right where your "Mods" folder is) it will point out any errors occuring when writing into the database

for the text, seems like there is something wrong with your NewPolicy_Text.xml ( if so the database log should tell you) or you didnt tell the mod to update the games texts.
check the .modinfo from your mod, i think modbuddy generates them for you? not using modbuddy myself so not quite sure
in your modinfo there should be something like:
<UpdateText id="Text" >
<File>NewPolicy_Text.xmll</File>
</UpdateText>
 
Code:
<LocalizedText>
	<Row Tag="LOC_POLICY_MOD_EXAMPLE_NAME" Language="en_US">
		<Text>Example Mod Policy</Text>
	</Row>
	<Row Tag="LOC_POLICY_MOD_EXAMPLE_DESCRIPTION" Language="en_US">
		<Text>This is an informative description of the example mod policy.</Text>
	</Row>
</LocalizedText>
<Policies>
	<Row PolicyType="POLICY_ILLUMINATION"
		Name="LOC_POLICY_ILLUMINATION_NAME"
		Description="LOC_POLICY_ILLUMINATION_DESCRIPTION"
		PrereqCivic="CIVIC_HUMANISM"
		GovernmentSlotType="SLOT_DIPLOMATIC" />
</Policies>
The game cannot find anything called "LOC_POLICY_ILLUMINATION_NAME" within table <LocalizedText> because you have never defined it. Same is true of "LOC_POLICY_ILLUMINATION_DESCRIPTION".

When you tell the game to use something from table <LocalizedText> but the game cannot find it, it reverts to displaying the original string of text you enter for "Name", "Description", etc.

PSA: you cannot jam these two tables as I am showing in the same file. I am just sticking them both into the same block of code for clarity on the root cause of the text-display errors.
 
Top Bottom