Quantcast

How to make a factory that can only produce Infantry?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to make a factory that can only produce Infantry?

Kalar
I'm trying to make a minor factory that can only produce infantry.

I've tried using the "requiresUnits" = "factory" on every non-infantry unit and they can still be placed in the minor factory's location.

I've tried making all starting factories the main factories and disallowing their production, and putting "unitPlacementRestrictions" = All locations that they aren't in and same thing. I can still make tanks/fighters/ships from minor factories.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to make a factory that can only produce Infantry?

Frostion
Have you set the following to true:

<property name="Unit Placement Restrictions" value="true" editable="false">
<boolean/>
</property>

I think this is required to make it work.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to make a factory that can only produce Infantry?

beelee
In reply to this post by Kalar
Hi Kalar

I recently made a unit that produces only infantry. I don't think you can use "isFactory". This is from POS2:

"isFactory is no longer its own variable. Instead isFactory just sets the above variables. setting is factory will possibly overwrite those variables, so do not use it if you are planning to set those variables to something else."
               
So I think it's overriding requiresUnits. So try removing isFactory and then requiresUnits should work. You'll have to add the factory stuff that you want separately. Such as isInfrastructure, well here's what I did, you probably don't need it all:

"<attachment name="unitAttachment" attachTo="MilitaryBase" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
<option name="isInfrastructure" value="true"/>
<option name="canBeDamaged" value="true"/>
<option name="maxDamage" value="6"/>
<option name="maxOperationalDamage" value="2"/>
<option name="isConstruction" value="true"/>
<option name="constructionType" value="MilitaryBase_structure"/>
<option name="constructionsPerTerrPerTypePerTurn" value="1"/>
<option name="maxConstructionsPerTypePerTerr" value="1"/>
<option name="movement" value="0"/>
<option name="isAAforBombingThisUnitOnly" value="true"/>
<option name="unitPlacementRestrictions" value="

So just give a reread on POS2 of what you want to add. Also if you want to restrict placement you can do by TTy PU value and not TTy specific. Ask again if you need to.

One problem I did run into that I couldn't solve is that I wanted the Base to only produce 3 max inf. In order to have inf still able to build max at factories though I had to set it to their max, which is 10, making it player enforced.

One other thing was it would max produce with 2 damage whereas the factory would only produce 1 or 2 if 1 damage. Maybe someone else knows if you can adjust that.
Loading...