Navigation

    TripleA Logo

    TripleA Forum

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

    Reset Option

    Map Making
    5
    11
    771
    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.
    • Michael Hoover
      Michael Hoover last edited by

      There are a few places in the XML browser where it talks about resetting options:
      "This option may be cleared/reset by triggers if you want by prefixing with '-reset-'."

      Does anyone have an example of this? I'm taking it as if I had the following condition:
      <attachment name="conditionAttachment_WaxOn" attachTo="Player1" javaClass="RulesAttachment" type="player">
      <option name="switch" value="true"/>
      </attachment>

      Then I could reset this back to false by listing another condition like this:
      <attachment name="conditionAttachment_WaxOff" attachTo="Player1" javaClass="RulesAttachment" type="player">
      <option name="-reset-conditionattachment_WaxOn"/>
      </attachment>

      Sorry if I am confusing anyone but I am scratching my head on this one...

      C 1 Reply Last reply Reply Quote 0
      • LaFayette
        LaFayette Admin last edited by

        Can't answer your question, but I can point you to these examples that use a 'reset' option:

        • empire/map/games/Empire.xml
        • total_ancient_war/map/games/Total_Ancient_War.xml
        • a_song_of_ice_and_fire/map/games/A_Song_of_Ice_and_Fire.xml
        1 Reply Last reply Reply Quote 1
        • Michael Hoover
          Michael Hoover last edited by

          Thanks for the examples @LaFayette. That doesn't quite work the way I thought but at least I can quit barking up the wrong tree!

          1 Reply Last reply Reply Quote 0
          • LaFayette
            LaFayette Admin last edited by

            Just to be sure, it looks like there are a couple of variants, the second two example XMLs perhaps were slightly different. Afraid I can't say the usage of reset is super clear.

            1 Reply Last reply Reply Quote 0
            • C
              Cernel Moderators @Michael Hoover last edited by

              @Michael-Hoover There's actually no reason to use reset with boolean options (like the switch is), or any options accepting a single value, for this matter. Reset is for those items that would otherwise add the value or the values to any value or values already defined, if not cleared (by using reset).

              1 Reply Last reply Reply Quote 0
              • Michael Hoover
                Michael Hoover last edited by

                Ok. What about booleans by the way - is there a way to toggle them in game between true and false? Seems like the trigger conditions only fire if true, so I was thinking I would have to have a couple of booleans. One to toggle the other if that makes sense? Or if I am way off please let me know!

                C 1 Reply Last reply Reply Quote 0
                • C
                  Cernel Moderators @Michael Hoover last edited by

                  @Michael-Hoover Not sure what you mean. You can have a user action changing a condition switch between a true and false state, or having a boolean (not hardcoded) property called by a condition called by a trigger (respectively, for toggling during the game or before loading it).

                  Michael Hoover 1 Reply Last reply Reply Quote 0
                  • Captain Crunch
                    Captain Crunch Banned last edited by

                    *facepalm

                    1 Reply Last reply Reply Quote 0
                    • Michael Hoover
                      Michael Hoover @Cernel last edited by

                      @Cernel Huh...I was under the impression that you couldn't toggle game properties once the game starts, but if you can I'm pretty sure that would solve my issue. I'm half asleep so I'll revisit this in the morning. Thanks for all the help 👍

                      C 1 Reply Last reply Reply Quote 0
                      • C
                        Cernel Moderators @Michael Hoover last edited by

                        @Michael-Hoover You can (with some rare exceptions related to properties that set options). The most usual example is starting a game with Low Luck, then saving it, reloading it, disabling Low Luck and restarting it (thus playing it with regular dice, from that point on).

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

                          @Michael-Hoover as @Cernel stated "-reset-" is used to clear multiple values. You can use a "playerProperty" to change a "switch" value.

                          You stated:

                          <attachment name="conditionAttachment_WaxOn" attachTo="Player1" javaClass="RulesAttachment" type="player">
                             <option name="switch" value="true"/>
                          </attachment>
                          

                          Then you would need to create a condition for when to turn the switch to false:

                          <attachment name="conditionAttachment_TurnWaxOff" attachTo="Player1" javaClass="RulesAttachment" type="player">
                             <!-- Create the condition here -->
                          </attachment>
                          
                          

                          Then by checking the state of "conditionAttachment_TurnWaxOff" you could use this to then set "conditionAttachment_WaxOn" to "false":

                          <attachment name="conditionAttachment_WaxOff" attachTo="Player1" javaClass="TriggerAttachment" type="player">
                             <option name="conditions" value="conditionAttachment_TurnWaxOff"/>
                             <option name="players" value="Player1"/>
                             <option name="playerAttachmentName" value="RulesAttachment" count="conditionAttachment_WaxOn"/>
                             <option name="playerProperty" value="switch" count="false"/>
                          </attachment>
                          

                          To change "conditionAttachment_WaxOn" to false.

                          Hope this helps.

                          Cheers...

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