Navigation

    TripleA Logo

    TripleA Forum

    • Register
    • Login
    • Search
    • TripleA Website
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Tags

    Having issue making a one time use UserActionAttachment with switch condition

    Map Making
    2
    3
    280
    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
      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
        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
          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
          • 1 / 1
          • First post
            Last post
          Copyright © 2016-2018 TripleA-Devs | Powered by NodeBB Forums