[Solved] Unique unit is buildable, but ability based on Great Generals isn't working

PurpleSkua

Chieftain
Joined
Jul 19, 2017
Messages
11
I've got a UU that can be built just fine and functions perfectly well as an ordinary melee unit, but the ability doesn't appear to be working. The intention was for it to give adjacent units +5 combat strength (value to be decided once it works). I honestly have no idea what I'm doing wrong, there are no errors I can see in any of the logs and I've tested as many variations on the idea as I can think of with no apparent changes.

Xml for the actual unit:

<?xml version="1.0" encoding="utf-8"?>
<GameInfo>

<Types>
<!-- Melee-->
<Row Type="UNIT_SKUA_GALLOWGLASS" Kind="KIND_UNIT"/>
</Types>

<UnitAiInfos>
<!-- Melee-->
<Row UnitType="UNIT_SKUA_GALLOWGLASS" AiType="UNITAI_COMBAT"/>
<Row UnitType="UNIT_SKUA_GALLOWGLASS" AiType="UNITAI_EXPLORE"/>
<Row UnitType="UNIT_SKUA_GALLOWGLASS" AiType="UNITTYPE_MELEE"/>
<Row UnitType="UNIT_SKUA_GALLOWGLASS" AiType="UNITTYPE_LAND_COMBAT"/>
</UnitAiInfos>

<UnitReplaces>
<Row CivUniqueUnitType="UNIT_SKUA_GALLOWGLASS" ReplacesUnitType="UNIT_SWORDSMAN"/>
</UnitReplaces>

<UnitUpgrades>
<Row Unit="UNIT_SKUA_GALLOWGLASS" UpgradeUnit="UNIT_MUSKETMAN"/>
</UnitUpgrades>

<Tags>
<Row Tag="CLASS_SKUA_GALLOWGLASS" Vocabulary="ABILITY_CLASS"/>
</Tags>

<TypeTags>
<Row Type="UNIT_SKUA_GALLOWGLASS" Tag="CLASS_MELEE"/>
<Row Type="UNIT_SKUA_GALLOWGLASS" Tag="CLASS_SKUA_GALLOWGLASS"/>
</TypeTags>

<Units>
<Row UnitType="UNIT_SKUA_GALLOWGLASS" BaseMoves="2" Cost="90" AdvisorType="ADVISOR_CONQUEST" BaseSightRange="2" ZoneOfControl="true" Domain="DOMAIN_LAND" FormationClass="FORMATION_CLASS_LAND_COMBAT" Name="LOC_UNIT_SKUA_GALLOWGLASS_NAME" Description="LOC_UNIT_SKUA_GALLOWGLASS_DESCRIPTION" PurchaseYield="YIELD_GOLD" PromotionClass="PROMOTION_CLASS_MELEE" Maintenance="2" Combat="38" MandatoryObsoleteTech="TECH_REPLACEABLE_PARTS" PrereqTech="TECH_IRON_WORKING" TraitType="TRAIT_CIVILIZATION_UNIT_SKUA_GALLOWGLASS"/>
</Units>

</GameInfo>​

And for the ability:

<?xml version="1.0" encoding="utf-8"?>
<!-- GameData1 -->
<!-- Author: Daniel -->
<!-- DateCreated: 7/19/2017 9:25:40 PM -->
<GameInfo>

<Types>
<Row Type="ABILITY_SKUA_GALLOWGLASS" Kind="KIND_ABILITY"/>
</Types>

<TypeTags>
<Row Type="ABILITY_SKUA_GALLOWGLASS" Tag="CLASS_SKUA_GALLOWGLASS"/>
</TypeTags>

<UnitAbilities>
<Row UnitAbilityType="ABILITY_SKUA_GALLOWGLASS" Name="LOC_ABILITY_SKUA_GALLOWGLASS_NAME" Description="LOC_ABILITY_SKUA_GALLOWGLASS_DESCRIPTION"/>
</UnitAbilities>

<UnitAbilityModifiers>
<Row>
<UnitAbilityType>ABILITY_SKUA_GALLOWGLASS</UnitAbilityType>
<ModifierId>SKUA_GALLOWGLASS_AOE_BUFF</ModifierId>
</Row>
</UnitAbilityModifiers>

<Modifiers>
<Row>
<ModifierId>SKUA_GALLOWGLASS_AOE_BUFF</ModifierId>
<ModifierType>MODIFIER_PLAYER_UNITS_ATTACH_MODIFIER</ModifierType>
<SubjectRequirementSetId>SKUA_GALLOWGLASS_AOE_BUFF_REQUIREMENTS</SubjectRequirementSetId>
</Row>
<Row>
<ModifierId>SKUA_GALLOWGLASS_COMBAT_STRENGTH_AOE_LAND_MODIFIER</ModifierId>
<ModifierType>MODIFIER_UNIT_ADJUST_COMBAT_STRENGTH</ModifierType>
</Row>
</Modifiers>

<ModifierArguments>
<Row>
<ModifierId>SKUA_GALLOWGLASS_AOE_BUFF</ModifierId>
<Name>ModifierId</Name>
<Value>SKUA_GALLOWGLASS_COMBAT_STRENGTH_AOE_LAND_MODIFIER</Value>
</Row>
<Row>
<ModifierId>SKUA_GALLOWGLASS_COMBAT_STRENGTH_AOE_LAND_MODIFIER</ModifierId>
<Name>Amount</Name>
<Value>5</Value>
</Row>
</ModifierArguments>

<RequirementSets>
<Row>
<RequirementSetId>SKUA_GALLOWGLASS_AOE_BUFF_REQUIREMENTS</RequirementSetId>
<RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType>
</Row>
</RequirementSets>

<RequirementSetRequirements>
<Row>
<RequirementSetId>SKUA_GALLOWGLASS_AOE_BUFF_REQUIREMENTS</RequirementSetId>
<RequirementId>SKUA_GALLOWGLASS_AOE_REQUIRES_LAND_DOMAIN</RequirementId>
</Row>
<Row>
<RequirementSetId>SKUA_GALLOWGLASS_AOE_BUFF_REQUIREMENTS</RequirementSetId>
<RequirementId>SKUA_GALLOWGLASS_AOE_REQUIRES_LAND_ADJACENCY</RequirementId>
</Row>
</RequirementSetRequirements>

<Requirements>
<Row>
<RequirementId>SKUA_GALLOWGLASS_AOE_REQUIRES_LAND_DOMAIN</RequirementId>
<RequirementType>REQUIREMENT_UNIT_DOMAIN_MATCHES</RequirementType>
</Row>
<Row>
<RequirementId>SKUA_GALLOWGLASS_AOE_REQUIRES_LAND_ADJACENCY</RequirementId>
<RequirementType>REQUIREMENT_PLOT_ADJACENT_TO_OWNER</RequirementType>
</Row>
<Row>
<RequirementId>SKUA_GALLOWGLASS_AOE_REQUIRES_TARGET_REQUIREMENTS</RequirementId>
<RequirementType>REQUIREMENT_REQUIREMENTSET_IS_MET</RequirementType>
</Row>
</Requirements>

<RequirementArguments>
<Row>
<RequirementId>SKUA_GALLOWGLASS_AOE_REQUIRES_LAND_DOMAIN</RequirementId>
<Name>UnitDomain</Name>
<Value>DOMAIN_LAND</Value>
</Row>
<Row>
<RequirementId>SKUA_GALLOWGLASS_AOE_REQUIRES_LAND_ADJACENCY</RequirementId>
<Name>MinDistance</Name>
<Value>1</Value>
</Row>
<Row>
<RequirementId>SKUA_GALLOWGLASS_AOE_REQUIRES_LAND_ADJACENCY</RequirementId>
<Name>MaxDistance</Name>
<Value>1</Value>
</Row>
</RequirementArguments>

<ModifierStrings>
<Row ModifierId="SKUA_GALLOWGLASS_AOE_BUFF" Context="Preview" Text="LOC_SKUA_GALLOWGLASS_AOE_BUFF_DESCRIPTION"/>
</ModifierStrings>

</GameInfo>​
 
Kind of hard to read what you posted (maybe cause im on mobile) so there might be somehing i missed, but here are 2 things:

1. The modifierstring you added is for the modifier that attaches a modifier , not for the modifier that increases the combat strength
So your modifier might be working, just the string is not beeing shown, make sure to check the combat strength value

2. I think the additional step of attaching a modifier that increasea strength is not needed, you could just use a modifier to increase combat strength of all units with the same requirement
(Then you would have only one layer of modifiers, instead of 2)

Im not sure either of those is the reason its not working, just educated guesses
 
@Aldollin bloody hell it was number one. I am so pissed off with myself for not realising that, I've been trying to fix this for so long. Thank you!

Also, my apologies for the formatting. As for number two, I think the extra step is necessary to grant the bonus to adjacent units, unless I make it a civ-wide ability. I basically just copied the way Great Generals, Varus, and Medics do it.
 
Back
Top Bottom