How to limit Factory/Facility Placement
-
I want this type of factory to only be placed in originally controlled territories that are worth "2" or more. However, the game engine allows this factory to also be placed in territories worth "1". What did I do wrong?
<attachment name="unitAttachment" attachTo="medium_factory" javaClass="UnitAttachment" type="unitType"> <option name="isFactory" value="true"/> <option name="maxConstructionsPerTypePerTerr" value="99"/> <option name="constructionsPerTerrPerTypePerTurn" value="99"/> <option name="canProduceXUnits" value="5"/> <option name="canOnlyBePlacedInTerritoryValuedAtX" value="2"/> <option name="special" value="canOnlyPlaceInOriginalTerritories"/> </attachment>
-
Do you have the following game option set:
<!-- Unit Placement Restrictions are restrictions on the placement of units: unitPlacementRestrictions, unitPlacementOnlyAllowedIn, canOnlyBePlacedInTerritoryValuedAtX, requiresUnits, --> <property name="Unit Placement Restrictions" value="true" editable="false"> <boolean/> </property>
Cheers...
-
Thank you very much, that worked!
I have now stumbled on another problem. The medium factory should allow 5 units to be placed, however, the game engine only allows a number of units up to the production value of that territory. Here are some of the properties I have set:
<property name="More Constructions with Factory" value="false" editable="false"> <boolean/> </property> <property name="More Constructions without Factory" value="false" editable="false"> <boolean/> </property> <property name="Unlimited Constructions" value="false" editable="false"> <boolean/> </property> <property name="Territory Turn Limit" value="false" editable="false"> <boolean/> </property> <property name="maxFactoriesPerTerritory" value="99"> <boolean/> </property> <property name="Placement Restricted By Factory" value="true" editable="false"> <boolean/> </property>
-
check the properties for EXP or G 40 2nd edition
They allow you to place whatever the unitAttachment allows
-
I have tried that and added all kinds of properties that had to do with factories, placements, and production that appeared in G40, but it hasn't worked so far.
-
I don't understand this at all. In the tooltip, it shows the factory unit can produce 5 units, yet when placing units you can only place 4 (because that's the IPC value of the territory). I have copied the exact code for the factories and the properties of Global 1940, and also gave the territory a unitProduction of 5, but it still doesn't work.
-
At this point it is very hard to determine what may be causing this problem. There are other options that can cause limits to placement.
placementLimit in playerAttachment and unitAttachment. Also, the property "Unit Placement Per Territory Restricted" might need to be changed to false. Likewise, if you use both "production" and "unitProduction" in territory attachments, "unitProduction" must come after "production", otherwise the "production" value will overwrite "unitProduction".
There may be another reason for this problem. At this point, without the more information, we are just shooting in the dark.
I am sorry about this. I hope that the above gives you some ideas.
Cheers...
-
I believe I finally found out the issue... I was searching online for the answer and I couldn't find it at first, until I finally came across a thread where someone had a similar problem, and the solution was to add the property Damage From Bombing Done To Units Instead Of Territories. That for some reason makes the canProduceXUnits to work.