Navigation

    TripleA Logo

    TripleA Forum

    • Register
    • Login
    • Search
    • TripleA Website
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Tags

    Remove Units

    Map Making
    2
    7
    403
    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
      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
      • W
        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
          beelee @wc_sumpton last edited by

          @wc_sumpton lol yea that makes a hell of lot more sense

          😆 😆 😆

          I'll give it a go.

          Thanks

          1 Reply Last reply Reply Quote 0
          • B
            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
              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
              • W
                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!!😁 🤞 ☝ 👍

                Cheers...

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

                  @wc_sumpton oh not having 4 conditions was definitely help

                  😄

                  1 Reply Last reply Reply Quote 1
                  • 1 / 1
                  • First post
                    Last post
                  Copyright © 2016-2018 TripleA-Devs | Powered by NodeBB Forums