New Unique Units won't showup

Joined
Mar 23, 2006
Messages
928
Location
Adelaide, Australia
Alright, so I'm modding the civs to be more to my personal ideas on how they should be. Anyway, so far I've got afew extra UB's that are atleast showing up in the civilpedia (although some of the extra bonuses they have over the regular buildings are not showing up, yet to test that out as a game based or civilpedia based issue). The new UU's aren't even showing up at all in the civilpedia (or anywhere for that matter), so yea I figure something is wrong. Also, the Mongols seem to not have any UU's (not even the Keshik which I haven't touched)...


Spoiler :
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 9/15/2011 4:34:15 PM -->
<GameData>
<!-- TODO: Insert table creation example here. -->

<!-- TODO: Insert table data example here.-->

<!-- Enter your Game Data here. -->
<Units>
<Row>
<Class>UNITCLASS_FIGHTER</Class>
<Type>UNIT_LUFT</Type>
<PrereqTech>TECH_FLIGHT</PrereqTech>
<RangedCombat>40</RangedCombat>
<Cost>375</Cost>
<Moves>2</Moves>
<Immobile>true</Immobile>
<Range>8</Range>
<Special>SPECIALUNIT_FIGHTER</Special>
<CombatClass>UNITCOMBAT_FIGHTER</CombatClass>
<Domain>DOMAIN_AIR</Domain>
<DefaultUnitAI>UNITAI_DEFENSE_AIR</DefaultUnitAI>
<Description>Luftwaff</Description>
<Civilopedia>Luftwaff</Civilopedia>
<Strategy>Luftwaff</Strategy>
<Help>Luftwaff</Help>
<MilitarySupport>true</MilitarySupport>
<MilitaryProduction>true</MilitaryProduction>
<IgnoreBuildingDefense>true</IgnoreBuildingDefense>
<Mechanized>true</Mechanized>
<AdvancedStartCost>50</AdvancedStartCost>
<AirUnitCap>1</AirUnitCap>
<RangedCombatLimit>100</RangedCombatLimit>
<CombatLimit>0</CombatLimit>
<XPValueAttack>3</XPValueAttack>
<XPValueDefense>2</XPValueDefense>
<UnitArtInfo>ART_DEF_UNIT_FIGHTER</UnitArtInfo>
<UnitFlagIconOffset>62</UnitFlagIconOffset>
<IconAtlas>UNIT_ATLAS_2</IconAtlas>
<PortraitIndex>17</PortraitIndex>
<MoveRate>AIR_REBASE</MoveRate>
</Row>
<Row>
<Class>UNITCLASS_HORSEMAN</Class>
<Type>UNIT_WAR_ELEPHANT</Type>
<PrereqTech>TECH_HORSEBACK_RIDING</PrereqTech>
<Combat>12</Combat>
<Cost>75</Cost>
<Moves>2</Moves>
<HurryCostModifier>20</HurryCostModifier>
<CombatClass>UNITCOMBAT_MOUNTED</CombatClass>
<Domain>DOMAIN_LAND</Domain>
<DefaultUnitAI>UNITAI_FAST_ATTACK</DefaultUnitAI>
<Description>Indian War Elephant</Description>
<Civilopedia>Indian War Elephant</Civilopedia>
<Strategy>Indian War Elephant</Strategy>
<Help>Indian War Elephant</Help>
<MilitarySupport>true</MilitarySupport>
<MilitaryProduction>true</MilitaryProduction>
<Pillage>true</Pillage>
<ObsoleteTech>TECH_METALLURGY</ObsoleteTech>
<GoodyHutUpgradeUnitClass>UNITCLASS_KNIGHT</GoodyHutUpgradeUnitClass>
<AdvancedStartCost>20</AdvancedStartCost>
<XPValueAttack>3</XPValueAttack>
<XPValueDefense>3</XPValueDefense>
<UnitArtInfo>ART_DEF_UNIT_HORSEMAN</UnitArtInfo>
<UnitFlagIconOffset>17</UnitFlagIconOffset>
<IconAtlas>UNIT_ATLAS_1</IconAtlas>
<PortraitIndex>17</PortraitIndex>
<MoveRate>QUADRUPED</MoveRate>
</Row>
<Row>
<Class>UNITCLASS_WARRIOR</Class>
<Type>UNIT_IMMORTAL</Type>
<Combat>9</Combat>
<Cost>40</Cost>
<Moves>2</Moves>
<HurryCostModifier>-50</HurryCostModifier>
<CombatClass>UNITCOMBAT_MELEE</CombatClass>
<Domain>DOMAIN_LAND</Domain>
<DefaultUnitAI>UNITAI_COUNTER</DefaultUnitAI>
<Description>Immortal</Description>
<Civilopedia>Immortal</Civilopedia>
<Strategy>Immortal</Strategy>
<Help>Immortal</Help>
<MilitarySupport>true</MilitarySupport>
<MilitaryProduction>true</MilitaryProduction>
<Pillage>true</Pillage>
<ObsoleteTech>TECH_CIVIL_SERVICE</ObsoleteTech>
<GoodyHutUpgradeUnitClass>UNITCLASS_PIKEMAN</GoodyHutUpgradeUnitClass>
<AdvancedStartCost>15</AdvancedStartCost>
<XPValueAttack>3</XPValueAttack>
<XPValueDefense>3</XPValueDefense>
<Conscription>2</Conscription>
<UnitArtInfo>ART_DEF_UNIT_U_PERSIAN_IMMORTAL</UnitArtInfo>
<UnitFlagIconOffset>11</UnitFlagIconOffset>
<IconAtlas>UNIT_ATLAS_1</IconAtlas>
<PortraitIndex>11</PortraitIndex>
</Row>
<Row>
<Class>UNITCLASS_LANCER</Class>
<Type>UNIT_CANNON_ELEPHANT</Type>
<PrereqTech>TECH_METALLURGY</PrereqTech>
<Combat>18</Combat>
<RangedCombat>18</RangedCombat>
<Cost>185</Cost>
<Moves>4</Moves>
<CombatClass>UNITCOMBAT_MOUNTED</CombatClass>
<Domain>DOMAIN_LAND</Domain>
<DefaultUnitAI>UNITAI_RANGED</DefaultUnitAI>
<Description>Cannon Elephant</Description>
<Civilopedia>Cannon Elephant</Civilopedia>
<Strategy>Cannon Elephant</Strategy>
<Help>Cannon Elephant</Help>
<MilitarySupport>true</MilitarySupport>
<MilitaryProduction>true</MilitaryProduction>
<Pillage>true</Pillage>
<ObsoleteTech>TECH_COMBUSTION</ObsoleteTech>
<IgnoreBuildingDefense>true</IgnoreBuildingDefense>
<GoodyHutUpgradeUnitClass>UNITCLASS_ANTI_TANK_GUN</GoodyHutUpgradeUnitClass>
<AdvancedStartCost>30</AdvancedStartCost>
<XPValueAttack>3</XPValueAttack>
<XPValueDefense>3</XPValueDefense>
<UnitArtInfo>ART_DEF_UNIT_LANCER</UnitArtInfo>
<UnitFlagIconOffset>44</UnitFlagIconOffset>
<IconAtlas>UNIT_ATLAS_2</IconAtlas>
<PortraitIndex>1</PortraitIndex>
<MoveRate>QUADRUPED</MoveRate>
</Row>
<Row>
<ID>0</ID>
<Class>UNITCLASS_SETTLER</Class>
<Type>UNIT_GER</Type>
<Moves>3</Moves>
<Capture>UNITCLASS_WORKER</Capture>
<CivilianAttackPriority>CIVILIAN_ATTACK_PRIORITY_HIGH_EARLY_GAME_ONLY</CivilianAttackPriority>
<HurryCostModifier>20</HurryCostModifier>
<Domain>DOMAIN_LAND</Domain>
<DefaultUnitAI>UNITAI_SETTLE</DefaultUnitAI>
<Description>Ger</Description>
<Civilopedia>Ger</Civilopedia>
<Strategy>Ger</Strategy>
<Help>Ger</Help>
<Requirements>TXT_KEY_NO_ACTION_SETTLER_SIZE_LIMIT_HARDCODED</Requirements>
<Food>true</Food>
<Found>true</Found>
<CombatLimit>0</CombatLimit>
<UnitArtInfo>ART_DEF_UNIT__SETTLER</UnitArtInfo>
<UnitArtInfoCulturalVariation>true</UnitArtInfoCulturalVariation>
<PortraitIndex>0</PortraitIndex>
<IconAtlas>UNIT_ATLAS_1</IconAtlas>
</Row>
</Units>
<UnitFreePromotions>
<Row>
<UnitType>UNIT_LUFT</UnitType>
<PromotionType>PROMOTION_INTERCEPTION_IV</PromotionType>
</Row>
<Row>
<UnitType>UNIT_LUFT</UnitType>
<PromotionType>PROMOTION_AIR_SWEEP</PromotionType>
</Row>
<Row>
<UnitType>UNIT_LUFT</UnitType>
<PromotionType>PROMOTION_WEAK_RANGED</PromotionType>
</Row>
<Row>
<UnitType>UNIT_LUFT</UnitType>
<PromotionType>PROMOTION_AIR_RECON</PromotionType>
</Row>
<Row>
<UnitType>UNIT_LUFT</UnitType>
<PromotionType>PROMOTION_ANTI_HELICOPTER</PromotionType>
</Row>
<Row>
<UnitType>UNIT_WAR_ELEPHANT</UnitType>
<PromotionType>PROMOTION_WARELEPHANT</PromotionType>
</Row>
<Row>
<UnitType>UNIT_GER</UnitType>
<PromotionType>PROMOTION_MEDIC</PromotionType>
</Row>
</UnitFreePromotions>
<Unit_AITypes>
<Row>
<UnitType>UNIT_LUFT</UnitType>
<UnitAIType>UNITAI_DEFENSE_AIR</UnitAIType>
</Row>
<Row>
<UnitType>UNIT_LUFT</UnitType>
<UnitAIType>UNITAI_CARRIER_AIR</UnitAIType>
</Row>
<Row>
<UnitType>UNIT_WAR_ELEPHANT</UnitType>
<UnitAIType>UNITAI_DEFENSE</UnitAIType>
</Row>
<Row>
<UnitType>UNIT_IMMORTAL</UnitType>
<UnitAIType>UNITAI_ATTACK</UnitAIType>
</Row>
<Row>
<UnitType>UNIT_IMMORTAL</UnitType>
<UnitAIType>UNITAI_COUNTER</UnitAIType>
</Row>
<Row>
<UnitType>UNIT_IMMORTAL</UnitType>
<UnitAIType>UNITAI_DEFENSE</UnitAIType>
</Row>
<Row>
<UnitType>UNIT_IMMORTAL</UnitType>
<UnitAIType>UNITAI_EXPLORE</UnitAIType>
</Row>
<Row>
<UnitType>UNIT_CANNON_ELEPHANT</UnitType>
<UnitAIType>UNITAI_RANGED</UnitAIType>
</Row>
<Row>
<UnitType>UNIT_GER</UnitType>
<UnitAIType>UNITAI_SETTLE</UnitAIType>
</Row>
<Row>
<UnitType>UNIT_GER</UnitType>
<UnitAIType>UNITAI_GENERAL</UnitAIType>
</Row>
</Unit_AITypes>
</GameData>


Unit class overides
Spoiler :

<Row>
<CivilizationType>CIVILIZATION_AMERICA</CivilizationType>
<UnitClassType>UNITCLASS_BOMBER</UnitClassType>
<UnitType>UNIT_AMERICAN_B17</UnitType>
</Row>
<Row>
<CivilizationType>CIVILIZATION_ARABIA</CivilizationType>
<UnitClassType>UNITCLASS_KNIGHT</UnitClassType>
<UnitType>UNIT_ARABIAN_CAMELARCHER</UnitType>
</Row>
<Row>
<CivilizationType>CIVILIZATION_AZTEC</CivilizationType>
<UnitClassType>UNITCLASS_WARRIOR</UnitClassType>
<UnitType>UNIT_AZTEC_JAGUAR</UnitType>
</Row>
<Row>
<CivilizationType>CIVILIZATION_CHINA</CivilizationType>
<UnitClassType>UNITCLASS_CROSSBOWMAN</UnitClassType>
<UnitType>UNIT_CHINESE_CHUKONU</UnitType>
</Row>
<Row>
<CivilizationType>CIVILIZATION_EGYPT</CivilizationType>
<UnitClassType>UNITCLASS_CHARIOT_ARCHER</UnitClassType>
<UnitType>UNIT_EGYPTIAN_WARCHARIOT</UnitType>
</Row>
<Row>
<CivilizationType>CIVILIZATION_ENGLAND</CivilizationType>
<UnitClassType>UNITCLASS_FRIGATE</UnitClassType>
<UnitType>UNIT_ENGLISH_SHIPOFTHELINE</UnitType>
</Row>
<Row>
<CivilizationType>CIVILIZATION_FRANCE</CivilizationType>
<UnitClassType>UNITCLASS_MUSKETMAN</UnitClassType>
<UnitType>UNIT_FRENCH_MUSKETEER</UnitType>
</Row>
<Row>
<CivilizationType>CIVILIZATION_GERMANY</CivilizationType>
<UnitClassType>UNITCLASS_TANK</UnitClassType>
<UnitType>UNIT_GERMAN_PANZER</UnitType>
</Row>
<Row>
<CivilizationType>CIVILIZATION_GERMANY</CivilizationType>
<UnitClassType>UNITCLASS_FIGHTER</UnitClassType>
<UnitType>UNIT_LUFT</UnitType>
</Row>
<Row>
<CivilizationType>CIVILIZATION_GREECE</CivilizationType>
<UnitClassType>UNITCLASS_HORSEMAN</UnitClassType>
<UnitType>UNIT_GREEK_COMPANIONCAVALRY</UnitType>
</Row>
<Row>
<CivilizationType>CIVILIZATION_GREECE</CivilizationType>
<UnitClassType>UNITCLASS_SPEARMAN</UnitClassType>
<UnitType>UNIT_GREEK_HOPLITE</UnitType>
</Row>
<Row>
<CivilizationType>CIVILIZATION_INDIA</CivilizationType>
<UnitClassType>UNITCLASS_HORSEMAN</UnitClassType>
<UnitType>UNIT_WAR_ELEPHANT</UnitType>
</Row>
<Row>
<CivilizationType>CIVILIZATION_IROQUOIS</CivilizationType>
<UnitClassType>UNITCLASS_SWORDSMAN</UnitClassType>
<UnitType>UNIT_IROQUOIAN_MOHAWKWARRIOR</UnitType>
</Row>
<Row>
<CivilizationType>CIVILIZATION_JAPAN</CivilizationType>
<UnitClassType>UNITCLASS_FIGHTER</UnitClassType>
<UnitType>UNIT_JAPANESE_ZERO</UnitType>
</Row>
<Row>
<CivilizationType>CIVILIZATION_OTTOMAN</CivilizationType>
<UnitClassType>UNITCLASS_MUSKETMAN</UnitClassType>
<UnitType>UNIT_OTTOMAN_JANISSARY</UnitType>
</Row>
<Row>
<CivilizationType>CIVILIZATION_OTTOMAN</CivilizationType>
<UnitClassType>UNITCLASS_LANCER</UnitClassType>
<UnitType>UNIT_OTTOMAN_SIPAHI</UnitType>
</Row>
<Row>
<CivilizationType>CIVILIZATION_PERSIA</CivilizationType>
<UnitClassType>UNITCLASS_WARRIOR</UnitClassType>
<UnitType>UNIT_IMMORTAL</UnitType>
</Row>
<Row>
<CivilizationType>CIVILIZATION_ROME</CivilizationType>
<UnitClassType>UNITCLASS_CATAPULT</UnitClassType>
<UnitType>UNIT_ROMAN_BALLISTA</UnitType>
</Row>
<Row>
<CivilizationType>CIVILIZATION_ROME</CivilizationType>
<UnitClassType>UNITCLASS_SWORDSMAN</UnitClassType>
<UnitType>UNIT_ROMAN_LEGION</UnitType>
</Row>
<Row>
<CivilizationType>CIVILIZATION_RUSSIA</CivilizationType>
<UnitClassType>UNITCLASS_CAVALRY</UnitClassType>
<UnitType>UNIT_RUSSIAN_COSSACK</UnitType>
</Row>
<Row>
<CivilizationType>CIVILIZATION_SIAM</CivilizationType>
<UnitClassType>UNITCLASS_LANCERT</UnitClassType>
<UnitType>UNIT_CANNON_ELEPHANT</UnitType>
</Row>
<Row>
<CivilizationType>CIVILIZATION_SONGHAI</CivilizationType>
<UnitClassType>UNITCLASS_KNIGHT</UnitClassType>
<UnitType>UNIT_SONGHAI_MUSLIMCAVALRY</UnitType>
</Row>
<Row>
<CivilizationType>CIVILIZATION_MONGOLIA</CivilizationType>
<UnitClassType>UNITCLASS_KNIGHT</UnitClassType>
<UnitType>UNIT_MONGOLIAN_KESHIK</UnitType>
</Row>
<Row>
<CivilizationType>CIVILIZATION_MONGOLIA</CivilizationType>
<UnitClassType>UNITCLASS_SETTLER</UnitClassType>
<UnitType>UNIT_GER</UnitType>
</Row>
</Civilization_UnitClassOverrides>
</GameData>
 
And what do your logfiles say? Specifically, the XML and Database logs? I'm assuming you checked these before asking us. (If not, then go turn the logfiles on in your config.ini and see what they say.)

But I can see one mistake right off the bat: you set
<ID>0</ID> in your alternate Settler's definition. DO NOT DO THAT.

And second, why are you redefining all of the existing members of the UnitClassOverrides table? That's not how XML editing works, so you're doubling all of the entries, which'll break every single UU in the game. Same goes for your UnitAI tables and such.
 
Firstly thanks for help

Didn't know about database logging actually...First time really getting into the civ V modding myself, actually is there a way for the game to show up while its loading what errors you have in a similar way to civ IV (ie popup box on load, specifies what error you've made) ?

Since I've done some stuff in civ IV (and II before that) I'm kind of used to that style of modding. So basically, I delete everything at the start of the file that I want to make changes to then re-define everything. I just find it easier to work with. I didn't include it in the coding because I felt it'd be a bit much to post on a forum...(I mean, there are a lot of unitclassoverides for CS and barbs for example)
Although, with the <UnitAIs> I was under the impression since I'm only adding new entries there that I didn't need to delete all at the start ?

Anyway this is the database.log
Spoiler :
[30305.035] constraint failed
[30305.035] While executing - 'INSERT INTO ArtDefine_StrategicView(StrategicViewType, TileType, Asset) VALUES(?,?,?)'
[30310.978] Validating Foreign Key Constraints...
[30314.519] Passed Validation.
[30316.407]
-- SQLite Memory Statistics --
Memory Usage:
[Cur] [Max]
Malloc: 286344 2390720
PageCache: 2994 3636
LookAside: 45 1878
Scratch: 0 1

Static Buffer Overflows:
[TooLarge] [NoSpace]
PageCache: 0 0
Scratch: 0 0

Largest Allocations:
Malloc: 65280
PageCache: 1160
Scratch: 5128

Prepared Statements:
Current: 5
------------------------------


The xml log (ok I will go through and TXT_KEY_ everything, since the way I did it was acceptable in civ IV I did it that way)
Although I find it strange that my unique improvements and buildings are showing up without having to TXT_KEY_ those....
No idea on what to do with the whole sound thing
Spoiler :
[30310.947] **** Validating Game Database *****
[30314.519] Performing Localization Checks
[30314.519] Checking Tag Format...
[30314.519] Note: Tags must only use [A-Z_] characters, start with 'TXT_KEY_', and be under 128 characters long.
[30314.566] Validating UnitGameplay
[30314.566] Number of selection sounds doesn't match number of units.
[30314.566] Validating Notifications
[30314.566] **** VALIDATION FAILED *****
[30314.566] Validation Took 3.625637 seconds
[30316.407] **** Validating Prefetch Process *****
[30316.407] **** Validation Success *****
[30316.407] SetGlobalActionInfo
[30316.407]
-- SQLite Memory Statistics --
Memory Usage:
[Cur] [Max]
Malloc: 286344 2390720
PageCache: 2994 3636
LookAside: 45 1878
Scratch: 0 1

Static Buffer Overflows:
[TooLarge] [NoSpace]
PageCache: 0 0
Scratch: 0 0

Largest Allocations:
Malloc: 65280
PageCache: 1160
Scratch: 5128

Prepared Statements:
Current: 5
------------------------------


The start of the modded civ file which contains the unit class overrides
Spoiler :
<Civilization_BuildingClassOverrides>
<Delete/>
</Civilization_BuildingClassOverrides>
<Civilization_UnitClassOverrides>
<Delete/>
</Civilization_UnitClassOverrides>
 
is there a way for the game to show up while its loading what errors you have in a similar way to civ IV (ie popup box on load, specifies what error you've made) ?

FireTuner, but that's only for Lua errors and a very small set of database errors. Most XML errors won't appear there.

So basically, I delete everything at the start of the file that I want to make changes to then re-define everything.

This doesn't work quite as well for Civ5. It's a function of how SQL parses the XML files; if you try deleting everything and redefining from scratch it's pretty easy for it to botch the whole thing and crash. There are some tables where you CAN'T delete everything without crashing, no matter what else you do. (This is a big problem for modders.)

The tables that generally have this problem are the large "primary" tables, the ones with an <ID> field. Things like <Units>, <Buildings>, and so on. The devs fixed most of these a few patches ago to not be quite so sensitive; there was a time where you could never delete even a single unit without it crashing.

Also, that sort of modding makes your mod incompatible with most other gameplay/balance mods, and absolutely incompatible with content mods. The result will heavily depend on the order the mods are loaded in, and you have no control over that.

Although, with the <UnitAIs> I was under the impression since I'm only adding new entries there that I didn't need to delete all at the start ?

If you're only adding new entries, then yes. The confusion was on the Immortal; the UNIT_PERSIAN_IMMORTAL already had the Attack and Counter AIs, so I thought you were redefining those, when you're instead making a separate UNIT_IMMORTAL. (Not really a good idea to have two units with the same name, of course, but if you're deleting the original then it's not so bad.)

Your logs looks fine, those errors are ones it always gives. They're errors in the core game, having nothing to do with your content, and you'll see those if you run an unmodded game. Yes, the developers STILL haven't fixed bugs in the core game that their own logs flag, go figure.
 
Back
Top Bottom