crashburn274
Chieftain
- Joined
- Nov 13, 2011
- Messages
- 10
This is my first attempt at creating a mod and most of "my" code is copy-pasted from either Kale's guide or the game XML. I'm running G&K because I never bought the other expansions. This mod is supposed to create a new unit called the Dreadnaught which, presently, uses the Battleship's icon, animations, ect. Yesterday it loaded but crashed the game whenever the unit tried to bombard, and today the unit doesn't exist in the build menu or tech tree. I don't know what changed.
I have the OnModActivated set up, and when I pressed Build it reports "1 succeeded,"
Unit Art File
and game data file
<!-- Created by ModBuddy on 11/8/2014 2:18:27 AM -->
<GameData>
<UnitClasses>
<Row>
<Type>UNITCLASS_DREADNAUGHT</Type>
<Description>TXT_KEY_UNIT_DREADNAUGHT</Description>
<DefaultUnit>UNIT_DREADNAUGHT</DefaultUnit>
</Row>
</UnitClasses>
<Units>
<Row>
<Class>UNITCLASS_DREADNAUGHT</Class>
<Type>UNIT_DREADNAUGHT</Type>
<PrereqTech>TECH_ELECTRICITY</PrereqTech>
<Combat>45</Combat>
<RangedCombat>35</RangedCombat>
<Cost>250</Cost>
<Moves>4</Moves>
<Range>2</Range>
<CombatClass>UNITCOMBAT_NAVAL</CombatClass>
<Domain>DOMAIN_SEA</Domain>
<DefaultUnitAI>UNITAI_ATTACK_SEA</DefaultUnitAI>
<Description>TXT_KEY_UNIT_DREADNAUGHT</Description>
<Civilopedia>TXT_KEY_CIVILOPEDIA_UNITS_DREADNAUGHT_TEXT</Civilopedia>
<Strategy>TXT_KEY_UNIT_DREADNAUGHT_STRATEGY</Strategy>
<Help>TXT_KEY_UNIT_HELP_DREADNAUGHT</Help>
<MilitarySupport>true</MilitarySupport>
<MilitaryProduction>true</MilitaryProduction>
<Pillage>true</Pillage>
<IgnoreBuildingDefense>true</IgnoreBuildingDefense>
<Mechanized>true</Mechanized>
<AdvancedStartCost>60</AdvancedStartCost>
<MinAreaSize>20</MinAreaSize>
<XPValueAttack>3</XPValueAttack>
<XPValueDefense>3</XPValueDefense>
<UnitArtInfo>ART_DEF_UNIT_BATTLESHIP</UnitArtInfo>
<UnitFlagIconOffset>68</UnitFlagIconOffset>
<IconAtlas>UNIT_ATLAS_2</IconAtlas>
<PortraitIndex>21</PortraitIndex>
<MoveRate>BOAT</MoveRate>
</Row>
</Units>
<Unit_AITypes>
<Row>
<UnitType>UNIT_BATTLESHIP</UnitType>
<UnitAIType>UNITAI_ATTACK_SEA</UnitAIType>
</Row>
<Row>
<UnitType>UNIT_BATTLESHIP</UnitType>
<UnitAIType>UNITAI_RESERVE_SEA</UnitAIType>
</Row>
</Unit_AITypes>
<Unit_FreePromotions>
<Row>
<UnitType>UNIT_DREADNAUGHT</UnitType>
<PromotionType>PROMOTION_INDIRECT_FIRE</PromotionType>
</Row>
<Row>
<UnitType>UNIT_DREADNAUGHT</UnitType>
<PromotionType>PROMOTION_ONLY_DEFENSIVE</PromotionType>
</Row>
<!-- <Row>
<UnitType>UNIT_DREADNAUGHT</UnitType>
<PromotionType>PROMOTION_OCEAN_IMPASSABLE</PromotionType>
</Row> -->
</Unit_FreePromotions>
<Unit_ClassUpgrades>
<Update>
<Where UnitType="UNIT_FRIGATE"/>
<SET UnitClassType="UNIT_DREADNAUGHT"/>
</Update>
<Row>
<UnitType>UNIT_DREADNAUGHT</UnitType>
<UnitClassType>UNITCLASS_BATTLESHIP</UnitClassType>
</Row>
</Unit_ClassUpgrades>
<Unit_Flavors>
<Row>
<UnitType>UNIT_DREADNAUGHT</UnitType>
<FlavorType>FLAVOR_OFFENSE</FlavorType>
<Flavor>9</Flavor>
</Row>
<Row>
<UnitType>UNIT_DREADNAUGHT</UnitType>
<FlavorType>FLAVOR_DEFENSE</FlavorType>
<Flavor>9</Flavor>
</Row>
<Row>
<UnitType>UNIT_DREADNAUGHT</UnitType>
<FlavorType>FLAVOR_NAVAL</FlavorType>
<Flavor>9</Flavor>
</Row>
</Unit_Flavors>
<Unit_ResourceQuantityRequirements>
<Row>
<UnitType>UNIT_DREADNAUGHT</UnitType>
<ResourceType>RESOURCE_COAL</ResourceType>
</Row>
</Unit_ResourceQuantityRequirements>
</GameData>
I have the OnModActivated set up, and when I pressed Build it reports "1 succeeded,"
Unit Art File
Spoiler :
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 11/10/2014 1:05:20 AM -->
<GameData>
<Language_en_US>
<Row Tag="TXT_KEY_UNIT_DREADNAUGHT">
<Text>Dreadnaught</Text>
</Row>
<Row Tag="TXT_KEY_CIVILOPEDIA_UNITS_DREADNAUGHT_TEXT">
<Text>The Dreadnaught unit is named after the HMS Dreadnaught, a vessel which made every earlier battleship instantly obsolete with it's all-big-gun design and considerable improvements in engine and armament. Rather than accurately recreating the historical vessel, this unit class represents world war one era battleships in general. Earlier ironclad battleships are better represented by the Ironclad unit, and advances in aiming computers made perhaps the greatest contribution to the improvement of naval battleships between the first and second world wars, so the relevent technologies are reasonable. This unit's statistics are chosen for game balance, however, and don't represent any particular historical reality. The Dreadnaught unit has the same range as the frigate, but starts with the indirect fire promotion. It's movement rate is the same as the ironclad, which it's intended to operate alongside (and against), and its armor and firepower are sufficient to send wooden-hulled navies to the bottom</Text>
</Row>
<Row Tag="TXT_KEY_UNIT_DREADNAUGHT_STRATEGY">
<Text>The Dreadnaught replaces the obsolete Frigate. With its heavy armor and powerful armament, use the dreadnaught to sweep wooden navies from the seas.</Text>
</Row>
<Row Tag="TXT_KEY_UNIT_HELP_DREADNAUGHT">
<Text>The Dreadnaught is a naval ranged unit with heavier armor and armament than the frigate and the indirect fire promotion, though it is slower.</Text>
</Row>
</Language_en_US>
</GameData>
<!-- Created by ModBuddy on 11/10/2014 1:05:20 AM -->
<GameData>
<Language_en_US>
<Row Tag="TXT_KEY_UNIT_DREADNAUGHT">
<Text>Dreadnaught</Text>
</Row>
<Row Tag="TXT_KEY_CIVILOPEDIA_UNITS_DREADNAUGHT_TEXT">
<Text>The Dreadnaught unit is named after the HMS Dreadnaught, a vessel which made every earlier battleship instantly obsolete with it's all-big-gun design and considerable improvements in engine and armament. Rather than accurately recreating the historical vessel, this unit class represents world war one era battleships in general. Earlier ironclad battleships are better represented by the Ironclad unit, and advances in aiming computers made perhaps the greatest contribution to the improvement of naval battleships between the first and second world wars, so the relevent technologies are reasonable. This unit's statistics are chosen for game balance, however, and don't represent any particular historical reality. The Dreadnaught unit has the same range as the frigate, but starts with the indirect fire promotion. It's movement rate is the same as the ironclad, which it's intended to operate alongside (and against), and its armor and firepower are sufficient to send wooden-hulled navies to the bottom</Text>
</Row>
<Row Tag="TXT_KEY_UNIT_DREADNAUGHT_STRATEGY">
<Text>The Dreadnaught replaces the obsolete Frigate. With its heavy armor and powerful armament, use the dreadnaught to sweep wooden navies from the seas.</Text>
</Row>
<Row Tag="TXT_KEY_UNIT_HELP_DREADNAUGHT">
<Text>The Dreadnaught is a naval ranged unit with heavier armor and armament than the frigate and the indirect fire promotion, though it is slower.</Text>
</Row>
</Language_en_US>
</GameData>
and game data file
Spoiler :
<!-- Created by ModBuddy on 11/8/2014 2:18:27 AM -->
<GameData>
<UnitClasses>
<Row>
<Type>UNITCLASS_DREADNAUGHT</Type>
<Description>TXT_KEY_UNIT_DREADNAUGHT</Description>
<DefaultUnit>UNIT_DREADNAUGHT</DefaultUnit>
</Row>
</UnitClasses>
<Units>
<Row>
<Class>UNITCLASS_DREADNAUGHT</Class>
<Type>UNIT_DREADNAUGHT</Type>
<PrereqTech>TECH_ELECTRICITY</PrereqTech>
<Combat>45</Combat>
<RangedCombat>35</RangedCombat>
<Cost>250</Cost>
<Moves>4</Moves>
<Range>2</Range>
<CombatClass>UNITCOMBAT_NAVAL</CombatClass>
<Domain>DOMAIN_SEA</Domain>
<DefaultUnitAI>UNITAI_ATTACK_SEA</DefaultUnitAI>
<Description>TXT_KEY_UNIT_DREADNAUGHT</Description>
<Civilopedia>TXT_KEY_CIVILOPEDIA_UNITS_DREADNAUGHT_TEXT</Civilopedia>
<Strategy>TXT_KEY_UNIT_DREADNAUGHT_STRATEGY</Strategy>
<Help>TXT_KEY_UNIT_HELP_DREADNAUGHT</Help>
<MilitarySupport>true</MilitarySupport>
<MilitaryProduction>true</MilitaryProduction>
<Pillage>true</Pillage>
<IgnoreBuildingDefense>true</IgnoreBuildingDefense>
<Mechanized>true</Mechanized>
<AdvancedStartCost>60</AdvancedStartCost>
<MinAreaSize>20</MinAreaSize>
<XPValueAttack>3</XPValueAttack>
<XPValueDefense>3</XPValueDefense>
<UnitArtInfo>ART_DEF_UNIT_BATTLESHIP</UnitArtInfo>
<UnitFlagIconOffset>68</UnitFlagIconOffset>
<IconAtlas>UNIT_ATLAS_2</IconAtlas>
<PortraitIndex>21</PortraitIndex>
<MoveRate>BOAT</MoveRate>
</Row>
</Units>
<Unit_AITypes>
<Row>
<UnitType>UNIT_BATTLESHIP</UnitType>
<UnitAIType>UNITAI_ATTACK_SEA</UnitAIType>
</Row>
<Row>
<UnitType>UNIT_BATTLESHIP</UnitType>
<UnitAIType>UNITAI_RESERVE_SEA</UnitAIType>
</Row>
</Unit_AITypes>
<Unit_FreePromotions>
<Row>
<UnitType>UNIT_DREADNAUGHT</UnitType>
<PromotionType>PROMOTION_INDIRECT_FIRE</PromotionType>
</Row>
<Row>
<UnitType>UNIT_DREADNAUGHT</UnitType>
<PromotionType>PROMOTION_ONLY_DEFENSIVE</PromotionType>
</Row>
<!-- <Row>
<UnitType>UNIT_DREADNAUGHT</UnitType>
<PromotionType>PROMOTION_OCEAN_IMPASSABLE</PromotionType>
</Row> -->
</Unit_FreePromotions>
<Unit_ClassUpgrades>
<Update>
<Where UnitType="UNIT_FRIGATE"/>
<SET UnitClassType="UNIT_DREADNAUGHT"/>
</Update>
<Row>
<UnitType>UNIT_DREADNAUGHT</UnitType>
<UnitClassType>UNITCLASS_BATTLESHIP</UnitClassType>
</Row>
</Unit_ClassUpgrades>
<Unit_Flavors>
<Row>
<UnitType>UNIT_DREADNAUGHT</UnitType>
<FlavorType>FLAVOR_OFFENSE</FlavorType>
<Flavor>9</Flavor>
</Row>
<Row>
<UnitType>UNIT_DREADNAUGHT</UnitType>
<FlavorType>FLAVOR_DEFENSE</FlavorType>
<Flavor>9</Flavor>
</Row>
<Row>
<UnitType>UNIT_DREADNAUGHT</UnitType>
<FlavorType>FLAVOR_NAVAL</FlavorType>
<Flavor>9</Flavor>
</Row>
</Unit_Flavors>
<Unit_ResourceQuantityRequirements>
<Row>
<UnitType>UNIT_DREADNAUGHT</UnitType>
<ResourceType>RESOURCE_COAL</ResourceType>
</Row>
</Unit_ResourceQuantityRequirements>
</GameData>