Help with trigger activating a supportAttachment


  • Admin

    I hope someone can help 😕

    I want to make a trigger that fires when a specific unit is in a specific place. The trigger must turn on a supportattachment that makes a specific unit support itself +1 AA when on offence and on defense.

    On my World of War Heroes map it is like this:
    When the unit “Amulet-of-Accuracy” is present in the territory “Arthur Backpack” then the unit “Arthur” is henceforth affected by a support attachment where “Arthur” supports himself.

    I have tried to make the supports attachment, the condition and the trigger. But it does not seem to work. The unit "Arthur" does is not become +1 stronger in AA when it comes down to it. Is there anyone who can spot why this does not work?

        <attachment name="supportAttachmentHero-of-Humans-uses-Amulet-of-Accuracy" attachTo="Arthur" javaClass="games.strategy.triplea.attachments.UnitSupportAttachment" type="unitType">
            <option name="unitType" value="Arthur"/>
            <option name="faction" value="allied"/>
            <option name="side" value="offence:defence"/>
            <option name="dice" value="AAstrength"/>
            <option name="bonus" value="1"/>
            <option name="number" value="1"/>
            <option name="bonusType" value="Amulet of Accuracy +1 Ranged Power"/>
        </attachment>
    

    (...)

        <attachment name="conditionAttachmenHumans-have-Amulet-of-Accuracy-in-backpack" attachTo="Humans" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
            <option name="directPresenceTerritories" value="Arthur Backpack" count="1"/>
            <option name="unitPresence" value="Amulet-of-Accuracy" count="1"/>
        </attachment>
    
        <attachment name="triggerAttachmentHero_of_Humans_has_the_Amulet-of-Accuracy" attachTo="Humans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
            <option name="conditions" value="conditionAttachmenHumans-have-Amulet-of-Accuracy-in-backpack"/>
            <option name="support" value="supportAttachmentHero-of-Humans-uses-Amulet-of-Accuracy"/>
            <option name="uses" value="1"/>
        </attachment>
    

    Unavngivet.png


  • Admin

    @Frostion You should probably add a "when" to the trigger. Are you seeing the trigger fire and the support attachment not work or are you not seeing the trigger fire at all?


  • Admin

    I dont see the the trigger activating in history. I will try to add a "when" and see what happens ☺


  • Admin

    I added a “when” to this trigger, but it still did not work.
    Then I redefined the “whens” of other triggers also belonging to the “Humans” player, as there were other triggers also firing at the same time (after humansEndturn).

    Suddenly it worked! 😃 Arthur can now use the Medallion of Accuracy item in combination with his new Magic Bow ranged weapon. I hope it will keep on working even after I add some more item triggers to the map.

    Right now Arthur the Paladin is ready to take on the evil red dragon that is tormenting Northshire 😉

    Unavngivet.png


  • Admin

    @Frostion Good to hear. My general advice is that you should make sure that all triggers specify "when" otherwise I think you can sometimes get strange behavior and are relying on some magic trigger defaults on when they fire.

    Also, I'm guessing you are using SupportAttachments for the items instead of just having them increase the base values as there are multiple items that could increase the AA strength for heroes?


Log in to reply