Trouble capturing friendly units
-
I'm trying to create additional minor powers that function similarly to the "Neutral_Axis" in ww2global40. For example, if Germany sends a tank into Spanish territory during Germany's non-combat move, then Germany should gain control of the territory and the Spanish units in that territory should be replaced by equivalent German units.
However, this replacement is only working for my Neutral_Axis countries. It is not working for the Spanish. German tanks can enter Spain and take it over on non-combat, but the Spanish units remain Spanish. I do not want the Spanish units to remain Spanish; instead, they should become German.
I have double-checked my game properties, player attachments, territory attachments, and unit attachments. What else could I be missing that is causing the Spanish units to refuse to change sides?
GAME PROPERTIES
<property name="Capture Units On Entering Territory" value="true" editable="false"> <boolean/> </property> <property name="On Entering Units Destroyed Instead Of Captured" value="false" editable="false"> <boolean/> </property> <!-- specific rules --> <!-- land related --> <property name="Units Can Be Destroyed Instead Of Captured" value="true" editable="false"> <boolean/> </property> <property name="Units Can Be Changed On Capture" value="true" editable="true"> <boolean/> </property>
PLAYER ATTACHMENTS
<attachment name="playerAttachment" attachTo="Spanish" javaClass="games.strategy.triplea.attachments.PlayerAttachment" type="player"> <option name="captureUnitOnEnteringBy" value="Germans:Italians:Japanese"/> </attachment>
ILLUSTRATION
UNIT ATTACHMENTS
<attachment name="unitAttachment" attachTo="infantry" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType"> <option name="movement" value="1"/> <option name="transportCost" value="2"/> <option name="isInfantry" value="true"/> <option name="attack" value="1"/> <option name="defense" value="2"/> <option name="artillerySupportable" value="true"/> <option name="isAirTransportable" value="true"/> <option name="canBeCapturedOnEnteringBy" value="French:Americans:British:Russians:Germans:Italians:Japanese:Commonwealth:Chinese"/> <option name="canBeGivenByTerritoryTo" value="Turkish:Russians:Spanish:Portuguese:British:Germans:Italians:Americans:French:Commonwealth"/> </attachment>
TERRITORY ATTACHMENTS
<attachment name="territoryAttachment" attachTo="Aragon" javaClass="games.strategy.triplea.attachments.TerritoryAttachment" type="territory"> <option name="production" value="1"/> <option name="captureUnitOnEnteringBy" value="Germans:Italians:Japanese"/> <option name="changeUnitOwners" value="Spanish"/> </attachment> <attachment name="territoryAttachment" attachTo="Galicia Navarra" javaClass="games.strategy.triplea.attachments.TerritoryAttachment" type="territory"> <option name="production" value="0"/> <option name="captureUnitOnEnteringBy" value="Germans:Italians:Japanese"/> <option name="changeUnitOwners" value="Spanish"/> </attachment> <attachment name="territoryAttachment" attachTo="Castilla" javaClass="games.strategy.triplea.attachments.TerritoryAttachment" type="territory"> <option name="production" value="1"/> <option name="captureUnitOnEnteringBy" value="Germans:Italians:Japanese"/> <option name="changeUnitOwners" value="Spanish"/> </attachment>
-
Just had a similar discussion with @SlendyMcTendies. Chech this out and see if it helps you: https://forums.triplea-game.org/topic/3600/change-unit-ownership-resolved/15.
Cheers...
-
@wc_sumpton Thank you, ensuring there was only one playerAttachment per Player did the trick! The Spanish are now truckling under as ordered.