Restricting unit builds
-
In a mod I am working on units can be built at either a factory(anything) or recruitmentCenter (infantry only).
The code is
<attachment name="unitAttachment" attachTo="factory" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType"> <option name="isFactory" value="true"/> </attachment> <attachment name="unitAttachment" attachTo="recruitmentCenter" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType"> <option name="isFactory" value="true" /> <option name="canBeDamaged" value="false" /> </attachment> <attachment name="unitAttachment" attachTo="infantry" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType"> <option name="movement" value="1"/> <option name="transportCost" value="1"/> <option name="attack" value="1"/> <option name="defense" value="2"/> <option name="isLandTransportable" value="true"/> <option name="artillerySupportable" value="true"/> <option name="requiresUnits" value="recruitmentCenter" /> <option name="requiresUnits" value="factory" /> </attachment> <attachment name="unitAttachment" attachTo="armor" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType"> <option name="movement" value="2"/> <option name="transportCost" value="2"/> <option name="canBlitz" value="true"/> <option name="attack" value="3"/> <option name="defense" value="2"/> <option name="requiresUnits" value="factory" /> </attachment>However armor can be placed at a recruitmentCenter. I have done this before in another mod without a problem (WW2-Zombies). I have attached the full xml file. East_and_West-Manual.xml
Does anyone have any idea what the problem is? Is there another way of creating infantry-only production?
-
hmm maybe the "isFactory" is allowing it ?
This is sloppy and from years ago but the "MiltaryBase" only allows infantry builds

The Infantry are the only ones that require the MB. The Armour doesn't e.g.


-
Did a quick scan did not see;
<property name="Unit Placement Restrictions" value="true" editable="false"> <boolean/> </property>Which I think requiresUnit to work.
Cheers