Change control of naval mine (AA unit)
-
Sometimes the naval mines in the game I am working on get captured by naval victories and are therefore controlled by the wrong nation because they function as Anti-Aircraft. I am trying to make a trigger to replace these mines with the correct ones if that happens, but it does not work.
<attachment name="conditionAttachmentWrongMineSZ11" attachTo="Russians" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <option name="alliedPresenceTerritories" value="SZ 11"/> <option name="unitPresence" value="mines" count="1"/> </attachment> <attachment name="triggerAttachmentChangeToBerlinMine" attachTo="Germans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="conditions" value="conditionAttachmentWrongMineSZ11"/> <option name="changeOwnership" value="SZ 11:ANY:Germans:true"/> <option name="when" value="before:russiansNonCombatMove"/> <option name="when" value="before:frenchNonCombatMove"/> <option name="when" value="before:britishNonCombatMove"/> <option name="when" value="before:italiansNonCombatMove"/> <option name="when" value="before:americansNonCombatMove"/> <option name="when" value="before:austrohungariansNonCombatMove"/> <option name="when" value="before:germansNonCombatMove"/> <option name="when" value="before:ottomansNonCombatMove"/> </attachment>
I checked and the condition works, but the trigger doesn't change the mine to a German one.
-
All I did was add a territory attachment for SZ 11.
<attachment name="territoryAttachment" attachTo="SZ 11" javaClass="games.strategy.triplea.attachments.TerritoryAttachment" type="territory"> <option name="captureUnitOnEnteringBy" value="Germans"/> </attachment>
Territories marked as "isWater" do not require territory attachments.
Cheers...
-
Thank you, it works now! Awesome!