Adding more unit upgrades

Exotherm

Chieftain
Joined
Nov 3, 2014
Messages
6
So I tried to add a sixth tier of unit upgrades to the normal soldier troop. For this I copied elements from "CivBEUnitUpgrades.xml" and "CivBEGameTextInfos_UnitUpgrades.xml"

Now I encountered two main problems. Only one of of the three tier 6 units shows up ( the one for the supremacy path) but the others are not visible. Interestingly, the Affinity level show is correct but it has still the old unit name of the tier 5 unit I copied, though I created a completely new text reference. Also, the free perks dont show up.

Here is my code so far:

Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by Anton Strenger (Firaxis Games) -->
<GameData>
	<Table name="UnitUpgrades">
		<!-- Basic info -->
		<Column name="ID" type="integer" primarykey="true" autoincrement="true"/>
		<Column name="Type" type="text" notnull="true" unique="true"/>
		<Column name="Description" type="text" reference="Language_en_US(Tag)"/>
		<Column name="Help" type="text" default="" reference="Language_en_US(Tag)"/>
		<Column name="DisabledHelp" type="text" default=""/>
		<Column name="Button" type="text"/>
		<Column name="PortraitIndex" type="integer" default="9"/>
		<Column name="IconAtlas" type="text" default="ABILITY_ATLAS" reference="IconTextureAtlases(Atlas)"/>
		<!-- Hotkey info -->
		<Column name="HotKey" type="text"/>
		<Column name="HotKeyAlt" type="text"/>
		<Column name="HotKeyPriority" type="integer" default="0"/>
		<Column name="HotKeyPriorityAlt" type="integer" default="0"/>
		<Column name="OrderPriority" type="integer" default="0"/>
		<Column name="AltDown" type="boolean" default="false"/>
		<Column name="AltDownAlt" type="boolean" default="false"/>
		<Column name="ShiftDown" type="boolean" default="false"/>
		<Column name="ShiftDownAlt" type="boolean" default="false"/>
		<Column name="CtrlDown" type="boolean" default="false"/>
		<Column name="CtrlDownAlt" type="boolean" default="false"/>
		<!-- UnitUpgrades info -->
		<Column name="UnitType" type="text" reference="Units(Type)" default="NULL"/>
		<Column name="UpgradeTier" type="integer" default="0"/>
		<Column name="HarmonyLevel" type="integer" default="0"/>
		<Column name="SupremacyLevel" type="integer" default="0"/>
		<Column name="PurityLevel" type="integer" default="0"/>
		<Column name="AnyAffinityLevel" type="integer" default="0"/>
		<Column name="ExtraProductionCost" type="integer" default="0"/>
		<Column name="FreePerk" type="text" reference="UnitPerks(Type)" default="NULL"/>
		<!-- Pedia specific info -->
		<Column name="PediaType" type="text"/>
		<Column name="PediaEntry" type="text" reference="Language_en_US(Tag)"/>
	</Table>
	<Table name="UnitUpgradePerkChoices">
		<Column name="UpgradeType" type="text" reference="UnitUpgrades(Type)"/>
		<Column name="PerkType" type="text" reference="UnitPerks(Type)"/>
	</Table>
	<UnitUpgrades>
		<!--Earnable Upgrades-->
		<Row>
			
			<Type>UNITUPGRADE_MARINE_4H</Type>
			<Description>TXT_KEY_UNIT_MARINE05H</Description>
			<UnitType>UNIT_MARINE</UnitType>
			<UpgradeTier>4</UpgradeTier>
			<HarmonyLevel>14</HarmonyLevel>
			<ExtraProductionCost>80</ExtraProductionCost>
			<FreePerk>UNITPERK_MARINE_4H</FreePerk>
			<IconAtlas>UNIT_UPGRADE_ATLAS_1</IconAtlas>
			<PortraitIndex>10</PortraitIndex>
		</Row>
		<Row>
			
			<Type>UNITUPGRADE_MARINE_4P</Type>
			<Description>TXT_KEY_UNIT_MARINE05P</Description>
			<UnitType>UNIT_MARINE</UnitType>
			<UpgradeTier>4</UpgradeTier>
			<PurityLevel>14</PurityLevel>
			<ExtraProductionCost>80</ExtraProductionCost>
			<FreePerk>UNITPERK_MARINE_4P</FreePerk>
			<IconAtlas>UNIT_UPGRADE_ATLAS_1</IconAtlas>
			<PortraitIndex>8</PortraitIndex>
		</Row>
		<Row>
			
			<Type>UNITUPGRADE_MARINE_4S</Type>
			<Description>TXT_KEY_UNIT_MARINE05S</Description>
			<UnitType>UNIT_MARINE</UnitType>
			<UpgradeTier>4</UpgradeTier>
			<SupremacyLevel>14</SupremacyLevel>
			<ExtraProductionCost>80</ExtraProductionCost>
			<FreePerk>UNITPERK_MARINE_4S</FreePerk>
			<IconAtlas>UNIT_UPGRADE_ATLAS_1</IconAtlas>
			<PortraitIndex>9</PortraitIndex>
		</Row>
	</UnitUpgrades>
	<UnitUpgradePerkChoices>
		<Row>
			<UpgradeType>UNITUPGRADE_MARINE_4H</UpgradeType>
			<PerkType>UNITPERK_STRONGER_IN_MIASMA_0</PerkType>
		</Row>
		<Row>
			<UpgradeType>UNITUPGRADE_MARINE_4H</UpgradeType>
			<PerkType>UNITPERK_IGNORE_TERRAIN_COST</PerkType>
		</Row>
		<Row>
			<UpgradeType>UNITUPGRADE_MARINE_4P</UpgradeType>
			<PerkType>UNITPERK_EXTRA_MOVE_1</PerkType>
		</Row>
		<Row>
			<UpgradeType>UNITUPGRADE_MARINE_4P</UpgradeType>
			<PerkType>UNITPERK_ALWAYS_HEAL</PerkType>
		</Row>
		<Row>
			<UpgradeType>UNITUPGRADE_MARINE_4S</UpgradeType>
			<PerkType>UNITPERK_HEAL_ADJACENT</PerkType>
		</Row>
		<Row>
			<UpgradeType>UNITUPGRADE_MARINE_4S</UpgradeType>
			<PerkType>UNITPERK_STRONGER_FLANKING_1</PerkType>
		</Row>
	</UnitUpgradePerkChoices>
</GameData>

Code:
<?xml version="1.0" encoding="utf-8"?>
<!--Generated with LocalizationBuddy.-->
<!--Copyright Firaxis Games 2010-->
<!--All Rights Reserved-->
<GameData>
  <Language_en_US>
		  <Row Tag="TXT_KEY_UNIT_MARINE05H">
			  <Text>Juggernaut|Juggernaut|Juggernaut|Juggernaut|Juggernaut</Text>
			  <Gender>masculine</Gender>
			  <Plurality>1</Plurality>
		  </Row>
		  <Row Tag="TXT_KEY_UNIT_MARINE05P">
			  <Text>Gladiator|Gladiator|Gladiator|Gladiator|Gladiator</Text>
			  <Gender>masculine</Gender>
			  <Plurality>1</Plurality>
		  </Row>
	  <Row Tag="TXT_KEY_UNIT_MARINE05S">
		  <Text>Priest|Priest|Priest|Priest|Priest</Text>
		  <Gender>masculine</Gender>
		  <Plurality>1</Plurality>
	  </Row>
  </Language_en_US>
</GameData>

Thanks for reading!;)
 
The game stops reading a file when it hits an error. Check your database.log. If you can't understand it, you can use a SQLite Browser (like SQLite Manager for Firefox) and open:
Code:
C:\Users\%username%\Documents\My Games\Sid Meier's Civilization Beyond Earth\cache\Civ5BEDebugDatabase.db
Look for your changes to the database, comparing with your files. Find the entry after the last one that worked.

I am a little confused that anything worked at all. Normally it fails if you try to add a table that already exists. Either way, delete the entries since they're unnecessary.
 
The game stops reading a file when it hits an error. Check your database.log. If you can't understand it, you can use a SQLite Browser (like SQLite Manager for Firefox) and open:
Code:
C:\Users\%username%\Documents\My Games\Sid Meier's Civilization Beyond Earth\cache\Civ5BEDebugDatabase.db
Look for your changes to the database, comparing with your files. Find the entry after the last one that worked.

I am a little confused that anything worked at all. Normally it fails if you try to add a table that already exists. Either way, delete the entries since they're unnecessary.

Thanks a lot! I believe I am close to find out what is wrong.:D
 
The sqlite manager didnt give any useful information and it is hard to say what the log wants to tell me:
Code:
[7983.850] UNIQUE constraint failed: UnitUpgrades.Type
[7983.850] While executing - 'insert into UnitUpgrades('Type', 'Description', 'UnitType', 'UpgradeTier', 'SupremacyLevel', 'ExtraProductionCost', 'FreePerk', 'IconAtlas', 'PortraitIndex') values (?, ?, ?, ?, ?, ?, ?, ?, ?);'
[7983.850] In XMLSerializer while inserting row into table insert into UnitUpgrades('Type', 'Description', 'UnitType', 'UpgradeTier', 'SupremacyLevel', 'ExtraProductionCost', 'FreePerk', 'IconAtlas', 'PortraitIndex') with  values (UNITUPGRADE_MARINE_4S, TXT_KEY_UNIT_MARINE05S, UNIT_MARINE, 4, 14, 80, UNITPERK_MARINE_4S, UNIT_UPGRADE_ATLAS_1, 9, ).
[7983.850] In XMLSerializer while updating table UnitUpgrades from file XML/NewUnits.xml.
[7983.850] UNIQUE constraint failed: UnitUpgrades.Type
[7984.661]
 
That whole thing just says that UNITUPGRADE_MARINE_4S already exists.

Thanks! Very interesting, because the original file had no entry like this. I bet they prepared upgrades for dlcs/add-ons already.
 
Back
Top Bottom