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

    Russian Revolution

    Scheduled Pinned Locked Moved Map Making
    48 Posts 3 Posters 9.1k Views 3 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.
    • VictoryFirstV Offline
      VictoryFirst
      last edited by VictoryFirst

      this post is deleted

      1 Reply Last reply Reply Quote 0
      • VictoryFirstV Offline
        VictoryFirst
        last edited by VictoryFirst

        this post is deleted

        1 Reply Last reply Reply Quote 1
        • VictoryFirstV Offline
          VictoryFirst
          last edited by VictoryFirst

          @wc_sumpton Awesome, I didn't know you could do all that stuff with conditions!

          Your idea was excellent and I think it should definitely work, but after I wrote it in the XML and tested it out, the revolution didn't trigger in the situation posted above, so I am wondering what I did wrong now...

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

            @wc_sumpton
            Never mind, I found the error. I had to specify the round in each condition for it to work!

            Thank you so much! You are a genius! I will test every possibility to make sure everything works, but I think these conditions will do it!

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

              @victoryfirst

              <attachment name="conditionAttachmentControlOrContestedPoland" attachTo="Germans" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
              	<option name="alliedOwnershipTerritories" value="Poland" count="1"/>
              	<option name="alliedPresenceTerritories" value="Poland" count="1"/>
              	<!-- This is not needed and should be removed <option name="conditionType" value="1-2"/> -->
              </attachment>
              

              Also you don't need to check for control/contested for the last four, so that was my mistake, sorry!

              Cheers...

              1 Reply Last reply Reply Quote 2
              • wc_sumptonW Offline
                wc_sumpton @VictoryFirst
                last edited by wc_sumpton

                @victoryfirst

                So your first 5 conditions should look like:

                <attachment name="conditionAttachmentControlOfTatarstan" attachTo="Germans" javaClass="RulesAttachment" type="player">
                	<option name="alliedOwnershipTerritories" value="Tatarstan" count="1"/>
                	<option name="enemyExclusionTerritories" value="Tatarstan" count="1"/>
                </attachment>
                <attachment name="conditionAttachmentControlOfUkraine" attachTo="Germans" javaClass="RulesAttachment" type="player">
                	<option name="alliedOwnershipTerritories" value="Ukraine" count="1"/>
                	<option name="enemyExclusionTerritories" value="Ukraine" count="1"/>
                </attachment>
                <attachment name="conditionAttachmentControlOfBelarus" attachTo="Germans" javaClass="RulesAttachment" type="player">
                	<option name="alliedOwnershipTerritories" value="Belarus" count="1"/>
                	<option name="enemyExclusionTerritories" value="Belarus" count="1"/>
                </attachment>
                <attachment name="conditionAttachmentControlOfKarelia" attachTo="Germans" javaClass="RulesAttachment" type="player">
                	<option name="alliedOwnershipTerritories" value="Karelia" count="1"/>
                	<option name="enemyExclusionTerritories" value="Karelia" count="1"/>
                </attachment>
                <attachment name="conditionAttachmentControlOfLivonia" attachTo="Germans" javaClass="RulesAttachment" type="player">
                	<option name="alliedOwnershipTerritories" value="Livonia" count="1"/>
                	<option name="enemyExclusionTerritories" value="Livonia" count="1"/>
                </attachment>
                

                But your last condition could look like:

                <!-- For this last condition I'm going to use "players" but Russia could be the "attachTo" -->
                <attachment name="conditionAttachmentRussianRevolution" attachTo="Germans" javaClass="RulesAttachment" type="player">
                	<option name="conditions" value="conditionAttachmentControlOfLivonia:conditionAttachmentControlOfKarelia:conditionAttachmentControlOfBelarus:conditionAttachmentControlOfUkraine:conditionAttachmentControlOfTatarstan"/>
                        <!-- conditionType 3-5 means 3 or more conditions must be true for the condition to be true -->
                	<option name="conditionType" value="3-5"/>
                	<!-- "players" will override "attachTo" to use in statements -->
                	<option name="players" value="Russians"/>
                	<!-- The Russians must own all 4 -->
                	<option name="alliedOwnershipTerritories" value="Poland:Sevastopol:Kazakhstan:Finland" count="4"/>
                	<!-- and Moscow -->
                	<option name="alliedOwnershipTerritories" value="Moscow" count="1"/>
                </attachment>
                

                Cheers...

                P.S. "Control" removed from last attachment name "conditionAttachmentRussianRevolution"

                Cheers...

                1 Reply Last reply Reply Quote 2
                • VictoryFirstV Offline
                  VictoryFirst
                  last edited by VictoryFirst

                  @wc_sumpton Everything works correctly! Again, I cannot thank you enough! :folded_hands:

                  I only have one more question, and that is about the trigger.

                  Suppose you have the following situation:
                  0558cc69-3f72-4bf6-a4b4-78921e3568b0-image.png

                  1 Reply Last reply Reply Quote 0
                  • VictoryFirstV Offline
                    VictoryFirst
                    last edited by VictoryFirst

                    The revolution triggers. This is what currently happens:

                    0c4d15d4-9f97-49b5-965d-7ed905c2fdf4-image.png

                    1 Reply Last reply Reply Quote 0
                    • VictoryFirstV Offline
                      VictoryFirst
                      last edited by

                      But this is what I want to happen:

                      dede218b-7438-43da-8750-0b85ae5bae6d-image.png

                      1 Reply Last reply Reply Quote 0
                      • VictoryFirstV Offline
                        VictoryFirst
                        last edited by VictoryFirst

                        @wc_sumpton

                        So in other words, is it possible to make all contested territories go to Neutral_Central (the beige color)?

                        <!-- Trigger for revolution -->
                        <attachment name="triggerAttachmentRussianRevolution" attachTo="Russians" javaClass="games.strategy.triplea.attachment.TriggerAttachment" type="player">
                        	<option name="removeUnits" value="ALL:ALL" count="9999"/> <!-- Removes all Russian units -->
                        <!-- Gives back to original owners -->
                        	<option name="changeOwnership" value="Serbia:Russians:Neutral_True:false"/>
                        	<option name="changeOwnership" value="Romania:Russians:Neutral_True:false"/>
                        	<option name="changeOwnership" value="Prussia:Russians:Germans:false"/>
                        	<option name="changeOwnership" value="Silesia:Russians:Germans:false"/>
                        	<option name="changeOwnership" value="Galicia:Russians:AustroHungarians:false"/>
                        	<option name="changeOwnership" value="Budapest:Russians:AustroHungarians:false"/>
                        	<option name="changeOwnership" value="Trieste:Russians:AustroHungarians:false"/>
                        	<option name="changeOwnership" value="Bohemia:Russians:AustroHungarians:false"/>
                        	<option name="changeOwnership" value="Vienna:Russians:AustroHungarians:false"/>
                        	<option name="changeOwnership" value="Bulgaria:Russians:Ottomans:false"/>
                        	<option name="changeOwnership" value="Mesopotamia:Russians:Ottomans:false"/>
                        	<option name="changeOwnership" value="Constantinople:Russians:Ottomans:false"/>
                        	<option name="changeOwnership" value="Persia:Russians:Neutral_True:false"/>
                        	<option name="changeOwnership" value="Afghanistan:Russians:Neutral_True:false"/>
                        <!-- Makes Russian territories impassable -->			
                        	<option name="changeOwnership" value="ALL:Russians:Contested:false"/>
                        
                        	<option name="when" value="before:germansPurchase"/>
                        
                        <!-- To make sure shared territories work properly -->
                        	<option name="relationshipChange" value="AustroHungarians:Neutral_Central:Friendly_Neutral:Allied"/>
                        	<option name="relationshipChange" value="Germans:Neutral_Central:Friendly_Neutral:Allied"/>
                        	<option name="relationshipChange" value="Ottomans:Neutral_Central:Friendly_Neutral:Allied"/>
                        	<option name="uses" value="1"/>
                        </attachment>
                        

                        Currently, all Russian units are removed and all Russian territories come under the control of the power "Contested" (the orange color). Is there a way to check during the trigger if a territory is contested and change the territory control to Neutral Central?

                        So what essentially happens is that the contested territories become "Shared", so to reflect this I set them to Neutral Central (so that there is a color difference with "Contested") and then I set the relationship to Alied (because per the rules Central Power units can move freely between shared territories, but can't capture them. The only neutral central on the board [Bulgaria] will be captured anyway so Neutral Central would serve no game purpose, that's why I decided to use them for shared territories.

                        wc_sumptonW 2 Replies Last reply Reply Quote 1
                        • wc_sumptonW Offline
                          wc_sumpton @VictoryFirst
                          last edited by

                          @victoryfirst

                          The problem here is with the use of "changeOwnerShip". Setting the value to "false" means treat this territory as if the New Owner owned that territory since the beginning of the turn. This is ok for territories Russia owns now and is not the original owner. But this does not work for contested territories that Russian originally owned but may not own now. This is why Finland and Karelia change orange, Russia owns those territories, and they are being given to Contested. Tatarstan on the other hand is German owned and is not affected.

                          Just like before, when check for the Russian Revolution, each Russian territory needs to be check for enemy units as well as their own units prior to changing their condition status. Because of this the removal of all Russian unit would be the last thing done.

                          Cheers...

                          1 Reply Last reply Reply Quote 3
                          • wc_sumptonW Offline
                            wc_sumpton @VictoryFirst
                            last edited by

                            @victoryfirst

                            Are you ready for a small lesson? First comes a variable list:

                            	<diceSides value="6"/>
                            <!-- Variable lists start after diceSides and before map -->
                            <variableList>
                            	<variable name="Border5">		<!-- 5 -->
                            		<element name="Livonia"/>
                            		<element name="Karelia"/>
                            		<element name="Belarus"/>
                            		<element name="Ukraine"/>
                            		<element name="Tatarstan"/>
                                </variable>
                            	<variable name="Other4">		<!-- 4 -->
                            		<element name="Poland"/>
                            		<element name="Sevastopol"/>
                            		<element name="Kazakhstan"/>
                            		<element name="Finland"/>
                                </variable>
                            	<variable name="All10">		<!-- 10 -->
                            		<element name="$Border5$"/>
                            		<element name="$Other4$"/>
                            		<element name="Moscow"/>
                                </variable>
                            </variableList>
                            <!-- The whole list ends prior to map -->
                            	<map>
                            

                            Why, because for me it's easier to create and follow.
                            For the revolution to complete, certain things have to happen, but because of the nature of these things, they should not all be called to happen within the same trigger. So, a switch is used to govern their actions.

                            <!-- Switch for Russian Revolution -->
                            <attachment name="conditionAttachmentRussianRevolutionSwitch" attachTo="Russians" javaClass="RulesAttachment" type="player">
                              <option name="switch" value="false"/>
                            </attachment>
                            

                            Conditions and triggers that loop through all 10 Russian originally owned territories to check their condition.

                            <!-- I'm using "foeach" to loop through all 10 territories -->
                            <!-- Check for Russian ownership -->
                            <attachment foreach="$All10$" name="conditionAttachmentRTO@All10@" attachTo="Russians" javaClass="RulesAttachment" type="player">
                            	<option name="alliedOwnershipTerritories" value="@All10@" count="1"/>
                            </attachment>
                            <!-- Check of presence of Russian units, regardless of ownership -->
                            <attachment foreach="$All10$" name="conditionAttachmentRUP@All10@" attachTo="Russians" javaClass="RulesAttachment" type="player">
                            	<option name="directPresenceTerritories" value="@All10@" count="1"/>
                            	<option name="unitPresence" value="ANY" count="1"/>
                            </attachment>
                            <!-- Going to add these together with an "OR" -->
                            <attachment foreach="$All10$" name="conditionAttachmentRCT@All10@" attachTo="Russians" javaClass="RulesAttachment" type="player">
                            	<option name="conditions" value="conditionAttachmentRTO@All10@:conditionAttachmentRUP@All10@"/>
                            	<option name="conditionType" value="OR"/>
                                    <!-- Also check for enemy -->
                            	<option name="enemyPresenceTerritories" value="@All10@" count="1"/>
                            	<option name="unitPresence" value="ANY" count="1"/>
                            </attachment>
                            <!-- The trigger will check if the territory is considered contested, and give ownership to Neutral_Central. -->
                            <attachment foreach="$All10$" name="tirggerAttachmentRCT@All10@" attachTo="Russians" javaClass="TriggerAttachment" type="player">
                                    <!-- Not only are the conditions set, but also the switch must be checked -->
                            	<option name="conditions" value="conditionAttachmentRCT@All10@:conditionAttachmentRussianRevolutionSwitch"/>
                                      <!-- We don't who owns the territory -->
                                     <option name="changeOwnership" value="@All10@:any:Neutral_Central:false"/>
                                    <!-- Because this trigger is not called, we will set "when" to check it -->
                            	<option name="when" value="after:germansUserActions"/>
                            	<option name="uses" value="1"/> <!-- Again, do only once -->
                            </attachment>
                            

                            Now to add your do everything trigger. The name needs to change, a condition added, and a when.

                            <attachment name="triggerAttachmentRussianRevolutionEverythingElse" attachTo="Russians" javaClass="TriggerAttachment" type="player">
                                  <!-- Add a condition to check the switch -->
                                  <option name="conditions" value="conditionAttachmentRussianRevolutionSwitch"/>
                            	<option name="removeUnits" value="ALL:ALL" count="9999"/> <!-- Removes all Russian units -->
                            <!-- Gives back to original owners -->
                            	<option name="changeOwnership" value="Serbia:Russians:Neutral_True:false"/>
                            	<option name="changeOwnership" value="Romania:Russians:Neutral_True:false"/>
                            	<option name="changeOwnership" value="Prussia:Russians:Germans:false"/>
                            ...
                            ...
                            ...
                                  <option name="uses" value="1"/>
                                  <!-- And set the "when" -->
                                  <!-- We want this to happen after the territories are check, -->
                                  <!-- which is after the user action. -->
                                  <!-- So, it'll be set before purchase, the next step -->
                                  <option name="when" value="before:germansPurchase"/>
                            </attachment>
                            

                            This new trigger is used to change the switch

                            <attachment name="triggerAttachmentRussianRevolution" attachTo="Russians" javaClass="TriggerAttachment" type="player">
                               <!-- This will change the switch to true -->
                               <!-- Which means it can't happen unless invoked -->
                               <!-- Which is already done by your other trigger -->
                               <option name="conditions" value="conditionAttachmentRussianRevolutionSwitch"/>
                               <option name="playerAttachmentName" value="RulesAttachment" count="conditionAttachmentRussianRevolutionSwitch"/>
                               <option name="playerProperty" value="switch" count="true"/>
                               <option name="uses" value="1"/>
                            </attachment>
                            

                            It's a lot, so take your time.

                            Cheers...

                            1 Reply Last reply Reply Quote 3
                            • VictoryFirstV Offline
                              VictoryFirst
                              last edited by VictoryFirst

                              This looks very promising, although unfortunately I was unable to get it to work. All territories become controlled by "Contested", but the contested territories don't become controlled by Neutral_Central.

                              <!-- Switch for Russian Revolution -->
                              <attachment name="conditionAttachmentRussianRevolutionSwitch" attachTo="Russians" javaClass="games.strategy.triplea.attachment.RulesAttachment" type="player">
                              	<option name="switch" value="false"/>
                              </attachment>
                              <!-- Check for Russian ownership -->
                              <attachment foreach="$All10$" name="conditionAttachmentRTO@All10@" attachTo="Russians" javaClass="games.strategy.triplea.attachment.RulesAttachment" type="player">
                              	<option name="alliedOwnershipTerritories" value="@All10@" count="1"/>
                              </attachment>
                              <!-- Check of presence of Russian units, regardless of ownership -->
                              <attachment foreach="$All10$" name="conditionAttachmentRUP@All10@" attachTo="Russians" javaClass="games.strategy.triplea.attachment.RulesAttachment" type="player">
                              	<option name="directPresenceTerritories" value="@All10@" count="1"/>
                              	<option name="unitPresence" value="ANY" count="1"/>
                              </attachment>
                              <!-- Going to add these together with an "OR" -->
                              <attachment foreach="$All10$" name="conditionAttachmentRCT@All10@" attachTo="Russians" javaClass="games.strategy.triplea.attachment.RulesAttachment" type="player">
                              	<option name="conditions" value="conditionAttachmentRTO@All10@:conditionAttachmentRUP@All10@"/>
                              	<option name="conditionType" value="OR"/>
                              	<!-- Also check for enemy -->
                              	<option name="enemyPresenceTerritories" value="@All10@" count="1"/>
                              	<option name="unitPresence" value="ANY" count="1"/>
                              </attachment>
                              <!-- The trigger will check if the territory is considered contested, and give ownership to Neutral_Central. -->
                              <attachment foreach="$All10$" name="triggerAttachmentRCT@All10@" attachTo="Russians" javaClass="games.strategy.triplea.attachment.TriggerAttachment" type="player">
                              	<!-- Not only are the conditions set, but also the switch must be checked -->
                              	<option name="conditions" value="conditionAttachmentRCT@All10@:conditionAttachmentRussianRevolutionSwitch"/>
                                  	<!-- We don't know who owns the territory -->
                                   	<option name="changeOwnership" value="@All10@:any:Neutral_Central:false"/>
                                  	<!-- Because this trigger is not called, we will set "when" to check it -->
                              	<option name="uses" value="1"/>
                              	<option name="when" value="after:germanUserActions"/>
                              </attachment> 
                              

                              <!-- All those conditions for the RR to trigger -->

                              <!-- Trigger for revolution -->
                              <attachment name="triggerAttachmentRussianRevolutionEverythingElse" attachTo="Russians" javaClass="games.strategy.triplea.attachment.TriggerAttachment" type="player">
                              	<option name="conditions" value="conditionAttachmentRussianRevolutionSwitch"/>
                              	<option name="when" value="before:germansPurchase"/>	
                              	<!-- Removes all Russian units -->
                              	<option name="removeUnits" value="ALL:ALL" count="9999"/>
                              	<!-- Gives back to original owners -->	
                              	<option name="changeOwnership" value="Serbia:Russians:Neutral_True:false"/>
                              	<option name="changeOwnership" value="Romania:Russians:Neutral_True:false"/>
                              	<option name="changeOwnership" value="Prussia:Russians:Germans:false"/>
                              	<option name="changeOwnership" value="Silesia:Russians:Germans:false"/>
                              	<option name="changeOwnership" value="Galicia:Russians:AustroHungarians:false"/>
                              	<option name="changeOwnership" value="Budapest:Russians:AustroHungarians:false"/>
                              	<option name="changeOwnership" value="Trieste:Russians:AustroHungarians:false"/>
                              	<option name="changeOwnership" value="Bohemia:Russians:AustroHungarians:false"/>
                              	<option name="changeOwnership" value="Vienna:Russians:AustroHungarians:false"/>
                              	<option name="changeOwnership" value="Bulgaria:Russians:Ottomans:false"/>
                              	<option name="changeOwnership" value="Mesopotamia:Russians:Ottomans:false"/>
                              	<option name="changeOwnership" value="Constantinople:Russians:Ottomans:false"/>
                              	<option name="changeOwnership" value="Persia:Russians:Neutral_True:false"/>
                              	<option name="changeOwnership" value="Afghanistan:Russians:Neutral_True:false"/>
                              	<!-- Makes Russian territories impassable -->			
                              	<option name="changeOwnership" value="ALL:Russians:Contested:false"/>
                              	<!-- To make sure shared territories work properly -->
                              	<option name="relationshipChange" value="AustroHungarians:Neutral_Central:Friendly_Neutral:Allied"/>
                              	<option name="relationshipChange" value="Germans:Neutral_Central:Friendly_Neutral:Allied"/>
                              	<option name="relationshipChange" value="Ottomans:Neutral_Central:Friendly_Neutral:Allied"/>
                              	<option name="uses" value="1"/>
                              </attachment>
                              
                              <attachment name="triggerAttachmentRussianRevolution" attachTo="Russians" javaClass="games.strategy.triplea.attachment.TriggerAttachment" type="player">
                              	<option name="conditions" value="conditionAttachmentRussianRevolutionSwitch"/>
                              	<option name="playerAttachmentName" value="RulesAttachment" count="conditionAttachmentRussianRevolutionSwitch"/>
                              	<option name="playerProperty" value="switch" count="true"/>
                              	<option name="uses" value="1"/>
                              </attachment>
                              
                              <!-- User action -->
                              <attachment name="userActionAttachmentRussianRevolution" attachTo="Germans" javaClass="games.strategy.triplea.attachment.UserActionAttachment" type="player">
                              	<option name="conditions" value="conditionAttachmentRound1:conditionAttachmentControl3Of5:conditionAttachmentControlOrContested1Of4:conditionAttachmentMoscowRussianControlled"/>
                              	<option name="conditionType" value="AND"/>
                              
                              	<option name="text" value="Russian_Revolution"/>
                              	<option name="chance" value="6:6"/>
                              	<option name="activateTrigger" value="triggerAttachmentRussianRevolution:1:true:false:false:false"/>
                              </attachment>
                              
                              1 Reply Last reply Reply Quote 0
                              • VictoryFirstV Offline
                                VictoryFirst
                                last edited by

                                @wc_sumpton

                                eb729bf2-e16c-46a6-8f86-44d86e970ae5-image.png

                                So the switch is set to true but "triggerAttachmentRCT@All10@" still does not trigger for some reason...

                                wc_sumptonW 2 Replies Last reply Reply Quote 0
                                • wc_sumptonW Offline
                                  wc_sumpton @VictoryFirst
                                  last edited by

                                  @victoryfirst

                                  So this is what I'm getting in the history:

                                  Capture.PNG

                                  It is only doing those trigger that match the conditions. I set the map with your earlier picture. Such that both Finland and Karelia were both Russian controlled but held German units to be contested and Tatarstan was German controlled contested by Russia.

                                  Without more information, it hard for me to tell what might be wrong.

                                  @victoryfirst said in Russian Revolution:

                                  So the switch is set to true but "triggerAttachmentRCT@All10@" still does not trigger for some reason...
                                  As can be seen triggerAttachmentRCT@All10@ get converted into its separate pieces.

                                  Cheers...

                                  1 Reply Last reply Reply Quote 2
                                  • wc_sumptonW Offline
                                    wc_sumpton @VictoryFirst
                                    last edited by

                                    @victoryfirst

                                    I'm still looking at this, could you tell me where your variable list are?

                                    Cheers...

                                    VictoryFirstV 2 Replies Last reply Reply Quote 2
                                    • VictoryFirstV Offline
                                      VictoryFirst @wc_sumpton
                                      last edited by

                                      @wc_sumpton

                                      I think I found it...
                                      1a617da2-ce18-4b66-ad41-2cb2aa51ff62-image.png

                                      Heh heh it was funny because I couldn't spot the mistake so I went to bed and at that moment I realized "germanPurchase" was spelled wrong. I missed it when looking at the screen and realized it when not 🙂

                                      1 Reply Last reply Reply Quote 2
                                      • VictoryFirstV Offline
                                        VictoryFirst @wc_sumpton
                                        last edited by VictoryFirst

                                        @wc_sumpton

                                        Well, what can I say... it works perfectly!

                                        cfce1bd6-225c-49d8-b712-349d117679fd-image.png

                                        Thank you so much! I didn't know you could do all this cool stuff! I have certainly learned a lot just working on this!

                                        So, I now know how you can chain multiple conditions. You can set conditionType to set which of those conditions need to be true. You can use the switch to turn on other triggers that can't be otherwise activated. However I still don't completely understand how "foreach" works. So when in a condition, you provide a list of territories, and it will loop through all those territories and check something for all of them. But what is the result of that condition? Is that also a list with a true/false for each territory?

                                        And what exactly happens here?

                                        <!-- Going to add these together with an "OR" -->
                                        <attachment foreach="$All10$" name="conditionAttachmentRCT@All10@" attachTo="Russians" javaClass="games.strategy.triplea.attachment.RulesAttachment" type="player">
                                        	<option name="conditions" value="conditionAttachmentRTO@All10@:conditionAttachmentRUP@All10@"/>
                                        	<option name="conditionType" value="OR"/>
                                        	<!-- Also check for enemy -->
                                        	<option name="enemyPresenceTerritories" value="@All10@" count="1"/>
                                        	<option name="unitPresence" value="ANY" count="1"/>
                                        </attachment>
                                        

                                        So here you have conditions in conditions?

                                        And this trigger with "foreach", will it check if one of the territories has "true", then loop through the list and change ownership of all the territories that have "true"?

                                        <!-- The trigger will check if the territory is considered contested, and give ownership to Neutral_Central. -->
                                        <attachment foreach="$All10$" name="triggerAttachmentRCT@All10@" attachTo="Russians" javaClass="games.strategy.triplea.attachment.TriggerAttachment" type="player">
                                        	<!-- Not only are the conditions set, but also the switch must be checked -->
                                        	<option name="conditions" value="conditionAttachmentRCT@All10@:conditionAttachmentRussianRevolutionSwitch"/>
                                            	<!-- We don't know who owns the territory -->
                                             	<option name="changeOwnership" value="@All10@:ANY:Neutral_Central:false"/>
                                            	<!-- Because this trigger is not called, we will set "when" to check it -->
                                        	<option name="uses" value="1"/>
                                        	<option name="when" value="after:germansUserActions"/>
                                        </attachment>
                                        
                                        wc_sumptonW 1 Reply Last reply Reply Quote 3
                                        • wc_sumptonW Offline
                                          wc_sumpton @VictoryFirst
                                          last edited by

                                          @victoryfirst

                                          "foreach" is a writing convention. Instead of writing 10 block of code, write 1 and the engine creates the 10 blocks. To see how this works, first load your map. In the menu in the upper left corner there is Export and under that is Export game.xml File (Bata). After saving open the file and you should see:

                                                  <attachment name="conditionAttachmentRTOLivonia" attachTo="Russians" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
                                                      <option name="alliedOwnershipTerritories" value="1:Livonia"/>
                                                  </attachment>
                                                  <attachment name="conditionAttachmentRTOKarelia" attachTo="Russians" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
                                                      <option name="alliedOwnershipTerritories" value="1:Karelia"/>
                                                  </attachment>
                                                  <attachment name="conditionAttachmentRTOBelarus" attachTo="Russians" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
                                                      <option name="alliedOwnershipTerritories" value="1:Belarus"/>
                                                  </attachment>
                                                  <attachment name="conditionAttachmentRTOUkraine" attachTo="Russians" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
                                                      <option name="alliedOwnershipTerritories" value="1:Ukraine"/>
                                                  </attachment>
                                                  <attachment name="conditionAttachmentRTOTatarstan" attachTo="Russians" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
                                                      <option name="alliedOwnershipTerritories" value="1:Tatarstan"/>
                                                  </attachment>
                                                  <attachment name="conditionAttachmentRTOPoland" attachTo="Russians" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
                                                      <option name="alliedOwnershipTerritories" value="1:Poland"/>
                                                  </attachment>
                                                  <attachment name="conditionAttachmentRTOSevastopol" attachTo="Russians" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
                                                      <option name="alliedOwnershipTerritories" value="1:Sevastopol"/>
                                                  </attachment>
                                                  <attachment name="conditionAttachmentRTOKazakhstan" attachTo="Russians" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
                                                      <option name="alliedOwnershipTerritories" value="1:Kazakhstan"/>
                                                  </attachment>
                                                  <attachment name="conditionAttachmentRTOFinland" attachTo="Russians" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
                                                      <option name="alliedOwnershipTerritories" value="1:Finland"/>
                                                  </attachment>
                                                  <attachment name="conditionAttachmentRTOMoscow" attachTo="Russians" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
                                                      <option name="alliedOwnershipTerritories" value="1:Moscow"/>
                                                  </attachment>
                                          

                                          So, the engine creates the difference condition.

                                          Cheers...

                                          1 Reply Last reply Reply Quote 3

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