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

    Change maxBuiltPerPlayer by a trigger

    Scheduled Pinned Locked Moved Map Making
    12 Posts 4 Posters 434 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.
    • VictoryFirstV Offline
      VictoryFirst
      last edited by

      At the start of the game, the Axis powers have only one truck available to them (reflected by <option name="maxBuiltPerPlayer" value="1"/>)

      <attachment name="unitAttachment" attachTo="axis-truck" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
      	<option name="movement" value="2"/>
      	<option name="attack" value="0"/>
      	<option name="defense" value="0"/>
      	<!-- <option name="canBeDamaged" value="true"/> -->
      	<!-- <option name="maxDamage" value="1"/> -->
      	<!-- <option name="canDieFromReachingMaxDamage" value="true"/> -->
      	<option name="isLandTransport" value="true"/>
      	<option name="transportCapacity" value="6"/>
      	<option name="isLandTransportable" value="false"/>
      	<option name="isInfrastructure" value="true"/>
      	<option name="isAAmovement" value="true"/>
          <option name="destroyedWhenCapturedBy" value="British:Americans"/>
      	<option name="isConstruction" value="true"/>
        <option name="constructionsPerTerrPerTypePerTurn" value="1"/>
        <option name="maxConstructionsPerTypePerTerr" value="1"/>
        <option name="maxBuiltPerPlayer" value="1"/>
        <option name="constructionType" value="axis-truck"/>
      </attachment>
      

      At the start of round 7, the axis power should have an extra truck available. So the value needs to change to 2. Is it possible to do so via a trigger?

      TheDogT B 2 Replies Last reply Reply Quote 0
      • TheDogT Online
        TheDog @VictoryFirst
        last edited by

        @victoryfirst
        Maybe, try the following in a trigger with a condition

        <option name="unitType" value="axis-truck"/>
        <option name="unitProperty" value="maxBuiltPerPlayer" count="2"/>
        <option name="uses" value="1"/>
        

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

        1 Reply Last reply Reply Quote 3
        • B Offline
          beelee @VictoryFirst
          last edited by

          @victoryfirst

          Hi Victory

          If what the Dog suggested doesn't work try adding "UnitAttachmentName" to the trigger. Idk if it's needed but that's always the way I have done it.

          Screenshot from 2026-03-16 06-53-36.png

          So the above takes a defend zero Transport and makes it defend at 1. Should just be able to swap in the max built unitAttachment. And have a condition for whatever rd you want it to fire.

          You might want to set it to rd 2 for testing 🙂

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

            @beelee It worked!!

            <attachment name="triggerAttachmentAxisTruckLateWar" attachTo="Germans" javaClass="TriggerAttachment" type="player">
            	<option name="conditions" value="conditionAttachmentRound7"/>	
            	<option name="unitType" value="axis-truck"/>
            	<option name="unitAttachmentName" value="UnitAttachment" count="unitAttachment"/>
            	<option name="unitProperty" value="maxBuiltPerPlayer" count="2"/>
            	<option name="uses" value="1"/>
            	<option name="when" value="before:americansPurchase"/>
            </attachment>
            

            a84019bf-7fda-440f-b58b-45b2d82d3eb2-image.png

            RogerCooperR 1 Reply Last reply Reply Quote 3
            • RogerCooperR Offline
              RogerCooper @VictoryFirst
              last edited by

              @victoryfirst Could this be used to change any value on an unit attachment? Potentially very useful.

              For example, in Axis & Allies: Pacific, Commonwealth and American units have a defense strength of one on the first turn. They could start 1 and then be upgraded to their regular values at the end of the Japanese turn.

              B VictoryFirstV 3 Replies Last reply Reply Quote 2
              • B Offline
                beelee @RogerCooper
                last edited by

                @rogercooper said in Change maxBuiltPerPlayer by a trigger:

                Could this be used to change any value on an unit attachment?

                I believe so. I have used it for many different changes. It's in POS2

                Screenshot from 2026-03-18 19-52-17.png

                Not very detailed but redrum and hepps helped me figure it out and I just copied hepps stuff. 🙂

                Veqryn really did an amazing job with POS2.

                1 Reply Last reply Reply Quote 0
                • B Offline
                  beelee
                  last edited by beelee

                  @rogercooper said in Change maxBuiltPerPlayer by a trigger:

                  Could this be used to change any value on an unit attachment?

                  I believe so. I have used it for many different changes. It's in POS2

                  Screenshot from 2026-03-18 19-52-17.png

                  Not very detailed but redrum and hepps helped me figure it out and I just copied hepps stuff.

                  Veqryn really did an amazing job with POS2.

                  Edit
                  lol double post. Wouldn't let me delete.

                  Well veqryn deserves double recognition lol

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

                    @beelee You can edit your post and delete everything and then type "this post is deleted". That's what I always do 😅

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

                      <option name="unitAttachmentName" value="UnitAttachment" count="unitAttachment"/>
                      

                      Btw I must say that I love this line. It makes no sense at all lol

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

                        @rogercooper I was planning to work on an improved module for A&A Pacific. The_Good_Captain made a detailed bug report for that game. Were you planning to work on it as well or did you already start working on it? Perhaps we could do it together.

                        RogerCooperR 1 Reply Last reply Reply Quote 0
                        • RogerCooperR Offline
                          RogerCooper @VictoryFirst
                          last edited by

                          @victoryfirst said in Change maxBuiltPerPlayer by a trigger:

                          @rogercooper I was planning to work on an improved module for A&A Pacific. The_Good_Captain made a detailed bug report for that game. Were you planning to work on it as well or did you already start working on it? Perhaps we could do it together.

                          Go ahead on that mod. I am working on a different project East & West. Of course, I will be happy to help if you run into any problems.

                          One thing I am planning on doing with future mods is to include a standardized version using the v3 or v5 rules to make the game easier for casual players.

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

                            @rogercooper said in Change maxBuiltPerPlayer by a trigger:

                            @victoryfirst Could this be used to change any value on an unit attachment? Potentially very useful.

                            For example, in Axis & Allies: Pacific, Commonwealth and American units have a defense strength of one on the first turn. They could start 1 and then be upgraded to their regular values at the end of the Japanese turn.

                            Yes, definitely yes. Just tried this in my improved module for Axis and Allies D-Day.

                            The module was already finished for some time but I thought it would be a good idea to add some various game options to help balance the game. The_Good_Captain made a series on A&A D-Day where he recommended some balancing changes. There was one he didn't mention in his video but did consider and that was: "Allied Bombers attack at 4 instead of 3". The game is too pro-German and having this as an optional rule helps out the Allies.

                            <attachment name="BombersAttackAt4" attachTo="USA-UK" javaClass="RulesAttachment" type="player">
                            	<option name="gameProperty" value="Allied Bombers Attack At 4"/>
                            </attachment>
                            <attachment name="triggerAttachmentBombersAttackAt4" attachTo="USA-UK" javaClass="TriggerAttachment" type="player">
                            	<option name="conditions" value="BombersAttackAt4"/>
                            	<option name="unitType" value="UKbomber:USAbomber"/>
                            	<option name="unitAttachmentName" value="UnitAttachment" count="unitAttachment"/>
                            	<option name="unitProperty" value="attack" count="4"/>
                            	<option name="uses" value="1"/>
                            	<option name="when" value="before:ParaSurpriseBattle"/>
                            </attachment>
                            

                            87fac4a0-a27c-4711-9aa7-d84957427a36-image.png

                            There you have it! Very useful indeed.

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