Simple airship mod missing combat animations

Axel van Daeren

Chieftain
Joined
Apr 29, 2014
Messages
1
Location
Indiana
First Civ mod, very simple. I wanted to add an airship that could travel freely over all tiles (as in Smoky Skies) using the SS airship graphics. I got it working alllmost to my satisfaction, but there are no combat animations and I don't know why.

I tried to copy the SS airship code more or less directly, but found a problem in that SS treats the airship as a UNITCOMBAT_HELICOPTER. This would normally mean that the unit gains embarkation after Optics is researched, which we obviously don't want. In SS they got around this by removing the embarkation promotions from UNITCOMBAT_HELICOPTER entirely, because why not? SS doesn't have any helis so that doesn't break anything.

This meant that I had to find a different workaround. I ended up making a new CombatClass, UNITCOMBAT_AIRSHIP, in the HOVER domain. I pretty much copied the definition from UNITCOMBAT_HELICOPTER, but without the Embarkation promotions. This also allows for more future units with the same behavior.

And behold, it works beautifully except for that one little hangup.

I'm thinking it has something to do with my creating a new CombatClass. I'll try reworking it so the new unit is just a COMBATCLASS_HELICOPTER to see if the animations work, but I'm assuming this is going to give them Embarkation; I have no idea whether this will cause them to actually embark or not, but either way it'll be pretty silly for them to even have the promotion. In the meantime I'm hoping somebody can just look at my code and tell me what I did wrong.

Anyway here's the code. Using up to date BNW:

Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 4/22/2014 12:25:03 PM -->
<GameData>
	<UnitCombatInfos>
		<!--This was not in Smoky Skies-->
		<!--SS made them Helis and deleted embarkation for Helis-->
		<Row>
			<Type>UNITCOMBAT_AIRSHIP</Type>
			<Description>TXT_KEY_UNITCOMBAT_HELICOPTER</Description>
		</Row>
	</UnitCombatInfos>
	<UnitClasses>
		<Row>
			<Type>UNITCLASS_AIRSHIP</Type>
			<Description>TXT_KEY_UNIT_AIRSHIP</Description>
			<DefaultUnit>UNIT_AIRSHIP</DefaultUnit>
		</Row>
	</UnitClasses>
	<UnitPromotions>
		<Row>
			<Type>PROMOTION_MOVE_ALL_TERRAIN</Type>
			<Description>TXT_KEY_PROMOTION_MOVE_ALL_TERRAIN</Description>
			<Help>TXT_KEY_PROMOTION_MOVE_ALL_TERRAIN_HELP</Help>
			<Sound>AS2D_IF_LEVELUP</Sound>
			<IconAtlas>ABILITY_ATLAS</IconAtlas>
			<PediaType>PEDIA_ATTRIBUTES</PediaType>
			<PortraitIndex>58</PortraitIndex>
			<PediaEntry>TXT_KEY_PROMOTION_MOVE_ALL_TERRAIN</PediaEntry>
			<CanMoveAllTerrain>true</CanMoveAllTerrain>
			<LostWithUpgrade>1</LostWithUpgrade>
		</Row>
	</UnitPromotions>
	<UnitPromotions_UnitCombatMods>
		<Row>
			<PromotionType>PROMOTION_ANTI_AIR</PromotionType>
			<UnitCombatType>UNITCOMBAT_AIRSHIP</UnitCombatType>
			<Modifier>100</Modifier>
		</Row>
		<Row>
			<PromotionType>PROMOTION_ANTI_AIR</PromotionType>
			<UnitCombatType>UNITCOMBAT_AIRSHIP</UnitCombatType>
			<Modifier>100</Modifier>
		</Row>
		<Row>
			<PromotionType>PROMOTION_ANTI_HELICOPTER</PromotionType>
			<UnitCombatType>UNITCOMBAT_AIRSHIP</UnitCombatType>
			<Modifier>100</Modifier>
		</Row>
	</UnitPromotions_UnitCombatMods>
	<UnitPromotions_UnitCombats>
		<!--Earnable Promotions-->
		<Row>
			<PromotionType>PROMOTION_INSTA_HEAL</PromotionType>
			<UnitCombatType>UNITCOMBAT_AIRSHIP</UnitCombatType>
		</Row>
		<Row>
			<PromotionType>PROMOTION_SENTRY</PromotionType>
			<UnitCombatType>UNITCOMBAT_AIRSHIP</UnitCombatType>
		</Row>
		<Row>
			<PromotionType>PROMOTION_AIR_SIEGE_1</PromotionType>
			<UnitCombatType>UNITCOMBAT_AIRSHIP</UnitCombatType>
		</Row>
		<Row>
			<PromotionType>PROMOTION_AIR_SIEGE_2</PromotionType>
			<UnitCombatType>UNITCOMBAT_AIRSHIP</UnitCombatType>
		</Row>
		<Row>
			<PromotionType>PROMOTION_AIR_SIEGE_3</PromotionType>
			<UnitCombatType>UNITCOMBAT_AIRSHIP</UnitCombatType>
		</Row>
		<Row>
			<PromotionType>PROMOTION_BOMBARDMENT_1</PromotionType>
			<UnitCombatType>UNITCOMBAT_AIRSHIP</UnitCombatType>
		</Row>
		<Row>
			<PromotionType>PROMOTION_BOMBARDMENT_2</PromotionType>
			<UnitCombatType>UNITCOMBAT_AIRSHIP</UnitCombatType>
		</Row>
		<Row>
			<PromotionType>PROMOTION_BOMBARDMENT_3</PromotionType>
			<UnitCombatType>UNITCOMBAT_AIRSHIP</UnitCombatType>
		</Row>
		<Row>
			<PromotionType>PROMOTION_AIR_LOGISTICS</PromotionType>
			<UnitCombatType>UNITCOMBAT_AIRSHIP</UnitCombatType>
		</Row>
		<Row>
			<PromotionType>PROMOTION_HELI_AMBUSH_1</PromotionType>
			<UnitCombatType>UNITCOMBAT_AIRSHIP</UnitCombatType>
		</Row>
		<Row>
			<PromotionType>PROMOTION_HELI_AMBUSH_2</PromotionType>
			<UnitCombatType>UNITCOMBAT_AIRSHIP</UnitCombatType>
		</Row>
		<Row>
			<PromotionType>PROMOTION_HELI_MOBILITY_1</PromotionType>
			<UnitCombatType>UNITCOMBAT_AIRSHIP</UnitCombatType>
		</Row>
		<Row>
			<PromotionType>PROMOTION_HELI_MOBILITY_2</PromotionType>
			<UnitCombatType>UNITCOMBAT_AIRSHIP</UnitCombatType>
		</Row>
		<Row>
			<PromotionType>PROMOTION_HELI_REPAIR</PromotionType>
			<UnitCombatType>UNITCOMBAT_AIRSHIP</UnitCombatType>
		</Row>
		<Row>
			<PromotionType>PROMOTION_AIR_TARGETING_1</PromotionType>
			<UnitCombatType>UNITCOMBAT_AIRSHIP</UnitCombatType>
		</Row>
		<Row>
			<PromotionType>PROMOTION_AIR_TARGETING_2</PromotionType>
			<UnitCombatType>UNITCOMBAT_AIRSHIP</UnitCombatType>
		</Row>
		<!--Imbued Promotions-->
		<Row>
			<PromotionType>PROMOTION_MORALE</PromotionType>
			<UnitCombatType>UNITCOMBAT_AIRSHIP</UnitCombatType>
		</Row>
		<Row>
			<PromotionType>PROMOTION_ADJACENT_BONUS</PromotionType>
			<UnitCombatType>UNITCOMBAT_AIRSHIP</UnitCombatType>
		</Row>
		<Row>
			<PromotionType>PROMOTION_HIMEJI_CASTLE</PromotionType>
			<UnitCombatType>UNITCOMBAT_AIRSHIP</UnitCombatType>
		</Row>
		<Row>
			<PromotionType>PROMOTION_GREAT_LIGHTHOUSE</PromotionType>
			<UnitCombatType>UNITCOMBAT_AIRSHIP</UnitCombatType>
		</Row>
		<Row>
			<PromotionType>PROMOTION_NATIONALISM</PromotionType>
			<UnitCombatType>UNITCOMBAT_AIRSHIP</UnitCombatType>
		</Row>
		<Row>
			<PromotionType>PROMOTION_HOMELAND_GUARDIAN_BOOGALOO</PromotionType>
			<UnitCombatType>UNITCOMBAT_AIRSHIP</UnitCombatType>
		</Row>
	</UnitPromotions_UnitCombats>
	<Units>
		<Row>
			<Type>UNIT_AIRSHIP</Type>
			<Class>UNITCLASS_AIRSHIP</Class>
			<PrereqTech>TECH_STEAM_POWER</PrereqTech>
			<Combat>65</Combat>
			<Cost>475</Cost>
			<Moves>4</Moves>
			<CombatClass>UNITCOMBAT_AIRSHIP</CombatClass>
			<Domain>DOMAIN_HOVER</Domain>
			<DefaultUnitAI>UNITAI_FAST_ATTACK</DefaultUnitAI>
			<Description>TXT_KEY_UNIT_AIRSHIP</Description>
			<Civilopedia>TXT_KEY_UNIT_AIRSHIP_TEXT</Civilopedia>
			<Strategy>TXT_KEY_UNIT_AIRSHIP_STRATEGY</Strategy>
			<Help>TXT_KEY_UNIT_AIRSHIP_HELP</Help>
			<MilitarySupport>true</MilitarySupport>
			<MilitaryProduction>true</MilitaryProduction>
			<Pillage>false</Pillage>
			<IgnoreBuildingDefense>true</IgnoreBuildingDefense>
			<AdvancedStartCost>60</AdvancedStartCost>
			<XPValueAttack>3</XPValueAttack>
			<XPValueDefense>3</XPValueDefense>
			<UnitArtInfo>ART_DEF_UNIT_SMOKEY_STEAM_AIRSHIP_LEVEL_1</UnitArtInfo>
			<MoveRate>WHEELED</MoveRate>
			<UnitFlagIconOffset>7</UnitFlagIconOffset>
			<UnitFlagAtlas>EXPANSION_SCEN_UNIT_FLAG_ATLAS</UnitFlagAtlas>
			<PortraitIndex>7</PortraitIndex>
			<IconAtlas>EXPANSION_SCEN_UNIT_ATLAS</IconAtlas>
		</Row>
	</Units>
	<Unit_AITypes>
		<Row>
			<UnitType>UNIT_AIRSHIP</UnitType>
			<UnitAIType>UNITAI_CARRIER_SEA</UnitAIType>
		</Row>
		<Row>
			<UnitType>UNIT_AIRSHIP</UnitType>
			<UnitAIType>UNITAI_FAST_ATTACK</UnitAIType>
		</Row>
		<Row>
			<UnitType>UNIT_AIRSHIP</UnitType>
			<UnitAIType>UNITAI_ATTACK_SEA</UnitAIType>
		</Row>
		<Row>
			<UnitType>UNIT_AIRSHIP</UnitType>
			<UnitAIType>UNITAI_EXPLORE_SEA</UnitAIType>
		</Row>
		<Row>
			<UnitType>UNIT_AIRSHIP</UnitType>
			<UnitAIType>UNITAI_ESCORT_SEA</UnitAIType>
		</Row>
	</Unit_AITypes>
	<Unit_Flavors>
		<Row>
			<UnitType>UNIT_AIRSHIP</UnitType>
			<FlavorType>FLAVOR_OFFENSE</FlavorType>
			<Flavor>12</Flavor>
		</Row>
		<Row>
			<UnitType>UNIT_AIRSHIP</UnitType>
			<FlavorType>FLAVOR_DEFENSE</FlavorType>
			<Flavor>12</Flavor>
		</Row>
		<Row>
			<UnitType>UNIT_AIRSHIP</UnitType>
			<FlavorType>FLAVOR_MOBILE</FlavorType>
			<Flavor>10</Flavor>
		</Row>
		<Row>
			<UnitType>UNIT_AIRSHIP</UnitType>
			<FlavorType>FLAVOR_NAVAL</FlavorType>
			<Flavor>18</Flavor>
		</Row>
		<Row>
			<UnitType>UNIT_AIRSHIP</UnitType>
			<FlavorType>FLAVOR_NAVAL_RECON</FlavorType>
			<Flavor>6</Flavor>
		</Row>
	</Unit_Flavors>
	<Unit_FreePromotions>
		<Row>
			<UnitType>UNIT_AIRSHIP</UnitType>
			<PromotionType>PROMOTION_MOVE_ALL_TERRAIN</PromotionType>
		</Row>
		<Row>
			<UnitType>UNIT_AIRSHIP</UnitType>
			<PromotionType>PROMOTION_FLAT_MOVEMENT_COST</PromotionType>
		</Row>
		<Row>
			<UnitType>UNIT_AIRSHIP</UnitType>
			<PromotionType>PROMOTION_ANTI_TANK</PromotionType>
		</Row>
		<Row>
			<UnitType>UNIT_AIRSHIP</UnitType>
			<PromotionType>PROMOTION_NO_DEFENSIVE_BONUSES</PromotionType>
		</Row>
		<Row>
			<UnitType>UNIT_AIRSHIP</UnitType>
			<PromotionType>PROMOTION_NO_CAPTURE</PromotionType>
		</Row>
	</Unit_FreePromotions>
	<UnitGameplay2DScripts>
		<Row UnitType="UNIT_AIRSHIP">
			<SelectionSound>AS2D_SELECT_BOMBER</SelectionSound>
			<FirstSelectionSound>AS2D_BIRTH_BOMBER</FirstSelectionSound>
		</Row>
	</UnitGameplay2DScripts>
	<Unit_ResourceQuantityRequirements>
		<Row>
			<UnitType>UNIT_AIRSHIP</UnitType>
			<ResourceType>RESOURCE_COAL</ResourceType>
			<Cost>1</Cost>
		</Row>
	</Unit_ResourceQuantityRequirements>
  
</GameData>
 
Animations only work for existing UNITCOMBAT_ types, so you can't add new ones if you want animated units
 
Back
Top Bottom