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

    Negative Support Attachment Does Not Work

    Scheduled Pinned Locked Moved Map Making
    6 Posts 3 Posters 1.0k Views 3 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.
    • RogerCooperR Offline
      RogerCooper
      last edited by

      I am trying to prevent enemy units from firing if aircraft our present. I am using the following supportattachment

      <attachment name="supportAttachmentFighterEnemy" attachTo="fighter" javaClass="games.strategy.triplea.attachments.UnitSupportAttachment" type="unitType">
        <option name="unitType" value="infantry:artillery:armour_ge"/>
        <option name="faction" value="enemy"/>
        <option name="side" value="offence"/>
        <option name="dice" value="strength"/>
        <option name="bonus" value="-3"/>
        <option name="number" value="99"/>
        <option name="bonusType" value="air"/>
        <option name="impArtTech" value="false"/>
      </attachment>
      

      Am I doing something wrong here? Or are negative bonuses not allowed?

      redrumR C 2 Replies Last reply Reply Quote 0
      • redrumR Offline
        redrum Admin @RogerCooper
        last edited by

        @RogerCooper Should work. Can you post a battle screenshot showing it not working? That support attachment should make any enemy inf/art/armour have -3 attack if a fighter is present on defense.

        TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

        1 Reply Last reply Reply Quote 0
        • RogerCooperR Offline
          RogerCooper
          last edited by

          I realized that side should be "defence" but fixing the code doesn't solve it.

          Here are my attachments, which are intended to prevent non-air units from firing if air units are on the attack (combat is only 1 round)

          <attachment name="supportAttachmentFighterAllied" attachTo="fighter" javaClass="games.strategy.triplea.attachments.UnitSupportAttachment" type="unitType">
            <option name="unitType" value="infantry:artillery:armour"/>
            <option name="faction" value="allied"/>
            <option name="side" value="offence"/>
            <option name="dice" value="strength"/>
            <option name="bonus" value="-3"/>
            <option name="number" value="99"/>
            <option name="bonusType" value="air"/>
            <option name="impArtTech" value="false"/>
          </attachment>
          <attachment name="supportAttachmentFighterEnemy" attachTo="fighter" javaClass="games.strategy.triplea.attachments.UnitSupportAttachment" type="unitType">
            <option name="unitType" value="infantry:artillery:armour_ge"/>
            <option name="faction" value="enemy"/>
            <option name="side" value="defence"/>
            <option name="dice" value="strength"/>
            <option name="bonus" value="-3"/>
            <option name="number" value="99"/>
            <option name="bonusType" value="air"/>
            <option name="impArtTech" value="false"/>
          </attachment>
          <attachment name="supportAttachmentBomberAllied" attachTo="bomber" javaClass="games.strategy.triplea.attachments.UnitSupportAttachment" type="unitType">
            <option name="unitType" value="infantry:artillery:armour"/>
            <option name="faction" value="allied"/>
            <option name="side" value="offence"/>
            <option name="dice" value="strength"/>
            <option name="bonus" value="-3"/>
            <option name="number" value="99"/>
            <option name="bonusType" value="air"/>
            <option name="impArtTech" value="false"/>
          </attachment>
          <attachment name="supportAttachmentBomberEnemy" attachTo="bomber" javaClass="games.strategy.triplea.attachments.UnitSupportAttachment" type="unitType">
            <option name="unitType" value="infantry:artillery:armour_ge"/>
            <option name="faction" value="enemy"/>
            <option name="side" value="defence"/>
            <option name="dice" value="strength"/>
            <option name="bonus" value="-3"/>
            <option name="number" value="99"/>
            <option name="bonusType" value="air"/>
            <option name="impArtTech" value="false"/>
          </attachment>
          

          combat.png

          This is a version of the D-day scenario, so the German units defend at 2.

          1 Reply Last reply Reply Quote 0
          • C Offline
            Cernel Moderators @RogerCooper
            last edited by

            @RogerCooper You need to specify the players. Don't forget Neutral, in case.

            Personally, I much dislike that if not specified it applies to none. I would change the behaviour as if not specified it applies to all, but this would bug off a few games (shouldn't be too hard to track them, but some may be overlooked, as that's usually used in complex maps when you give support with triggers during them). Of course, also with the ability to have it and leaving it empty (to define it applies to none).

            RogerCooperR 1 Reply Last reply Reply Quote 1
            • C Offline
              Cernel Moderators
              last edited by

              Also, moving to Mapmaking.

              We should really define better what is the difference between Maps & Mods and Mapmaking, because, as it is, we might as well merge the two. I would reserve Maps & Mods for the official threads only.

              1 Reply Last reply Reply Quote 0
              • RogerCooperR Offline
                RogerCooper @Cernel
                last edited by

                @Cernel Thanks for the help. This is working

                <attachment name="supportAttachmentFighterAllied" attachTo="fighter" javaClass="games.strategy.triplea.attachments.UnitSupportAttachment" type="unitType">
                  <option name="unitType" value="infantry:artillery:armour"/>
                  <option name="faction" value="allied"/>
                  <option name="side" value="offence"/>
                  <option name="dice" value="strength"/>
                  <option name="bonus" value="-3"/>
                  <option name="number" value="99"/>
                  <option name="bonusType" value="air"/>
                  <option name="impArtTech" value="false"/>
                  <option name="players" value="British:Americans"/>
                </attachment>
                <attachment name="supportAttachmentFighterEnemy" attachTo="fighter" javaClass="games.strategy.triplea.attachments.UnitSupportAttachment" type="unitType">
                  <option name="unitType" value="infantry:artillery:armour_ge"/>
                  <option name="faction" value="enemy"/>
                  <option name="side" value="offence"/>
                  <option name="dice" value="strength"/>
                  <option name="bonus" value="-3"/>
                  <option name="number" value="99"/>
                  <option name="bonusType" value="air"/>
                  <option name="impArtTech" value="false"/>
                  <option name="players" value="British:Americans"/>
                </attachment>
                <attachment name="supportAttachmentBomberAllied" attachTo="bomber" javaClass="games.strategy.triplea.attachments.UnitSupportAttachment" type="unitType">
                  <option name="unitType" value="infantry:artillery:armour"/>
                  <option name="faction" value="allied"/>
                  <option name="side" value="offence"/>
                  <option name="dice" value="strength"/>
                  <option name="bonus" value="-3"/>
                  <option name="number" value="99"/>
                  <option name="bonusType" value="air"/>
                  <option name="impArtTech" value="false"/>
                  <option name="players" value="British:Americans"/>
                </attachment>
                <attachment name="supportAttachmentBomberEnemy" attachTo="bomber" javaClass="games.strategy.triplea.attachments.UnitSupportAttachment" type="unitType">
                  <option name="unitType" value="infantry:artillery:armour_ge"/>
                  <option name="faction" value="enemy"/>
                  <option name="side" value="offence"/>
                  <option name="dice" value="strength"/>
                  <option name="bonus" value="-3"/>
                  <option name="number" value="99"/>
                  <option name="bonusType" value="air"/>
                  <option name="impArtTech" value="false"/>
                  <option name="players" value="British:Americans"/>
                </attachment>
                
                1 Reply Last reply Reply Quote 0

                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