Prereq of BuildingRequirement?

Hi all,

Apologies for re-posting this, I originally posted in the FE forum by mistake, putting it here but with some extra info/testing in the hope that someone might have further suggestions.

Basically i'm looking at this:

I am trying to create a new unit type that has an improvement type as a prereq.  I can use a faction trait or a tech as a prereq easy enough, but i'm having trouble setting an improvement type as as prereq.

Essentially what i'm after is.... Unit X can only be trained in a city if the city contains improvement X.  I have tried this:

<Prereq>

   <Type>BuildingRequirement</Type>
   <Attribute>My_Improvement</Attribute>
</Prereq>

But it doesn't seem to work :-(

I have now also tried...

<Prereq>
   <Type>BuildingRequirement</Type>
   <Attribute>My_Improvement</Attribute>
   <Target>City</Target>
</Prereq>

<Prereq>
   <Type>ImprovementType</Type>
   <Attribute>My_Improvement</Attribute>
</Prereq>

<Prereq>
   <Type>Improvement</Type>
   <Attribute>My_Improvement</Attribute>
</Prereq>

Also tried this...

<RequiredImprovement>My_Improvement</RequiredImprovement>


Most of these had absolutely no effect.  Adding the <Type>BuildingRequirement</Type> as a prereq appears to prevent the building of Unit X, however when constructing a building X it doesn't then unlock the ability to create the unit.

I'm of the belief now that it actually doesn't work.  I'm fairly sure that for units, the <Prereq> types of Allegiance, Race, AbilityBonusOption, RestrictedAbilityBonusOption and Tech all work fine, but not the BuildingRequirement.   X(     Seems to me that it might have worked at some point but not currently.

If anyone is aware of any units that do use this building restriction i'd like to know.  Or any other suggestions on things to try.

Thanks.


2,532 views 3 replies
Reply #1 Top

I would try to have an improvement produce a local, unique background resource that the unit requires to be built.

The only thing I can think of that might actually work.

Reply #2 Top

Thanks, was just actually reading a post about from Heavenfall about this technique (was related to using it to restrict weapons based on building but same concept I think).

Will give it a go tomorrow and post results.

 

Reply #3 Top

OK so using a local resource provides a workaround.  Got this to work ok.  It's a reasonable solution but takes more effort than it would if the Prereq just worked... hopefully it gets fixed in future.