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

    Reference the PU Value of a Territory in Triggers?

    Scheduled Pinned Locked Moved Map Making
    19 Posts 3 Posters 2.5k 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.
    • Jason Green-LoweJ Offline
      Jason Green-Lowe @wc_sumpton
      last edited by

      @wc_sumpton Removing the players and when statements from the condition did not help. When I use:

          <attachment foreach="$TwoValueTerritories$^$Players$:$Phases$" name="conditionAttachmentMakeRailroad@Players@In@TwoValueTerritories@" attachTo="@Players@" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
            <option name="directPresenceTerritories" value="@TwoValueTerritories@" count="1"/>
            <option name="unitPresence" value="factory_minor:factory_major" count="1"/>
          </attachment>
          
          <attachment foreach="$TwoValueTerritories$^$Players$:$Phases$" name="triggerAttachmentMakeRailroad@Players@In@TwoValueTerritories@" attachTo="@Players@"
          javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
            <option name="conditions" value="conditionAttachmentMakeRailroad@Players@In@TwoValueTerritories@"/>
            <option name="when" value="after:@Phases@"/>
            <option name="players" value="@Players@"/>
            <option name="placement" value="@TwoValueTerritories@:railroad" count="2"/>
          </attachment> 
      

      I get this error message:

      Could not parse:file:///C:/Users/jason/triplea/downloadedMaps/bbr5/games/bbr5.xml, Missing property definition for option 'directPresenceTerritories' in attachment 'conditionAttachmentMakeRailroadGermansInNormandy Bordeaux'  games.strategy.engine.data.gameparser.GameParseException: Missing property definition for option 'directPresenceTerritories' in attachment 'conditionAttachmentMakeRailroadGermansInNormandy Bordeaux'
      

      I have tested the code with a one-word territory name, and the space in the name does not seem to be the problem; I get the same error message for, e.g., Denmark.

      1 Reply Last reply Reply Quote 0
      • Jason Green-LoweJ Offline
        Jason Green-Lowe @wc_sumpton
        last edited by

        @wc_sumpton Never mind, I see the problem -- I had my condition using "TriggerAttachment" instead of "RulesAttachment." No wonder it couldn't find "DirectPresenceTerritories."

        1 Reply Last reply Reply Quote 2
        • Jason Green-LoweJ Offline
          Jason Green-Lowe @wc_sumpton
          last edited by

          @wc_sumpton I think this is going to work! Thanks for all the help. 🙂

          wc_sumptonW 1 Reply Last reply Reply Quote 2
          • wc_sumptonW Offline
            wc_sumpton @Jason Green-Lowe
            last edited by

            @jason-green-lowe

            Good find on the 'RulesAttachment' and 'TriggerAttachment'. Happy to hear everything is working.👍

            Cheers...

            Jason Green-LoweJ 1 Reply Last reply Reply Quote 2
            • Jason Green-LoweJ Offline
              Jason Green-Lowe @wc_sumpton
              last edited by

              @wc_sumpton All right, one last issue on this feature. I also want to remove all the railroads from the map at the end of each player's turn, but the code below does not seem to have any effect. It runs OK, but it does nothing. Any idea why?

                  <attachment name="triggerAttachmentGermansDestroyRailroad" attachTo="Germans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
                    <option name="when" value="after:germansNonCombatMove"/>
                    <option name="removeUnits" value="all:railroad" count="20"/>
                  </attachment>
              
              wc_sumptonW 1 Reply Last reply Reply Quote 0
              • wc_sumptonW Offline
                wc_sumpton @Jason Green-Lowe
                last edited by

                @jason-green-lowe

                May need a condition to activate. TripleA engine can sometimes be tricky about such things.

                 <attachment name="conditionAttachment_AlwaysTrue" attachTo="Germans" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
                   <option name="switch" value="true"/>
                </attachment>
                

                Nice thing about a switch is it can be referenced by all players.

                Cheers...

                Jason Green-LoweJ 1 Reply Last reply Reply Quote 2
                • Jason Green-LoweJ Offline
                  Jason Green-Lowe @wc_sumpton
                  last edited by

                  @wc_sumpton Amazing. That does it! Railroads are now appearing and disappearing on schedule. You've made the trains run on time...thank you. 🙂

                  f2a552dd-3590-4d63-b159-2f37ca730aaa-image.png

                  wc_sumptonW B 2 Replies Last reply Reply Quote 3
                  • wc_sumptonW Offline
                    wc_sumpton @Jason Green-Lowe
                    last edited by

                    @jason-green-lowe
                    👍

                    Cheers...

                    1 Reply Last reply Reply Quote 0
                    • B Offline
                      beelee @Jason Green-Lowe
                      last edited by

                      @jason-green-lowe that's a cool lookin map. Is that the blood bath one ?

                      Jason Green-LoweJ 1 Reply Last reply Reply Quote 1
                      • Jason Green-LoweJ Offline
                        Jason Green-Lowe @beelee
                        last edited by

                        @beelee Yup!

                        B 1 Reply Last reply Reply Quote 1
                        • B Offline
                          beelee @Jason Green-Lowe
                          last edited by

                          @jason-green-lowe sweet never seen it on triplea before. Nice job. Look forward to checkin it out

                          1 Reply Last reply Reply Quote 1

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