Navigation

    TripleA Logo

    TripleA Forum

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

    User action bug? or is this working as intended?

    Map Making
    2
    3
    259
    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.
    • F
      ff03k64 last edited by

      I have a user action that activates a trigger. That trigger does some stuff to units (promotions), and then changes the user action so that the next time it calls a different trigger (next promotion). I also have it change the text that gets displayed, but it is actually changing that before it gets displayed.
      Worded another way, I am giving a unit a promotion via user action, but i am getting the text for the next promotion after that.
      I am getting the correct stat changes though.

              <attachment name="conditionAttachmentSupportPromotion" attachTo="XCOM" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
                  <option name="switch" value="true"/>
              </attachment>
      
      		<attachment name="triggerAttachmentSupportSGT" attachTo="XCOM" javaClass="TriggerAttachment" type="player">
      			<option name="unitType" value="support"/>
      			<option name="unitAttachmentName" value="UnitAttachment" count="unitAttachment"/>
      			<option name="unitProperty" value="movement" count="-reset-2"/>
      			<option name="unitProperty" value="createsUnitsList" count="1:bandage"/>
      			<option name="playerAttachmentName" value="UserActionAttachment" count="userActionAttachment_support_promotion"/>
      			<option name="playerProperty" value="activateTrigger" count="-reset-triggerAttachmentSupportCAP:1:false:false:false:false"/>
      		       <option name="playerProperty" value="text" count="promote_support_cap"/>
      			<option name="playerProperty" value="costResources" count="-reset-350:XP"/>
      		</attachment>	
      
      		<attachment name="triggerAttachmentSupportCAP" attachTo="XCOM" javaClass="TriggerAttachment" type="player">
      			<option name="unitType" value="support"/>
      			<option name="unitAttachmentName" value="UnitAttachment" count="unitAttachment"/>
      			<option name="unitProperty" value="createsUnitsList" count="-reset-1:densesmokegrenade"/>
      			<option name="unitProperty" value="createsUnitsList" count="1:bandage"/>
      			<option name="playerAttachmentName" value="UserActionAttachment" count="userActionAttachment_support_promotion"/>
      			<option name="playerProperty" value="activateTrigger" count="-reset-triggerAttachmentSupportCOL:1:false:false:false:false"/>
      			<option name="playerProperty" value="text" count="promote_support_col"/>
      			<option name="playerProperty" value="costResources" count="-reset-1000:XP"/>
      			</attachment>	
      
      		<attachment name="triggerAttachmentSupportCOL" attachTo="XCOM" javaClass="TriggerAttachment" type="player">
      			<option name="unitType" value="support"/>
      			<option name="unitAttachmentName" value="UnitAttachment" count="unitAttachment"/>
      			<option name="unitProperty" value="createsUnitsList" count="-reset-2:densesmokegrenade"/>
      			<option name="unitProperty" value="createsUnitsList" count="2:bandage"/>
      			<option name="playerAttachmentName" value="RulesAttachment" count="conditionAttachmentSupportPromotion"/>
      			<option name="playerProperty" value="switch" count="false"/>
      		</attachment>	
      
              <attachment name="userActionAttachment_support_promotion" attachTo="XCOM" javaClass="games.strategy.triplea.attachments.UserActionAttachment" type="player">
                  <option name="conditions" value="conditionAttachmentSupportPromotion"/>
                  <option name="text" value="promote_support_sgt"/>
                  <option name="costResources" value="100:XP"/>
                  <option name="attemptsPerTurn" value="1"/>
                  <option name="activateTrigger" value="triggerAttachmentSupportSGT:1:false:false:false:false"/>
              </attachment>
      1 Reply Last reply Reply Quote 0
      • W
        wc_sumpton last edited by

        @ff03k64

        Triggers without 'conditions', as I understand it, are always considered 'true' so the first 3 triggers are firing even without the 'activateTrigger' of another trigger. To keep these triggers from firing, create a 'false' condition:

        <attachment name="conditionAttachmentAlwaysFalse" attachTo="XCOM" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
           <option name="switch" value="false"/>
        </attachment>
        

        Then add that condition to the other trigger. Now these trigger will only be fired by the last trigger because 'testConditions' is set to 'false'.

        Hope this is helpful.

        Cheers...

        F 1 Reply Last reply Reply Quote 1
        • F
          ff03k64 @wc_sumpton last edited by

          @wc_sumpton I don't think that is the problem. I am basing this off of other maps that have fully functional user actions, and they don't have conditions in the activated triggers.

          This text change is also the only thing that isn't working correctly in those triggers.

          It seems like it is firing the trigger and making the change, and then calling the text to display, after it has changed it.

          As i read what I am typing, it doesn't seem like it is as clear as it could be, so please ask questions if it isn't clear.

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Copyright © 2016-2018 TripleA-Devs | Powered by NodeBB Forums