is requiresUnits still a valid property?
-
Newbie trying to learn the xml file properties...
Trying to create a bunker that needs an engineer present in order to construct.
But, game permits placement when no engineer in territory. What have I done wrong?<attachment name="unitAttachment" attachTo="bunker" javaClass="games.strategy.triplea.attachments.UnitAttachment"
type="unitType">
<option name="isConstruction" value="true"/>
<option name="constructionType" value="bunker"/>
<option name="constructionsPerTerrPerTypePerTurn" value="1"/>
<option name="maxConstructionsPerTypePerTerr" value="3"/>
<option name="attack" value="0"/>
<option name="defense" value="0"/>
<option name="movement" value="0"/>
<option name="requiresUnits" value="engineer"/>
</attachment> -
@mahks When options are ineffective, that probably means they are enabled by a property you don't have true.
In this case, "Unit Placement Restrictions". -
Moving to Mapmaking, if I'm guessing correctly that's the right place for the help and questions about mapmaking.
-
@mahks in case you're not aware of it here's a link explaining what they all do:
Pact of steel 2 explains some of them as well.
-
@cernel I'm kind of surprised there are not more questions about the properties. The only 2 resources I have found are those beelee mentions. I did see something about an old reference (from hithub site maybe) but have not found that.
Would it be useful to have a separate forum (category) for developer help?
-
@mahks This is mapmaking. Development is the engine / etc which is done on GitHub. Have a look at TWW xml since entrenchments and bunkers can't be placed without an engineer if I recall correctly.
-
@beelee Thanks, I have been using both those. The POS xml has been very useful.
The fandom wiki, less so, while it is good finding what is available, very few entries actually show how to implement the property. For example, in my case the entry for requiresUnits does not mention "Unit Placement Restrictions".Another thread mentioned a new developers guide. Yes, much need for that.
I can help. My ignorance can be useful to counter the natural reduction of perspective experienced developers have when creating such a guide. It is so easy to miss stuff newbies do not understand when you already know the whole framework.
-
@mahks Really it should be called a map makers guide. hopefully all of you can get together and we collaborate all of it in one spot. Gd stuff!
-
@cernel said in is requiresUnits still a valid property?:
@mahks When options are ineffective, that probably means they are enabled by a property you don't have true.
In this case, "Unit Placement Restrictions".I have found a unitAttachment property named unitPlacementRestrictions but seems not to be needed (in TWW xml) for what I want.
The wiki mentions "Unit Placement Restrictions" is a game option. Does that mean it should show under "Map Options" on the game play panel? Do not see it there and none of the xml files I have looked in seems to have a way to enable. What am I missing?
-
@mahks The game properties are usually listed towards the end of the xml itself. They are also listed in game options but only if set to be there via "editable" in the xml.
-
@mahks Here is the example POS2 XML for the necessary property:
<!-- 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>
You need to set that to 'true' and if you make editable='true' then it will appear in the game options as a checkbox.
-
@general_zod Hmmm, faulty search on my part. Found the section "propertyList" as you predicted, Thanks!