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

    Having issue making a one time use UserActionAttachment with switch condition

    Scheduled Pinned Locked Moved Map Making
    3 Posts 2 Posters 821 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.
    • Z Offline
      Zaroph
      last edited by Zaroph

      Im having an issue making a one time use UserAttachment with a switch condition.

      <attachment name="conditionAttachmentWillItWorkCondition" attachTo="Player" javaClass="RulesAttachment" type="player">
      <option name="switch" value="true"/>
      </attachment>
      
      <attachment name="triggerAttachmentWillItWorkTrigger" attachTo="Player" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
      <option name="playerAttachmentName" value="RulesAttachment" count="conditionAttachmentWillItWorkCondition"/>
      <option name="playerProperty" value="switch" count="false"/>
      </attachment>
      
      <attachment name="userActionAttachmentWillItWorkUser" attachTo="Player" javaClass="UserActionAttachment" type="player">
      <option name="conditions" value="conditionAttachmentWillItWorkCondition"/>
      <option name="activateTrigger" value="triggerAttachmentWillItWorkTrigger:1:false:false:false:false"/>
      <option name="text" value="WillItWork"/>
      <option name="chance" value="1:1"/>
      <option name="costResources" value="PUs" count="0"/>
      </attachment>
      

      The UserActionAttachment shows up during the players turn, (since the switch condition for the player is true) but after activating, it still shows up on subsequent turns even though the trigger should set the switch condition to false and therefore make it not show up. Im rather lost on how to make it work.

      W 1 Reply Last reply Reply Quote 0
      • W Offline
        wc_sumpton @Zaroph
        last edited by

        @zaroph

        Your code seems to work, as long as "Player" accepts the user action, and not "No Actions" it was skipped.

        Cheers...

        Z 1 Reply Last reply Reply Quote 1
        • Z Offline
          Zaroph @wc_sumpton
          last edited by

          Seems it wasnt working because I had the playerattachment for the player underneath all the triggers. Ty for confirming it works, it made me think of trying that.

          1 Reply Last reply Reply Quote 1

          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