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

    combined condition attachment for triggers

    Scheduled Pinned Locked Moved Map Making
    31 Posts 5 Posters 6.3k Views 5 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

      @numetalfan

      Hi all,

      <attachment name="conditionAttachmentXYZ" attachTo="Germans:Italians:Japanese" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">

      does not work

      <attachment name="conditionAttachmentXYZ" attachTo="Germans"
      plus one for Italians plus one for Japanese might work but looks ugly and doesn't seem sophisticated

      and <attachment name="conditionAttachmentXYZ" attachTo="Axis" may not fit to type="player", as the Axis are an Alliance not a single player.

      What is the correct solution to this problem?

      Add in:

      <option name="players" value="Germans:Italians:Japanese"/>
      

      This option makes the condition effect all the players in an OR relationship.

      @numetalfan

      second question:

      is it possible to make a count condition?

      Let's say a national objective, where e.g. US gets as many IPC as the Chinese have countries with each country is worth 1 IPC.

      Is this possible?

      Im not sure on how/if you could do this elegantly in a single objectiveAttachment.

      If you want some future help, I found that browsing the XML browser can be really useful.

      N 2 Replies Last reply Reply Quote 0
      • N Offline
        Numetalfan @Zaroph
        last edited by

        @zaroph said in combined condition attachment for triggers:

        <option name="players" value="Germans:Italians:Japanese"/>

        Thanks, tested - it works, had to remove the ..attach to.. of course

        I check the http://www.starlords3k.com/XOB.html
        out frequently, however sometimes the examples are not clear enough or too unspecific. despite that a very fine site.

        1 Reply Last reply Reply Quote 0
        • N Offline
          Numetalfan @Zaroph
          last edited by

          @zaroph

          strange, it worked but now there is an error.

          <attachment name="conditionAttachmentVichyFrancecaptured" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
          <option name="players" value="Germans:Italians:Japanese"/>
          <option name="directOwnershipTerritories" value="Vishy France"/>
          </attachment>

          is it correct that way?
          Is it correct to remove the
          attachTo="..."

          HeppsH 1 Reply Last reply Reply Quote 0
          • HeppsH Offline
            Hepps Moderators @Numetalfan
            last edited by

            @numetalfan said in combined condition attachment for triggers:

            <option name="directOwnershipTerritories" value="Vishy France"/>

            Your problem may stem from how you spelt "Vichy" at the end of that trigger

            "A joyous heart sours with the burden of expectation"
            Hepster

            N 1 Reply Last reply Reply Quote 0
            • N Offline
              Numetalfan @Hepps
              last edited by

              @hepps

              good point,

              but it is
              <territory name="Vishy France"/>

              that fits to
              <option name="directOwnershipTerritories" value="Vishy France"/>

              so this is not the reason

              N 1 Reply Last reply Reply Quote 0
              • N Offline
                Numetalfan @Numetalfan
                last edited by

                6294640d-9b74-4714-ae1a-ff1ab001bf82-grafik.png

                1 Reply Last reply Reply Quote 0
                • wc_sumptonW Offline
                  wc_sumpton
                  last edited by

                  @Numetalfan

                  You still need 'attachTo'.

                  When you use 'players', 'attachTo' will be added:

                  <attachment name="conditionAttachmentVichyFrancecaptured" attachTo="Germans" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
                  <option name="players" value="Germans:Italians:Japanese"/>
                  <option name="directOwnershipTerritories" value="Vishy France"/>
                  </attachment>
                  

                  will work the same as:

                  <attachment name="conditionAttachmentVichyFrancecaptured" attachTo="Germans" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
                  <option name="players" value="Italians:Japanese"/>
                  <option name="directOwnershipTerritories" value="Vishy France"/>
                  </attachment>
                  

                  Cheers...

                  N 1 Reply Last reply Reply Quote 1
                  • N Offline
                    Numetalfan @wc_sumpton
                    last edited by

                    here we go again

                    general question to trigger conditions

                    is it possible to combine several "when" conditions?

                    something like...

                    <option name="when" value="after:britishCombatMove:after:americanCombatMove"/>

                    wc_sumptonW 1 Reply Last reply Reply Quote 0
                    • wc_sumptonW Offline
                      wc_sumpton @Numetalfan
                      last edited by

                      @Numetalfan

                      Yes, just not the way you show it:

                         <option name="when" value="after:britishCombatMove"/>
                         <option name="when" value="after:americanCombatMove"/>
                      

                      Will allow the same trigger to fire after both British and American combat moves.

                      Cheers...

                      N 1 Reply Last reply Reply Quote 1
                      • N Offline
                        Numetalfan @wc_sumpton
                        last edited by

                        @wc_sumpton

                        perfect! that's what I am looking for

                        N 1 Reply Last reply Reply Quote 0
                        • N Offline
                          Numetalfan @Numetalfan
                          last edited by

                          Next one:

                          *conditionType Attachment option
                          Parents:
                          userActionAttachment Options for actions
                          politicalActionAttachment Options for politics
                          conditionAttachment Options for conditions
                          objectiveAttachment Options for objectives
                          triggerAttachment Options for triggers
                          Parameters:
                          value: AND, OR, XOR, y, y-z. Defaults to AND if missing.

                          Defines the relationship the conditions must have if there are more than one condition or rules attachment in the trigger.
                          AND means all conditions must be true.
                          OR means just one condition must be true.
                          XOR means that only one condition must be true while all others must be false.
                          'y' is an exact number of conditions
                          'y-z' is a range of numbers.
                          This option will overwrite prior occurences of itself.*

                          1. Is it possible to combine OR and AND

                          somenthing like ("A" or "B") AND "C"
                          in one single statement ?

                          1. If not possible in 1),

                          is it possible to have several
                          <option name='conditions'
                          in one statement ?

                          something like

                          <attachment name='userActionAttachment_Americans_Aid_UK' attachTo='Americans' javaClass='UserActionAttachment' type='player'>
                          <option name='conditions' value='conditionA'/>
                          <option name='conditions' value='conditionB'/>

                          <option name='activateTrigger' value='triggerAttachment_Americans_Aid_UK:1:false:false:false:false'/>
                          <option name='text' value='AMERICANS_AID_UK'/>
                          ...

                          this would mean one of them can be OR/XOR while the other one is "normal"

                          wc_sumptonW 1 Reply Last reply Reply Quote 0
                          • wc_sumptonW Offline
                            wc_sumpton @Numetalfan
                            last edited by

                            @numetalfan

                            Simple answer is no you can not have multiple 'conditionType' in a condition statement, as you stated. The best way to handle something like ("A" or "B") and "C" would be to put "A" and "B" in its own condition statement, then add that statement as a condition when checking "C".

                            Cheers...

                            N 1 Reply Last reply Reply Quote 1
                            • N Offline
                              Numetalfan @wc_sumpton
                              last edited by

                              @wc_sumpton

                              understood, thx

                              N 1 Reply Last reply Reply Quote 0
                              • N Offline
                                Numetalfan @Numetalfan
                                last edited by

                                next one:

                                ..
                                <relationship type="Neutrality" player1="Germans" player2="Russians" roundValue="1"/>
                                <relationship type="Neutrality" player1="Italians" player2="Russians" roundValue="1"/>
                                ..

                                <attachment name="conditionAttachment_Germans_Not_At_War_With_Russians" attachTo="Germans" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">

                                <option name="relationship" value="Germans:Russians:anyWar"/>
                                <option name="invert" value="true"/>

                                </attachment>

                                ...

                                and

                                ..

                                <attachment name="politicalActionAttachment_Germans_To_War_With_Russians" attachTo="Germans" javaClass="games.strategy.triplea.attachments.PoliticalActionAttachment" type="player">

                                <option name="conditions" value="conditionAttachment_Germans_Not_At_War_With_Russians"/>

                                <option name="relationshipChange" value="Germans:Russians:War"/>

                                <option name="relationshipChange" value="Italians:Russians:War"/>

                                <option name="text" value="Germany and Italy at war with Russia"/>
                                </attachment>

                                should change War to both, Germany and Italy at the same time
                                possible ?

                                wc_sumptonW 1 Reply Last reply Reply Quote 0
                                • wc_sumptonW Offline
                                  wc_sumpton @Numetalfan
                                  last edited by wc_sumpton

                                  @numetalfan

                                  Should, but what is the relationship between Germany and Italy? If the relationship is "Allied" and 'alliancesCanChainTogether' is true then it would be unnecessary to set both players if it is Germany or Italy declaring war. Of course if "War" has 'isDefaultWarPosition' set 'True' and Russia declares war on either Germany or Italy then they will be at war with both players.

                                  But yes you should be able to change any number of relationships with a single trigger.

                                  Cheers...

                                  N 1 Reply Last reply Reply Quote 1
                                  • N Offline
                                    Numetalfan @wc_sumpton
                                    last edited by

                                    <attachment name="XYZ" attachTo="British" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
                                    <option name="when" value="after:britishCombatMove"/>
                                    <option name="conditions" value="conditionAttachmentABC"/>
                                    <option name="removeUnits" value="8 Sea Zone:bigdestroyer" count="1"/>
                                    <option name="placement" value="8 Sea Zone:destroyer" count="1"/>
                                    </attachment>

                                    so this trigger works, yet it removes excatly 1 unit and replaces it by excatly 1 unit of the other type

                                    I want this one to work any time, so 5 bigdestroyers will be replaced by 5 destroyer,
                                    3 by 3 and so on

                                    count="1-+"

                                    does not work

                                    Any help?

                                    B 1 Reply Last reply Reply Quote 0
                                    • B Online
                                      beelee @Numetalfan
                                      last edited by

                                      @numetalfan to remove them you can use "all".

                                      <option name="removeUnits" value="all:Rail" count="2"/>

                                      Unfortunately that doesn't really help, as it doesn't know how many to place. The only way I know of, is to make a different condition/trigger for the number of units.

                                      You don't wanna go too huge or it'll slow the game down. At least it seemed like it to me. But you could try 3 or 5 and then use edit for anything more.

                                      N 1 Reply Last reply Reply Quote 0
                                      • N Offline
                                        Numetalfan @beelee
                                        last edited by

                                        @beelee

                                        thx. So did I, but now the programm is doing stupid things:

                                        If Germany buy one submarine and places that in SZ5,

                                        there is a condition
                                        <attachment name="conditionAttachmentSubGSZ5" attachTo="Germans" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
                                        <option name="directPresenceTerritories" value="5 Sea Zone"/>
                                        <option name="players" value="Germans:Italians:Japanese"/>
                                        <option name="unitPresence" value="submarine" count= "1"/>
                                        </attachment>

                                        and a trigger

                                        <attachment name="G2subSZ5ET" attachTo="Germans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
                                        <option name="when" value="after:germanEndTurn"/>
                                        <option name="conditions" value="conditionAttachment2SubGSZ5:conditionAttachmentAxisholdGermany"/>
                                        <option name="removeUnits" value="5 Sea Zone:submarine" count="2"/>
                                        <option name="placement" value="5 Sea Zone:submarine_in_sub_bunker" count="2"/>
                                        </attachment>

                                        this one works well, the exchange works

                                        N 1 Reply Last reply Reply Quote 0
                                        • N Offline
                                          Numetalfan @Numetalfan
                                          last edited by

                                          oops wrong trigger

                                          <attachment name="GsubSZ5ET" attachTo="Germans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
                                          <option name="when" value="after:germanEndTurn"/>
                                          <option name="conditions" value="conditionAttachmentSubGSZ5:conditionAttachmentAxisholdGermany"/>
                                          <option name="removeUnits" value="5 Sea Zone:submarine" count="1"/>
                                          <option name="placement" value="5 Sea Zone:submarine_in_sub_bunker" count="1"/>
                                          </attachment>

                                          N 1 Reply Last reply Reply Quote 0
                                          • N Offline
                                            Numetalfan @Numetalfan
                                            last edited by

                                            but if Germany buys 2 subs

                                            there are 2 conditions - one for 1 sub and one for 2 subs

                                            <attachment name="conditionAttachmentSubGSZ5" attachTo="Germans" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
                                            <option name="directPresenceTerritories" value="5 Sea Zone"/>
                                            <option name="players" value="Germans:Italians:Japanese"/>
                                            <option name="unitPresence" value="submarine" count= "1"/>
                                            </attachment>

                                            <attachment name="conditionAttachment2SubGSZ5" attachTo="Germans" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
                                            <option name="directPresenceTerritories" value="5 Sea Zone"/>
                                            <option name="players" value="Germans:Italians:Japanese"/>
                                            <option name="unitPresence" value="submarine" count= "2"/>
                                            </attachment>

                                            and 2 triggers

                                            <attachment name="GsubSZ5ET" attachTo="Germans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
                                            <option name="when" value="after:germanEndTurn"/>
                                            <option name="conditions" value="conditionAttachmentSubGSZ5:conditionAttachmentAxisholdGermany"/>
                                            <option name="removeUnits" value="5 Sea Zone:submarine" count="1"/>
                                            <option name="placement" value="5 Sea Zone:submarine_in_sub_bunker" count="1"/>
                                            </attachment>

                                            <attachment name="G2subSZ5ET" attachTo="Germans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
                                            <option name="when" value="after:germanEndTurn"/>
                                            <option name="conditions" value="conditionAttachment2SubGSZ5:conditionAttachmentAxisholdGermany"/>
                                            <option name="removeUnits" value="5 Sea Zone:submarine" count="2"/>
                                            <option name="placement" value="5 Sea Zone:submarine_in_sub_bunker" count="2"/>
                                            </attachment>

                                            but instead of using the second trigger, the programming is using both 😞

                                            G2subSZ75ET: has removed 2 submarines owned by Germans in 75 Sea Zone
                                            G2subSZ75ET: Germans has 2 submarine_in_sub_bunkers placed in 75 Sea Zone
                                            GsubSZ75ET: Germans has 1 submarine_in_sub_bunker placed in 75 Sea Zone

                                            So: buying 2 subs, means 1+2 = 3 converted units
                                            buying 3 subs, means 1+2+3 = 6 converted untis

                                            how to avoid that ?

                                            1 Reply Last reply Reply Quote 0

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