TripleA Logo TripleA Forum
    • TripleA Website
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Tags
    • Register
    • Login

    Remove Units

    Scheduled Pinned Locked Moved Map Making
    7 Posts 2 Posters 995 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B Offline
      beelee
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • wc_sumptonW Offline
        wc_sumpton
        last edited by

        @beelee

        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...

        B 2 Replies Last reply Reply Quote 1
        • B Offline
          beelee @wc_sumpton
          last edited by

          @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

          1 Reply Last reply Reply Quote 0
          • B Offline
            beelee @wc_sumpton
            last edited by

            @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.

            1 Reply Last reply Reply Quote 0
            • B Offline
              beelee
              last edited by

              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>

              1 Reply Last reply Reply Quote 1
              • wc_sumptonW Offline
                wc_sumpton
                last edited by wc_sumpton

                @beelee

                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...

                B 1 Reply Last reply Reply Quote 1
                • B Offline
                  beelee @wc_sumpton
                  last edited by

                  @wc_sumpton oh not having 4 conditions was definitely help

                  :grinning_face_with_smiling_eyes:

                  1 Reply Last reply Reply Quote 1

                  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
                  • 1 / 1
                  • First post
                    Last post
                  Copyright © 2016-2018 TripleA-Devs | Powered by NodeBB Forums