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

    Condition counting the exact number of units in a territory?

    Scheduled Pinned Locked Moved Map Making
    8 Posts 4 Posters 2.1k Views 4 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.
    • A Offline
      Azimuth
      last edited by

      Second question (I thought it is better to open another post, please let me know if I am wrong)

      I use many occurences of conditions testing the exact number of units. But I had to write a lot of conditions to have it working. Example:

      <attachment foreach="$Integer$" name="conditionAttachment_Player_Has_@Integer@_Unit" attachTo="Player" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
                <option name="directPresenceTerritories" value="Territory"/>
      	  <option name="unitPresence" value="unit" count="@Integer@"/>
      </attachment>
      ...
      <attachment foreach="$Integer$" name="conditionAttachment_Player_Does_Not_Have_@Integer@_Unit" attachTo="Player" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
                <option name="conditions" value="conditionAttachment_Player_Has_@Integer@_Unit"/>
      	  <option name="invert" value="true"/>
      </attachment>
      

      Which seemed necessary to test then:

      <attachment name="conditionAttachment_Player_Has_Exactly_5_Unit" attachTo="Player" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
                <option name="conditions" value="conditionAttachment_Player_Has_5_Unit:conditionAttachment_Player_Does_Not_Have_6_Unit"/>
      </attachment>
      

      Do you see another (lighter) way?

      Thanks!

      TheDogT 1 Reply Last reply Reply Quote 2
      • TheDogT Online
        TheDog @Azimuth
        last edited by

        @azimuth
        Download this map, it might have something of interest, it is by one of Devs.
        imperialism_1974_board_game

        Search for ^ = Nesting to produce an array amongst other things

        https://forums.triplea-game.org/tags/thedog
        https://forums.triplea-game.org/topic/3741/curated-best-top-maps-triplea-guides

        A 1 Reply Last reply Reply Quote 3
        • A Offline
          Azimuth @TheDog
          last edited by

          @thedog Thank you, interesting features.

          But no, unfortunately, doesn't solve my question.

          1 Reply Last reply Reply Quote 2
          • cameronC Offline
            cameron
            last edited by

            this topic was helpful to me in sorting out an objective i had in mind albeit in a different way... so thanks!

            what i wanted was an objective that gave +X PUs / Y units. instead i went with +1PU for each territory with at least 4 of a specific unit:

                <!-- Martians Objectives -->
                <!-- Marsforming: +1PU for each territory with at least 4 redweed -->
                    <attachment name="objectiveAttachmentMarsforming" attachTo="Martians" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
            		<option name="objectiveValue" value="1"/>
            		<option name="directPresenceTerritories" value="map" count="each"/>
            		<option name="unitPresence" value="redweed" count="4"/>
            	</attachment>
            

            so what i'd like to know is could i have done it as i'd originally intended? ie can i get the game to count all of a specific unit type controlled by a player on the map and do something with it?
            in particular i was thinking of a Martian Victory Condition that triggers if they have 50 (or probably more?) redweed units on the map...
            btw redweed is just a martian land version of Nemo Pirates' kelp farms - A0/D0/M0 unit that free spawns (1/turn) from another unit. (yeah, i'm still messing about with the Steampunk map)

            sorry for the babble; i was hoping that context might make things clearer; but probably did the opposite...

            W 1 Reply Last reply Reply Quote 2
            • W Offline
              wc_sumpton @cameron
              last edited by

              @cameron said in Condition counting the exact number of units in a territory?:

              so what i'd like to know is could i have done it as i'd originally intended? ie can i get the game to count all of a specific unit type controlled by a player on the map and do something with it?

              Sorry, this has been asked many times. You can count the territories, ie; directPresenceTerritories=map=50, unitPresence=any=1 would tell you if there were 50 territories with units, but you can't count for 50 units on the map.

              Again sorry.

              Cheers...

              1 Reply Last reply Reply Quote 1
              • cameronC Offline
                cameron
                last edited by

                bah. oh well. thanks for the reply.

                A 1 Reply Last reply Reply Quote 1
                • A Offline
                  Azimuth @cameron
                  last edited by

                  @cameron As I stated in my opening post, I was looking for a lighter way. But I think you can achieve what you want, but with a lot of variables and triggers.

                  • You need $Territories$ with the list of territories where your redweed can appear (hopefully not all map territories, hence it is possible)
                  • You need $Integer$ with the list of integers (from 1 to... the max build cap - mandatory to have one)
                  • You need a specific territory (can be out of the map) where to pile, let's say, Victory Points (VPs) a specific unit.

                  Then you need conditions checking for each integer and each territory (see my examples above) the number of redweed per territory.

                  Then you need triggers that place VPs into the selected territory.

                  And finally you make an objective checking the number of VPs in the selected territory.

                  Not sure it is worth it. But theoretically possible.

                  cameronC 1 Reply Last reply Reply Quote 3
                  • cameronC Offline
                    cameron @Azimuth
                    last edited by

                    @azimuth
                    [[laughs]] that sounds like a nightmare. i feel like the objective for it would end up being 80+% of the xml file... (not ALL the territories - just the land ones...)
                    i'll most likely be the only person who ever plays this mod and i tend to ignore victory triggers anyway - i'm a conquer the whole world kinda player. 🙂

                    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