building prereq contingent upon a unit ability?

I'd like to make a building require an ability on one of my champions. 

my code currently has the academy available from turn 1 without meeting the desired prereq.

 

 

<AbilityBonus InternalName="GovernorAcademyAbility">
<AbilityBonusType>Unit_Level</AbilityBonusType>
<AbilityBonusOption InternalName="GovernorAcademy">
<DisplayName>Governor's Academy</DisplayName>
<Description>Allows the construction of a Governor's Academy, which grants 5xp / turn to champions stationed in the city it is constructed in.</Description>
<Icon>Ability_PathOfTheGovernor_Icon.png</Icon>
<HideWhenUpgraded>0</HideWhenUpgraded>
<Likelihood>1000000000</Likelihood>
<RarityDisplay>Rare</RarityDisplay>
<MinimumLevel>1</MinimumLevel>
<Type>Army</Type>
<!--<Prereq>
<Type>AbilityBonusOption</Type>
<Target>Unit</Target>
<Attribute>PathOfTheGovernor</Attribute>
</Prereq> -->
<AIData AIPersonality="AI_General">
<AIPriority>5</AIPriority>
</AIData>
</AbilityBonusOption>
</AbilityBonus>

 

 

<ImprovementType InternalName="GovernorsAcademy">
<DisplayName>Governor's Academy</DisplayName>
<Description>The Governor's Academy Grants 5 experience per turn to stationed champions 1 per faction.</Description>
<AllowedPerFaction>1</AllowedPerFaction>
<RequiresCity>1</RequiresCity>
<BarredTerrain>River</BarredTerrain>
<BarredTerrain>SwampTerrain</BarredTerrain>
<PreferredTerrain>City</PreferredTerrain>
<PreferredTerrain>Category:Land</PreferredTerrain>
<PreferredTerrain>Forest</PreferredTerrain>
<Prereq>
<Type>AbilityBonusOption</Type>
<Attribute>GovernorAcademyAbility</Attribute>
</Prereq>
<LaborToBuild>100</LaborToBuild>
<GameModifier>
<ModType>StationedUnitStatBonus</ModType>
<StrVal>UnitStat_Experience</StrVal>
<StrVal2>OnlyChampions</StrVal2>
<Value>5</Value>
<Provides>Stationed champions have a 25% chance of getting 1xp/season</Provides>
</GameModifier>

<AIData AIPersonality="AI_General">
<AIPriority>5</AIPriority>
<AITag>CommandPost</AITag>
</AIData>
<ArtDef>Art_AdventurersGuild</ArtDef>
</ImprovementType>

3,391 views 4 replies
Reply #1 Top

This won't work. You need to create a work-around where you unlock a tech instead from the unit's trait, then have that tech be required by the building.

Also, keep in mind that it is the internalname of the abilitybonusoption that should be used, not the abilitybonus. But again, fixing that will not make this work.

Edit: Also, check out theatre of the wind and how it unlocks from a quest. You may be able to use that somehow.

Reply #2 Top

thanks havenfall!

 

Reply #3 Top

Couldn't you also have the trait provide a special resource (similar to how Attuned provides mana) and have the construction of the building require some amount of this resource?

If you also made this resource not accumulate, you could then require that a player have several units with this trait, or several traits that grant this resource, before they could build this structure.

Reply #4 Top

The theater of the wind method was unsuccessful coming from a level up ability.   Looks like it is going to have to be a tech unlock.