Hi,
I'm a crazy noob modder who wanted to try to add a new government as a unique ability of a custom civ and it didn't end as well as I hoped. I havn't done anything about the civ yet, I'm first trying to get the government to work.
Things looked promissing as I managed to add it, see it in the tree, pick it, put cards in it and have the name, description and civilopedia entry for it, but I'm still running into issues.
First, the modifiers I put do not apply. I feel like I copied the code of the game correclty but picking the government doesn't give its effects. I tried something simple for testing: +1 faith to the Ancestral Hall.
I don't get any error in Database.org.
Here is the code :
Second, there's a column in the government table that is completely obscure to me. When checking the government table into the gameplay schema file (01_GameplaySchema.sql) I see the column "BonusType" which I can't ignore since it requires something not null without default value. When I look further, it says that it's referencing the GovernmentBonusNames table and rows for this table are added in the Governments.xml file from the core game with this mention "Keep the values in this table coordinated with GovernmentBonusType enums in code". Does this mean this is something hard coded and I'm done? Because they're directly used for 'value' in ModifierArguments as if they were defined somewhere else but I don't see it anywhere.
Also some bonuses are defined using this (the old accumulating bonuses) but others are defined using "normal" government modifiers. Plus the tier4 govs which were defined after accumulating bonuses were changed (in R&F) do not seem use those BonusType and have "GOVERNMENTBONUS_OVERALL_PRODUCTION" defined for it (which is why I put that for mine too).
I'm really lost about this.
Here are text and modinfo in case it's needed :
Text:
Modinfo:
I'm a crazy noob modder who wanted to try to add a new government as a unique ability of a custom civ and it didn't end as well as I hoped. I havn't done anything about the civ yet, I'm first trying to get the government to work.
Things looked promissing as I managed to add it, see it in the tree, pick it, put cards in it and have the name, description and civilopedia entry for it, but I'm still running into issues.
First, the modifiers I put do not apply. I feel like I copied the code of the game correclty but picking the government doesn't give its effects. I tried something simple for testing: +1 faith to the Ancestral Hall.
I don't get any error in Database.org.
Here is the code :
Code:
<GameData>
<Types>
<Row Type="GOVERNMENT_CONSTITUTIONAL_MONARCHY" Kind="KIND_GOVERNMENT" />
</Types>
<Governments>
<Row GovernmentType="GOVERNMENT_CONSTITUTIONAL_MONARCHY"
Name="LOC_GOVERNMENT_CONSTITUTIONAL_MONARCHY_NAME"
InherentBonusDesc="LOC_GOVT_INHERENT_BONUS_CONSTITUTIONAL_MONARCHY"
BonusType="GOVERNMENTBONUS_OVERALL_PRODUCTION"
AccumulatedBonusShortDesc="LOC_GOVT_ACCUMULATED_BONUS_BRIEF_CONSTITUTIONAL_MONARCHY"
AccumulatedBonusDesc="LOC_GOVT_ACCUMULATED_BONUS_CONSTITUTIONAL_MONARCHY"
PrereqCivic="CIVIC_URBANIZATION"
OtherGovernmentIntolerance="0"
InfluencePointsPerTurn="3"
InfluencePointsThreshold="90"
InfluenceTokensPerThreshold="3"
Tier="Tier3" />
</Governments>
<Governments_XP2>
<Row GovernmentType="GOVERNMENT_CONSTITUTIONAL_MONARCHY" Favor="3"/>
</Governments_XP2>
<Government_SlotCounts>
<Row GovernmentType="GOVERNMENT_CONSTITUTIONAL_MONARCHY" GovernmentSlotType="SLOT_MILITARY" NumSlots="1"/>
<Row GovernmentType="GOVERNMENT_CONSTITUTIONAL_MONARCHY" GovernmentSlotType="SLOT_ECONOMIC" NumSlots="1"/>
<Row GovernmentType="GOVERNMENT_CONSTITUTIONAL_MONARCHY" GovernmentSlotType="SLOT_DIPLOMATIC" NumSlots="2"/>
<Row GovernmentType="GOVERNMENT_CONSTITUTIONAL_MONARCHY" GovernmentSlotType="SLOT_WILDCARD" NumSlots="4"/>
</Government_SlotCounts>
<GovernmentModifiers>
<Row GovernmentType="GOVERNMENT_CONSTITUTIONAL_MONARCHY" ModifierId="CONSTITUTIONAL_MONARCHY_FAITH_ANCESTRAL_HALL" />
</GovernmentModifiers>
<Modifiers>
<Row ModifierId="CONSTITUTIONAL_MONARCHY_FAITH_ANCESTRAL_HALL" ModifierType="MODIFIER_BUILDING_YIELD_CHANGE" />
</Modifiers>
<ModifierArguments>
<Row ModifierId="CONSTITUTIONAL_MONARCHY_FAITH_ANCESTRAL_HALL" Name="YieldType" Value="YIELD_FAITH" />
<Row ModifierId="CONSTITUTIONAL_MONARCHY_FAITH_ANCESTRAL_HALL" Name="BuildingType" Value="BUILDING_GOV_WIDE" />
<Row ModifierId="CONSTITUTIONAL_MONARCHY_FAITH_ANCESTRAL_HALL" Name="Amount" Value="1" />
</ModifierArguments>
</GameData>
Second, there's a column in the government table that is completely obscure to me. When checking the government table into the gameplay schema file (01_GameplaySchema.sql) I see the column "BonusType" which I can't ignore since it requires something not null without default value. When I look further, it says that it's referencing the GovernmentBonusNames table and rows for this table are added in the Governments.xml file from the core game with this mention "Keep the values in this table coordinated with GovernmentBonusType enums in code". Does this mean this is something hard coded and I'm done? Because they're directly used for 'value' in ModifierArguments as if they were defined somewhere else but I don't see it anywhere.
Also some bonuses are defined using this (the old accumulating bonuses) but others are defined using "normal" government modifiers. Plus the tier4 govs which were defined after accumulating bonuses were changed (in R&F) do not seem use those BonusType and have "GOVERNMENTBONUS_OVERALL_PRODUCTION" defined for it (which is why I put that for mine too).
I'm really lost about this.
Here are text and modinfo in case it's needed :
Spoiler Text and Modinfo :
Text:
Code:
<GameData>
<LocalizedText>
<Row Tag="LOC_GOVERNMENT_CONSTITUTIONAL_MONARCHY_NAME" Language="en_US"
Text="Constitutional Monarchy" />
<Row Tag="LOC_GOVT_INHERENT_BONUS_CONSTITUTIONAL_MONARCHY" Language="en_US"
Text="+1 [ICON_Faith] from buildings of the Government Plaza, the Theater Square, the Entertainement Complex and the Water Park in cities following your religion." />
<Row Tag="LOC_GOVT_ACCUMULATED_BONUS_BRIEF_CONSTITUTIONAL_MONARCHY" Language="en_US"
Text="+1% [ICON_Gold] per citizen following your religion in your cities." />
<Row Tag="LOC_GOVT_ACCUMULATED_BONUS_CONSTITUTIONAL_MONARCHY" Language="en_US"
Text="+1% [ICON_Gold] per citizen following your religion in cities following your religion." />
</LocalizedText>
</GameData>
Code:
<?xml version="1.0" encoding="utf-8"?>
<Mod id="96ade946-ed6c-4328-8d58-70b430013e17" version="1">
<Properties>
<Name>Belgium Test</Name>
<Description>Trying to create new civilization and leader: Belgium led by Leopold II.</Description>
<Created>1572888105</Created>
<Teaser>Trying to create new civilization and leader: Belgium led by Leopold II.</Teaser>
<Authors>Sev GUTRON</Authors>
<CompatibleVersions>1.2,2.0</CompatibleVersions>
</Properties>
<Dependencies>
<Mod id="4873eb62-8ccc-4574-b784-dda455e74e68" title="Expansion: Gathering Storm" />
</Dependencies>
<InGameActions>
<UpdateDatabase id="Gov">
<File>Constitutional_Monarchy.xml</File>
</UpdateDatabase>
<UpdateText id="NewAction">
<File>Constitutional_Monarchy_Text.xml</File>
</UpdateText>
</InGameActions>
<Files>
<File>Belgium_Belgians.xml</File>
<File>Belgium_Config.xml</File>
<File>Belgium_ConfigText.xml</File>
<File>Belgium_Icons.xml</File>
<File>Belgium_Leopold_II.xml</File>
<File>Belgium_Text.xml</File>
<File>Constitutional_Monarchy.xml</File>
<File>Constitutional_Monarchy_Text.xml</File>
<File>NewLeader_LitterBox.xml</File>
<File>ZZZ.xml</File>
</Files>
</Mod>