Remove Units
-
I'm trying to remove a unit when only 1 or 2 of the same unit are present. I made these two conditions:
<attachment name="conditionAttachment_WolfpackRemove2" attachTo="Germans" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
<option name="unitPresence" value="GermanUBoat" count="2"/>
</attachment><attachment name="conditionAttachment_WolfpackRemove1" attachTo="Germans" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
<option name="unitPresence" value="GermanUBoat" count="1"/>
</attachment><attachment name="conditionAttachment_WolfpackRemove1And2" attachTo="Germans" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <option name="conditions" value="conditionAttachment_WolfpackRemove2:conditionAttachment_WolfpackRemove1"/> <option name="conditionType" value="OR"/> </attachment>That removes the unit but also when there are 3 or more of the units present. Then I added this, so it wouldn't remove it, when 3 of them were present but now it won't remove it at all, even with only 1 or 2 present.
<attachment name="conditionAttachment_WolfpackStay" attachTo="Germans" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <option name="unitPresence" value="GermanUBoat" count="3"/> <option name="invert" value="true"/> </attachment><attachment name="conditionAttachment_WolfpackRemove" attachTo="Germans" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
<option name="conditions" value="conditionAttachment_WolfpackRemove1And2:conditionAttachment_WolfpackStay"/>
<option name="conditionType" value="AND"/>
</attachment>Here's the trigger:
<attachment name="triggerAttachment_Germans_RemoveWolfpackSZ112" attachTo="Germans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
<option name="conditions" value="conditionAttachment_WolfpackRemove"/>
<option name="removeUnits" value="112 Sea Zone:Wolfpack" count="1"/>
<option name="when" value="before:germansNonCombatMove"/>
</attachment>Anyone know of a way to do this ?
Thanks
-
Why so many conditions? From what I summarize, the only condition to check for is less then 3, the last condition. If there is 0, 1 or 2 subs remove 1.
Let me know what I am missing.
Cheers...
-
@wc_sumpton lol yea that makes a hell of lot more sense
:grinning_squinting_face: :grinning_squinting_face: :grinning_squinting_face:
I'll give it a go.
Thanks
-
@wc_sumpton well bummer. That didn't work. Doesn't remove anything. Seems that it should. The only time it removed anything was when I didn't use the invert condition and then it removed all the time.
-
yay success

I added a "directPresenceTerritories" to the condition
<attachment name="conditionAttachment_WolfpackRemove" attachTo="Germans" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
<option name="directPresenceTerritories" value="112 Sea Zone" count="1"/>
<option name="unitPresence" value="GermanUBoat" count="3"/>
<option name="invert" value="true"/>
</attachment> -
Yea!!! I was wondering about 'directPresenceTerritories' also. Was hoping that using just one condition would be easer to debug.
So happy you got there without any help!!:beaming_face_with_smiling_eyes: :crossed_fingers: :index_pointing_up: :thumbs_up:
Cheers...
-
@wc_sumpton oh not having 4 conditions was definitely help
:grinning_face_with_smiling_eyes:
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login