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

    Help with trigger activating a supportAttachment

    Scheduled Pinned Locked Moved Map Making
    5 Posts 2 Posters 1.4k 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.
    • FrostionF Offline
      Frostion Admin
      last edited by Frostion

      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

      Map maker of: Star Wars: Galactic War + Star Wars: Tatooine War + Caribbean Trade War + Dragon War + Age of Tribes + Star Trek: Dilithium War + Iron War + Iron War: Europe + Warcraft: War Heroes

      redrumR 1 Reply Last reply Reply Quote 0
      • redrumR Offline
        redrum Admin @Frostion
        last edited by

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

        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 2
        • FrostionF Offline
          Frostion Admin
          last edited by

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

          Map maker of: Star Wars: Galactic War + Star Wars: Tatooine War + Caribbean Trade War + Dragon War + Age of Tribes + Star Trek: Dilithium War + Iron War + Iron War: Europe + Warcraft: War Heroes

          1 Reply Last reply Reply Quote 0
          • FrostionF Offline
            Frostion Admin
            last edited by

            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

            Map maker of: Star Wars: Galactic War + Star Wars: Tatooine War + Caribbean Trade War + Dragon War + Age of Tribes + Star Trek: Dilithium War + Iron War + Iron War: Europe + Warcraft: War Heroes

            redrumR 1 Reply Last reply Reply Quote 1
            • redrumR Offline
              redrum Admin @Frostion
              last edited by redrum

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

              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

              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
              Powered by NodeBB Forums