Having issue making a one time use UserActionAttachment with switch condition
-
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.
-
Your code seems to work, as long as "Player" accepts the user action, and not "No Actions" it was skipped.
Cheers...
-
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.
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