I'm having an issue adding a new art define to the game. It keeps defaulting the spearman, which I'm aware means the art define isn't being loaded properly. Pursuing that, I found the following error in the DB logs:
You'll notice on the second line that the XML serializer is trying to insert 6 values (last one is blank?) into a table with 5 columns. Looks like an easy fix. However, here's the art define file in question:
Looking in the row in UnitMemberInfos where the DB log claims there's an extra (blank) field being inserted, there's nothing there! I 'created' this file using Whoward's art define templates by copying the Swordsman example and just changing the define name to make sure I could get it working, but so far no dice.
EDIT: It occurred to me that I might be doubling up on existing UnitMemberInfos since the swordsman entries are obviously already in the database, so I removed that section from the XML. It gets rid of the log error, but my units are still spearmen. :(
EDIT 2: I've attached the whole mod so it's easier to debug.
Code:
[43197.893] While executing - 'insert into ArtDefine_UnitMemberInfos('Type', 'Scale', 'Model', 'MaterialTypeTag', 'MaterialTypeSoundOverrideTag') values (?, ?, ?, ?, ?);'
[43197.893] In XMLSerializer while inserting row into table insert into ArtDefine_UnitMemberInfos('Type', 'Scale', 'Model', 'MaterialTypeTag', 'MaterialTypeSoundOverrideTag') with values (ART_DEF_UNIT_MEMBER_SWORDSMAN_V2, 0.140000000596046, Assets/Units/Swordsman/Swordsman_V2.fxsxml, ARMOR, ARMOR, ).
[43197.893] In XMLSerializer while updating table ArtDefine_UnitMemberInfos from file Art/Hawkwing Unit/HawkwingArtDefines.xml.
Code:
<?xml version="1.0" encoding="utf-8"?>
<GameData>
<ArtDefine_UnitInfos>
<Row>
<Type>ART_DEF_UNIT_HERO_HAWKWING</Type>
<DamageStates>1</DamageStates>
<Formation>DefaultMelee</Formation>
</Row>
</ArtDefine_UnitInfos>
<ArtDefine_UnitInfoMemberInfos>
<Row>
<UnitInfoType>ART_DEF_UNIT_HERO_HAWKWING</UnitInfoType>
<UnitMemberInfoType>ART_DEF_UNIT_MEMBER_SWORDSMAN_V2</UnitMemberInfoType>
<NumMembers>3</NumMembers>
</Row>
<Row>
<UnitInfoType>ART_DEF_UNIT_HERO_HAWKWING</UnitInfoType>
<UnitMemberInfoType>ART_DEF_UNIT_MEMBER_SWORDSMAN</UnitMemberInfoType>
<NumMembers>6</NumMembers>
</Row>
<Row>
<UnitInfoType>ART_DEF_UNIT_HERO_HAWKWING</UnitInfoType>
<UnitMemberInfoType>ART_DEF_UNIT_MEMBER_SWORDSMAN_V3</UnitMemberInfoType>
<NumMembers>3</NumMembers>
</Row>
</ArtDefine_UnitInfoMemberInfos>
<ArtDefine_UnitMemberInfos>
<Row>
<Type>ART_DEF_UNIT_MEMBER_SWORDSMAN_V2</Type>
<Scale>0.140000000596046</Scale>
<Model>Assets/Units/Swordsman/Swordsman_V2.fxsxml</Model>
<MaterialTypeTag>ARMOR</MaterialTypeTag>
<MaterialTypeSoundOverrideTag>ARMOR</MaterialTypeSoundOverrideTag>
</Row>
<Row>
<Type>ART_DEF_UNIT_MEMBER_SWORDSMAN</Type>
<Scale>0.140000000596046</Scale>
<Model>Assets/Units/Swordsman/Swordsman.fxsxml</Model>
<MaterialTypeTag>ARMOR</MaterialTypeTag>
<MaterialTypeSoundOverrideTag>ARMOR</MaterialTypeSoundOverrideTag>
</Row>
<Row>
<Type>ART_DEF_UNIT_MEMBER_SWORDSMAN_V3</Type>
<Scale>0.140000000596046</Scale>
<Model>Assets/Units/Swordsman/Swordsman_V3.fxsxml</Model>
<MaterialTypeTag>ARMOR</MaterialTypeTag>
<MaterialTypeSoundOverrideTag>ARMOR</MaterialTypeSoundOverrideTag>
</Row>
</ArtDefine_UnitMemberInfos>
<ArtDefine_UnitMemberCombats>
<Row>
<UnitMemberType>ART_DEF_UNIT_MEMBER_SWORDSMAN_V2</UnitMemberType>
<EnableActions>Idle Attack RunCharge AttackCity Bombard Death BombardDefend Run Fortify CombatReady Walk AttackCharge</EnableActions>
<ShortMoveRadius>12.0</ShortMoveRadius>
<ShortMoveRate>0.349999994039536</ShortMoveRate>
<TargetHeight>8.0</TargetHeight>
<HasRefaceAfterCombat>1</HasRefaceAfterCombat>
</Row>
<Row>
<UnitMemberType>ART_DEF_UNIT_MEMBER_SWORDSMAN</UnitMemberType>
<EnableActions>Idle Attack RunCharge AttackCity Bombard Death BombardDefend Run Fortify CombatReady Walk AttackCharge</EnableActions>
<ShortMoveRadius>12.0</ShortMoveRadius>
<ShortMoveRate>0.349999994039536</ShortMoveRate>
<TargetHeight>8.0</TargetHeight>
<HasRefaceAfterCombat>1</HasRefaceAfterCombat>
</Row>
<Row>
<UnitMemberType>ART_DEF_UNIT_MEMBER_SWORDSMAN_V3</UnitMemberType>
<EnableActions>Idle Attack RunCharge AttackCity Bombard Death BombardDefend Run Fortify CombatReady Walk AttackCharge</EnableActions>
<ShortMoveRadius>12.0</ShortMoveRadius>
<ShortMoveRate>0.349999994039536</ShortMoveRate>
<TargetHeight>8.0</TargetHeight>
<HasRefaceAfterCombat>1</HasRefaceAfterCombat>
</Row>
</ArtDefine_UnitMemberCombats>
<ArtDefine_UnitMemberCombatWeapons>
<Row>
<UnitMemberType>ART_DEF_UNIT_MEMBER_SWORDSMAN_V2</UnitMemberType>
<Index>0</Index>
<SubIndex>0</SubIndex>
<WeaponTypeTag>METAL</WeaponTypeTag>
<WeaponTypeSoundOverrideTag>SWORD</WeaponTypeSoundOverrideTag>
</Row>
<Row>
<UnitMemberType>ART_DEF_UNIT_MEMBER_SWORDSMAN_V2</UnitMemberType>
<Index>1</Index>
<SubIndex>0</SubIndex>
<VisKillStrengthMin>10.0</VisKillStrengthMin>
<VisKillStrengthMax>20.0</VisKillStrengthMax>
<WeaponTypeTag>FLAMING_ARROW</WeaponTypeTag>
<MissTargetSlopRadius>10.0</MissTargetSlopRadius>
</Row>
<Row>
<UnitMemberType>ART_DEF_UNIT_MEMBER_SWORDSMAN</UnitMemberType>
<Index>0</Index>
<SubIndex>0</SubIndex>
<WeaponTypeTag>METAL</WeaponTypeTag>
<WeaponTypeSoundOverrideTag>SWORD</WeaponTypeSoundOverrideTag>
</Row>
<Row>
<UnitMemberType>ART_DEF_UNIT_MEMBER_SWORDSMAN</UnitMemberType>
<Index>1</Index>
<SubIndex>0</SubIndex>
<VisKillStrengthMin>10.0</VisKillStrengthMin>
<VisKillStrengthMax>20.0</VisKillStrengthMax>
<WeaponTypeTag>FLAMING_ARROW</WeaponTypeTag>
<MissTargetSlopRadius>10.0</MissTargetSlopRadius>
</Row>
<Row>
<UnitMemberType>ART_DEF_UNIT_MEMBER_SWORDSMAN_V3</UnitMemberType>
<Index>0</Index>
<SubIndex>0</SubIndex>
<WeaponTypeTag>METAL</WeaponTypeTag>
<WeaponTypeSoundOverrideTag>SWORD</WeaponTypeSoundOverrideTag>
</Row>
<Row>
<UnitMemberType>ART_DEF_UNIT_MEMBER_SWORDSMAN_V3</UnitMemberType>
<Index>1</Index>
<SubIndex>0</SubIndex>
<VisKillStrengthMin>10.0</VisKillStrengthMin>
<VisKillStrengthMax>20.0</VisKillStrengthMax>
<WeaponTypeTag>FLAMING_ARROW</WeaponTypeTag>
<MissTargetSlopRadius>10.0</MissTargetSlopRadius>
</Row>
</ArtDefine_UnitMemberCombatWeapons>
<ArtDefine_StrategicView>
<Row>
<StrategicViewType>ART_DEF_UNIT_SWORDSMAN</StrategicViewType>
<TileType>Unit</TileType>
<Asset>SV_Swordsman.dds</Asset>
</Row>
</ArtDefine_StrategicView>
</GameData>
EDIT: It occurred to me that I might be doubling up on existing UnitMemberInfos since the swordsman entries are obviously already in the database, so I removed that section from the XML. It gets rid of the log error, but my units are still spearmen. :(
EDIT 2: I've attached the whole mod so it's easier to debug.