ColdPR
Chieftain
- Joined
- Mar 17, 2017
- Messages
- 6
Edit: Managed to resolve it somehow
I've been trying to create unique land units for Germany and Brazil since I dislike their naval uniques. I started to create a Landsknecht unit to replace the Pikeman for Germany. I had no trouble creating the unit and it appears in game and it works and everything is dandy except trying to give it abilities has resulted in me hitting a wall over and over and over trying to figure out what I'm doing wrong.
I'm hoping someone might be willing to lend another pair of eyes for the code to check if I'm just missing something silly in the syntax or something else. I've been referencing the Firaxis code for unit abilities and I even checked some other mods for the syntax and it seems like it's all correct but obviously I'm doing something wrong because neither ability functions on the unit.
<Types>
<Row Type="UNIT_LANDSKNECHT" Kind="KIND_UNIT" />
<Row Type="ABILITY_BONUS_VERSUS_CAVALRY" Kind="KIND_ABILITY"/>
<Row Type="ABILITY_CONSTANTHEAL" Kind="KIND_ABILITY"/>
</Types>
<Units>
<Row UnitType="UNIT_LANDSKNECHT" BaseMoves="3" Cost="1" AdvisorType="ADVISOR_CONQUEST" BaseSightRange="10" ZoneOfControl="true" Domain="DOMAIN_LAND" FormationClass="FORMATION_CLASS_LAND_COMBAT" Name="LOC_UNIT_LANDSKNECHT_NAME" Description="LOC_UNIT_LANDSKNECHT_DESCRIPTION" PurchaseYield="YIELD_GOLD" PromotionClass="PROMOTION_CLASS_ANTI_CAVALRY" Maintenance="3" Combat="41" MandatoryObsoleteTech="TECH_COMPOSITES" PrereqTech="TECH_POTTERY" TraitType="TRAIT_CIVILIZATION_UNIT_LANDSKNECHT"/>
</Units>
<Types>
<Row Type="TRAIT_CIVILIZATION_UNIT_LANDSKNECHT" Kind="KIND_TRAIT"/>
</Types>
<Traits>
<Row TraitType="TRAIT_CIVILIZATION_UNIT_LANDSKNECHT" Name="LOC_UNIT_LANDSKNECHT_NAME" Description="LOC_UNIT_LANDSKNECHT_DESCRIPTION"/>
</Traits>
<CivilizationTraits>
<Row CivilizationType="CIVILIZATION_GERMANY" TraitType="TRAIT_CIVILIZATION_UNIT_LANDSKNECHT"/>
</CivilizationTraits>
<UnitUpgrades>
<Row Unit="UNIT_LANDSKNECHT" UpgradeUnit="UNIT_AT_CREW"/>
</UnitUpgrades>
<UnitAiInfos>
<Row UnitType="UNIT_LANDSKNECHT" AiType="UNITAI_COMBAT"/>
<Row UnitType="UNIT_LANDSKNECHT" AiType="UNITAI_EXPLORE"/>
<Row UnitType="UNIT_LANDSKNECHT" AiType="UNITTYPE_MELEE"/>
<Row UnitType="UNIT_LANDSKNECHT" AiType="UNITTYPE_LAND_COMBAT"/>
</UnitAiInfos>
<UnitReplaces>
<Row CivUniqueUnitType="UNIT_LANDSKNECHT" ReplacesUnitType="UNIT_PIKEMAN"/>
</UnitReplaces>
<PlayerItems>
<Row Domain="StandardPlayers" CivilizationType="CIVILIZATION_GERMANY" LeaderType="LEADER_BARBAROSSA" Type="UNIT_LANDSKNECHT" Icon="ICON_UNIT_LANDSKNECHT" Name="LOC_UNIT_LANDSKNECHT_NAME" Description="LOC_UNIT_LANDSKNECHT_DESCRIPTION" SortIndex="1"/>
</PlayerItems>
<Tags>
<Row Tag="CLASS_LANDSKNECHT" Vocabulary="ABILITY_CLASS"/>
</Tags>
<TypeTags>
<Row Type="UNIT_LANDSKNECHT" Tag="CLASS_ANTI_CAVALRY"/>
<Row Type="UNIT_LANDSKNECHT" Tag="CLASS_LANDSKNECHT"/>
<Row Type="ABILITY_CONSTANTHEAL" Tag="CLASS_LANDSKNECHT"/>
<Row Type="ABILITY_BONUS_VERSUS_CAVALRY" Tag="CLASS_LANDSKNECHT"/>
</TypeTags>
<UnitAbilities>
<Row UnitAbilityType="ABILITY_CONSTANTHEAL" Name="LOC_ABILITY_CONSTANTHEAL_NAME" Description="LOC_ABILITY_CONSTANTHEAL_DESCRIPTION"/>
<Row UnitAbilityType="ABILITY_BONUS_VERSUS_CAVALRY" Name="LOC_ABILITY_BONUS_VERSUS_CAVALRY_NAME" Description="LOC_ABILITY_BONUS_VERSUS_CAVALRY_DESCRIPTION"/>
</UnitAbilities>
<UnitAbilityModifiers>
<Row>
<UnitAbilityType>ABILITY_CONSTANTHEAL</UnitAbilityType>
<ModifierId>CONSTANT_HEAL_EVERY_MOVE</ModifierId>
</Row>
<Row>
<UnitAbilityType>ABILITY_BONUS_VERSUS_CAVALRY</UnitAbilityType>
<ModifierId>GERMANPIKE_CAVALRY_BONUS</ModifierId>
</Row>
</UnitAbilityModifiers>
<Modifiers>
<Row>
<ModifierId>GERMANPIKE_CAVALRY_BONUS</ModifierId>
<ModifierType>MODIFIER_UNIT_ADJUST_COMBAT_STRENGTH</ModifierType> <SubjectRequirementSetId>GERMANPIKE_OPPONENT_IS_CAVALRY_REQUIREMENTS</SubjectRequirementSetId>
</Row>
<Row>
<ModifierId>CONSTANT_HEAL_EVERY_MOVE</ModifierId>
<ModifierType>MODIFIER_PLAYER_UNIT_GRANT_HEAL_AFTER_ACTION</ModifierType>
</Row>
</Modifiers>
<ModifierArguments>
<Row>
<ModifierId>GERMANPIKE_CAVALRY_BONUS</ModifierId>
<Name>Amount</Name>
<Value>13</Value>
</Row>
</ModifierArguments>
<RequirementSets>
<Row>
<RequirementSetId>GERMANPIKE_OPPONENT_IS_CAVALRY_REQUIREMENTS</RequirementSetId>
<RequirementSetType>REQUIREMENTSET_TEST_ANY</RequirementSetType>
</Row>
</RequirementSets>
<RequirementSetRequirements>
<Row>
<RequirementSetId>GERMANPIKE_OPPONENT_IS_CAVALRY_REQUIREMENTS</RequirementSetId>
<RequirementId>OPPONENT_IS_LIGHT_CAVALRY_UNIT_REQUIREMENTS</RequirementId>
</Row>
<Row>
<RequirementSetId>GERMANPIKE_OPPONENT_IS_CAVALRY_REQUIREMENTS</RequirementSetId>
<RequirementId>OPPONENT_IS_HEAVY_CAVALRY_UNIT_REQUIREMENTS</RequirementId>
</Row>
</RequirementSetRequirements>
<Requirements>
<Row>
<RequirementId>OPPONENT_IS_LIGHT_CAVALRY_UNIT_REQUIREMENTS</RequirementId>
<RequirementType>REQUIREMENT_OPPONENT_UNIT_TAG_MATCHES</RequirementType>
</Row>
<Row>
<RequirementId>OPPONENT_IS_HEAVY_CAVALRY_UNIT_REQUIREMENTS</RequirementId>
<RequirementType>REQUIREMENT_OPPONENT_UNIT_TAG_MATCHES</RequirementType>
</Row>
</Requirements>
<RequirementArguments>
<Row>
<RequirementId>OPPONENT_IS_LIGHT_CAVALRY_UNIT_REQUIREMENTS</RequirementId>
<Name>Tag</Name>
<Value>CLASS_LIGHT_CAVALRY</Value>
</Row>
<Row>
<RequirementId>OPPONENT_IS_HEAVY_CAVALRY_UNIT_REQUIREMENTS</RequirementId>
<Name>Tag</Name>
<Value>CLASS_HEAVY_CAVALRY</Value>
</Row>
</RequirementArguments>
<ModifierStrings>
<Row ModifierId="GERMANPIKE_CAVALRY_BONUS" Context="Preview" Text="LOC_UNIT_GERMANPIKE_CAVALRY_BONUS_PREVIEW"/>
</ModifierStrings>
I've been trying to create unique land units for Germany and Brazil since I dislike their naval uniques. I started to create a Landsknecht unit to replace the Pikeman for Germany. I had no trouble creating the unit and it appears in game and it works and everything is dandy except trying to give it abilities has resulted in me hitting a wall over and over and over trying to figure out what I'm doing wrong.
I'm hoping someone might be willing to lend another pair of eyes for the code to check if I'm just missing something silly in the syntax or something else. I've been referencing the Firaxis code for unit abilities and I even checked some other mods for the syntax and it seems like it's all correct but obviously I'm doing something wrong because neither ability functions on the unit.
<Types>
<Row Type="UNIT_LANDSKNECHT" Kind="KIND_UNIT" />
<Row Type="ABILITY_BONUS_VERSUS_CAVALRY" Kind="KIND_ABILITY"/>
<Row Type="ABILITY_CONSTANTHEAL" Kind="KIND_ABILITY"/>
</Types>
<Units>
<Row UnitType="UNIT_LANDSKNECHT" BaseMoves="3" Cost="1" AdvisorType="ADVISOR_CONQUEST" BaseSightRange="10" ZoneOfControl="true" Domain="DOMAIN_LAND" FormationClass="FORMATION_CLASS_LAND_COMBAT" Name="LOC_UNIT_LANDSKNECHT_NAME" Description="LOC_UNIT_LANDSKNECHT_DESCRIPTION" PurchaseYield="YIELD_GOLD" PromotionClass="PROMOTION_CLASS_ANTI_CAVALRY" Maintenance="3" Combat="41" MandatoryObsoleteTech="TECH_COMPOSITES" PrereqTech="TECH_POTTERY" TraitType="TRAIT_CIVILIZATION_UNIT_LANDSKNECHT"/>
</Units>
<Types>
<Row Type="TRAIT_CIVILIZATION_UNIT_LANDSKNECHT" Kind="KIND_TRAIT"/>
</Types>
<Traits>
<Row TraitType="TRAIT_CIVILIZATION_UNIT_LANDSKNECHT" Name="LOC_UNIT_LANDSKNECHT_NAME" Description="LOC_UNIT_LANDSKNECHT_DESCRIPTION"/>
</Traits>
<CivilizationTraits>
<Row CivilizationType="CIVILIZATION_GERMANY" TraitType="TRAIT_CIVILIZATION_UNIT_LANDSKNECHT"/>
</CivilizationTraits>
<UnitUpgrades>
<Row Unit="UNIT_LANDSKNECHT" UpgradeUnit="UNIT_AT_CREW"/>
</UnitUpgrades>
<UnitAiInfos>
<Row UnitType="UNIT_LANDSKNECHT" AiType="UNITAI_COMBAT"/>
<Row UnitType="UNIT_LANDSKNECHT" AiType="UNITAI_EXPLORE"/>
<Row UnitType="UNIT_LANDSKNECHT" AiType="UNITTYPE_MELEE"/>
<Row UnitType="UNIT_LANDSKNECHT" AiType="UNITTYPE_LAND_COMBAT"/>
</UnitAiInfos>
<UnitReplaces>
<Row CivUniqueUnitType="UNIT_LANDSKNECHT" ReplacesUnitType="UNIT_PIKEMAN"/>
</UnitReplaces>
<PlayerItems>
<Row Domain="StandardPlayers" CivilizationType="CIVILIZATION_GERMANY" LeaderType="LEADER_BARBAROSSA" Type="UNIT_LANDSKNECHT" Icon="ICON_UNIT_LANDSKNECHT" Name="LOC_UNIT_LANDSKNECHT_NAME" Description="LOC_UNIT_LANDSKNECHT_DESCRIPTION" SortIndex="1"/>
</PlayerItems>
<Tags>
<Row Tag="CLASS_LANDSKNECHT" Vocabulary="ABILITY_CLASS"/>
</Tags>
<TypeTags>
<Row Type="UNIT_LANDSKNECHT" Tag="CLASS_ANTI_CAVALRY"/>
<Row Type="UNIT_LANDSKNECHT" Tag="CLASS_LANDSKNECHT"/>
<Row Type="ABILITY_CONSTANTHEAL" Tag="CLASS_LANDSKNECHT"/>
<Row Type="ABILITY_BONUS_VERSUS_CAVALRY" Tag="CLASS_LANDSKNECHT"/>
</TypeTags>
<UnitAbilities>
<Row UnitAbilityType="ABILITY_CONSTANTHEAL" Name="LOC_ABILITY_CONSTANTHEAL_NAME" Description="LOC_ABILITY_CONSTANTHEAL_DESCRIPTION"/>
<Row UnitAbilityType="ABILITY_BONUS_VERSUS_CAVALRY" Name="LOC_ABILITY_BONUS_VERSUS_CAVALRY_NAME" Description="LOC_ABILITY_BONUS_VERSUS_CAVALRY_DESCRIPTION"/>
</UnitAbilities>
<UnitAbilityModifiers>
<Row>
<UnitAbilityType>ABILITY_CONSTANTHEAL</UnitAbilityType>
<ModifierId>CONSTANT_HEAL_EVERY_MOVE</ModifierId>
</Row>
<Row>
<UnitAbilityType>ABILITY_BONUS_VERSUS_CAVALRY</UnitAbilityType>
<ModifierId>GERMANPIKE_CAVALRY_BONUS</ModifierId>
</Row>
</UnitAbilityModifiers>
<Modifiers>
<Row>
<ModifierId>GERMANPIKE_CAVALRY_BONUS</ModifierId>
<ModifierType>MODIFIER_UNIT_ADJUST_COMBAT_STRENGTH</ModifierType> <SubjectRequirementSetId>GERMANPIKE_OPPONENT_IS_CAVALRY_REQUIREMENTS</SubjectRequirementSetId>
</Row>
<Row>
<ModifierId>CONSTANT_HEAL_EVERY_MOVE</ModifierId>
<ModifierType>MODIFIER_PLAYER_UNIT_GRANT_HEAL_AFTER_ACTION</ModifierType>
</Row>
</Modifiers>
<ModifierArguments>
<Row>
<ModifierId>GERMANPIKE_CAVALRY_BONUS</ModifierId>
<Name>Amount</Name>
<Value>13</Value>
</Row>
</ModifierArguments>
<RequirementSets>
<Row>
<RequirementSetId>GERMANPIKE_OPPONENT_IS_CAVALRY_REQUIREMENTS</RequirementSetId>
<RequirementSetType>REQUIREMENTSET_TEST_ANY</RequirementSetType>
</Row>
</RequirementSets>
<RequirementSetRequirements>
<Row>
<RequirementSetId>GERMANPIKE_OPPONENT_IS_CAVALRY_REQUIREMENTS</RequirementSetId>
<RequirementId>OPPONENT_IS_LIGHT_CAVALRY_UNIT_REQUIREMENTS</RequirementId>
</Row>
<Row>
<RequirementSetId>GERMANPIKE_OPPONENT_IS_CAVALRY_REQUIREMENTS</RequirementSetId>
<RequirementId>OPPONENT_IS_HEAVY_CAVALRY_UNIT_REQUIREMENTS</RequirementId>
</Row>
</RequirementSetRequirements>
<Requirements>
<Row>
<RequirementId>OPPONENT_IS_LIGHT_CAVALRY_UNIT_REQUIREMENTS</RequirementId>
<RequirementType>REQUIREMENT_OPPONENT_UNIT_TAG_MATCHES</RequirementType>
</Row>
<Row>
<RequirementId>OPPONENT_IS_HEAVY_CAVALRY_UNIT_REQUIREMENTS</RequirementId>
<RequirementType>REQUIREMENT_OPPONENT_UNIT_TAG_MATCHES</RequirementType>
</Row>
</Requirements>
<RequirementArguments>
<Row>
<RequirementId>OPPONENT_IS_LIGHT_CAVALRY_UNIT_REQUIREMENTS</RequirementId>
<Name>Tag</Name>
<Value>CLASS_LIGHT_CAVALRY</Value>
</Row>
<Row>
<RequirementId>OPPONENT_IS_HEAVY_CAVALRY_UNIT_REQUIREMENTS</RequirementId>
<Name>Tag</Name>
<Value>CLASS_HEAVY_CAVALRY</Value>
</Row>
</RequirementArguments>
<ModifierStrings>
<Row ModifierId="GERMANPIKE_CAVALRY_BONUS" Context="Preview" Text="LOC_UNIT_GERMANPIKE_CAVALRY_BONUS_PREVIEW"/>
</ModifierStrings>
Last edited: