Negative Support Attachment Does Not Work


  • Donators

    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?


  • Admin

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


  • Donators

    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.


  • Moderators

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


  • Moderators

    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.


  • Donators

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

Log in to reply