Chris41336
Chieftain
- Joined
- Oct 19, 2008
- Messages
- 84
Hello All,
I created a new Unit Class (and unit type to go along with it) and I set the Ottomans to start with this unit to test it in game and for some reason I cannot get the Unit to appear in game or be producable early on, despite the fact that I made the prereq tech for the unit Agriculture.
I will paste the code below for anybody to tell me if they can see a problem:
This is my XML file for the new unit (I placed it all in the same XML file for simplicity):
And this is for making the Ottomans start with one (added to a copied version of Civ5Civilizations.xml):
And here is the ArtDefine:
(all of the ART_DEF are also uploaded to the mod, the .dds files and fxsxml and gr2 files. They are basically just Knight graphics with a color scheme change.)
I also ensured that I sed OnModActivated to UpdateDatabase with all of the new XML files I have in my mod. Just another question: do any XML files that I am adding to need to contain all of the info from the original Civ 5 stuff, or can I just create an entirely new XML document with new code and the game will understand to implement that code where necessary? Thanks in advance guys.
I created a new Unit Class (and unit type to go along with it) and I set the Ottomans to start with this unit to test it in game and for some reason I cannot get the Unit to appear in game or be producable early on, despite the fact that I made the prereq tech for the unit Agriculture.
I will paste the code below for anybody to tell me if they can see a problem:
This is my XML file for the new unit (I placed it all in the same XML file for simplicity):
Code:
<GameData>
<UnitClasses>
<Row>
<Type>UNITCLASS_ROYAL_GUARD</Type>
<Description>TXT_KEY_UNIT_ROYAL_GUARD</Description>
<DefaultUnit>UNIT_ROYAL_GUARD</DefaultUnit>
</Row>
</UnitClasses>
<Units>
<Row>
<Class>UNITCLASS_ROYAL_GUARD</Class>
<Type>UNIT_ROYAL_GUARD</Type>
<PrereqTech>TECH_AGRICULTURE</PrereqTech>
<Combat>20</Combat>
<Cost>150</Cost>
<Moves>5</Moves>
<CombatClass>UNITCOMBAT_MOUNTED</CombatClass>
<Domain>DOMAIN_LAND</Domain>
<DefaultUnitAI>UNITAI_ATTACK</DefaultUnitAI>
<Description>TXT_KEY_UNIT_ROYAL_GUARD</Description>
<Civilopedia>TXT_KEY_CIVILOPEDIA_UNITS_MEDIEVAL_KNIGHT_TEXT</Civilopedia>
<Strategy>TXT_KEY_UNIT_KNIGHT_STRATEGY</Strategy>
<Help>TXT_KEY_UNIT_HELP_ROYAL_GUARD</Help>
<MilitarySupport>true</MilitarySupport>
<MilitaryProduction>true</MilitaryProduction>
<Pillage>true</Pillage>
<ObsoleteTech>TECH_MILITARY_SCIENCE</ObsoleteTech>
<GoodyHutUpgradeUnitClass>UNITCLASS_CAVALRY</GoodyHutUpgradeUnitClass>
<AdvancedStartCost>25</AdvancedStartCost>
<XPValueAttack>3</XPValueAttack>
<XPValueDefense>3</XPValueDefense>
<UnitArtInfo>ART_DEF_UNIT_ROYAL_GUARD</UnitArtInfo>
<UnitFlagIconOffset>25</UnitFlagIconOffset>
<IconAtlas>UNIT_ATLAS_1</IconAtlas>
<PortraitIndex>26</PortraitIndex>
<MoveRate>QUADRUPED</MoveRate>
</Row>
</Units>
<Unit_FreePromotions>
<Row>
<UnitType>UNIT_ROYAL_GUARD</UnitType>
<PromotionType>PROMOTION_GREAT_GENERAL</PromotionType>
</Row>
<Row>
<UnitType>UNIT_ROYAL_GUARD</UnitType>
<PromotionType>PROMOTION_BLITZ</PromotionType>
</Row>
</Unit_FreePromotions>
<Unit_AITypes>
<Row>
<UnitType>UNIT_ROYAL_GUARD</UnitType>
<UnitAIType>UNITAI_ATTACK</UnitAIType>
</Row>
<Row>
<UnitType>UNIT_ROYAL_GUARD</UnitType>
<UnitAIType>UNITAI_DEFENSE</UnitAIType>
</Row>
<Row>
<UnitType>UNIT_ROYAL_GUARD</UnitType>
<UnitAIType>UNITAI_EXPLORE</UnitAIType>
</Row>
</Unit_AITypes>
<Unit_Flavors>
<Row>
<UnitType>UNIT_ROYAL_GUARD</UnitType>
<FlavorType>FLAVOR_RECON</FlavorType>
<Flavor>1</Flavor>
</Row>
<Row>
<UnitType>UNIT_ROYAL_GUARD</UnitType>
<FlavorType>FLAVOR_OFFENSE</FlavorType>
<Flavor>2</Flavor>
</Row>
<Row>
<UnitType>UNIT_ROYAL_GUARD</UnitType>
<FlavorType>FLAVOR_DEFENSE</FlavorType>
<Flavor>2</Flavor>
</Row>
</Unit_Flavors>
<Row Tag="TXT_KEY_UNIT_ROYAL_GUARD">
<Text>Royal Guard</Text>
</Row>
<Row Tag="TXT_KEY_UNIT_HELP_ROYAL_GUARD">
<Text>This is your King's royal guard, accompanied by your majesty himself. Although a powerful unit, be sure to protect your King!</Text>
</Row>
</GameData>
And this is for making the Ottomans start with one (added to a copied version of Civ5Civilizations.xml):
Code:
<Row>
<CivilizationType>CIVILIZATION_OTTOMAN</CivilizationType>
<UnitClassType>UNITCLASS_SETTLER</UnitClassType>
<Count>1</Count>
<UnitAIType>UNITAI_SETTLE</UnitAIType>
</Row>
<Row>
<CivilizationType>CIVILIZATION_OTTOMAN</CivilizationType>
<UnitClassType>UNITCLASS_ROYAL_GUARD</UnitClassType>
<Count>1</Count>
<UnitAIType>UNITAI_DEFENSE</UnitAIType>
</Row>
And here is the ArtDefine:
Code:
<UnitArtInfos>
<UnitArtInfo>
<Type>ART_DEF_UNIT_ROYAL_GUARD</Type>
<Formation>DefaultCavalry</Formation>
<DamageStates>1</DamageStates>
<UnitMemberArt>
<MemberType>ART_DEF_UNIT_MEMBER_ROYAL_GUARD_KING</MemberType>
<MemberCount>1</MemberCount>
</UnitMemberArt>
<UnitMemberArt>
<MemberType>ART_DEF_UNIT_MEMBER_ROYAL_GUARD</MemberType>
<MemberCount>4</MemberCount>
</UnitMemberArt>
</UnitArtInfo>
</UnitArtInfos>
(all of the ART_DEF are also uploaded to the mod, the .dds files and fxsxml and gr2 files. They are basically just Knight graphics with a color scheme change.)
I also ensured that I sed OnModActivated to UpdateDatabase with all of the new XML files I have in my mod. Just another question: do any XML files that I am adding to need to contain all of the info from the original Civ 5 stuff, or can I just create an entirely new XML document with new code and the game will understand to implement that code where necessary? Thanks in advance guys.