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

    Upgrading Factories

    Scheduled Pinned Locked Moved Map Making
    thedog
    9 Posts 3 Posters 1.8k 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.
    • TheDogT Offline
      TheDog
      last edited by TheDog

      In 1888 SAS (Steam & Steel) you can upgrade Factories
      Barracks to Industry to Industry-Hvy

      But I only want 1 factory per TT
      To allow a factory upgrade this maxFactoriesPerTerritory property must be set to 2
      But this also allows an unwanted Barracks to be placed, as below;
      e6e20599-367f-485e-b4da-c689d70755ca-image.png

      Checking TripleA-2.5.22294 the same thing happens.

      So any help/suggestions would be appreciated to resolve this.

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

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

        @thedog

        Yes, but the upgrade unit does not have to be called "factory".

        Use a dummy to upgrade, have the upgrade "spawn" the real unit, then remove the upgrade after endTurn. endTurn is where "createsUnitsList" happens.

        Use playerAttachment/placementLimit to insure that the dummy upgrade and lesser unit cannot be placed at the same time.

        Lesser unit "Barracks"/"factory" is ungraded by "Industry-Upgrade"/"Upgrade" which create "Industry"/"factory" which can be upgraded by "Industry-Heavy-Upgrade"/"Upgrade" which in turn creates "Industry-Heavy"/"factory".

        And "maxFactoriesPerTerritory" can be left at 1, because the upgrade unit is there only as a placeholder for the final unit.

        Tried to do this with GCD '41 and Shogun Advanced, so it does work.

        Cheers...

        TheDogT 1 Reply Last reply Reply Quote 1
        • TheDogT Offline
          TheDog @wc_sumpton
          last edited by

          Wow, so quick, thanks!

          I guess its always been like that.

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

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

            @thedog

            And so, I got some things a little mixed up there, sorry.

            The Barracks, Industry, Industry_Upgrade, Industry-Hvy, Industry-Hvy_Upgrade should all be called "factory" and look like this:

            <option name="constructionType" value="factory"/>
            <option name="maxConstructionsPerTypePerTerr" value="2"/> <!-- This will allow 2 of the same type to occupy the territory at once -->
            <!-- This will allow the upgrade unit to be placed -->
            <option name="constructionsPerTerrPerTypePerTurn" value="1"/> <!-- Only 1 per turn, will prevent a upgrade and other to be placed during the same turn -->
            

            The upgrades will still need to replace/create. In the playerAttachment:

            <option name="placementLimit" value="owned:Barracks:Industry:Industry-Hvy" count="1"/>
            <!-- Note no upgrade units, and this should stop the second placement of a production unit -->
            

            Then the cleanup, but I see that you have only an endTurn at the beginning of the round. This is what is used to spawn the upgraded unit prior to removal, but I sure you can handle this.

            Again, sorry for the mix up.

            Cheers...

            TheDogT Jason Green-LoweJ 2 Replies Last reply Reply Quote 2
            • TheDogT Offline
              TheDog @wc_sumpton
              last edited by

              As always very helpful, thanks!

              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 1
              • Jason Green-LoweJ Offline
                Jason Green-Lowe @wc_sumpton
                last edited by

                @wc_sumpton Thanks, this was helpful! I'm using a similar mechanic in my Deluxe Anniversary map, and it's working well; the upgrades are functioning as intended; they consume a barracks when placed, and no double-stacking of any kind is allowed.

                However, I don't know how to quickly clean up the "factory_upgrade" units and replace them with "factory" units at the end of the turn. Can you help me with that?

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

                  @jason-green-lowe

                  Sure, for the factory_upgrade to create the factory this will need to be added to the unitAttachment:

                     <option name="createsUnitsList" value="1:factory"/>
                  

                  This will create the "factory" during the endTurn. Then create a trigger to remove those upgrades, it would look something like:

                  	<attachment name="triggerAttachmentRemoveUpgrade" attachTo="British" javaClass="TriggerAttachment" type="player">
                  	  <option name="conditions" value="conditionAttachmentAlwaysTrue"/>
                  	  <option name="removeUnits" value="all:factory_upgrade" count="999"/>
                  	  <option name="when" value="after:britishEndTurn"/> <!-- Needs to happen "after" -->
                  	</attachment>
                  

                  Hope the is helpful.

                  Cheers...

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

                    @wc_sumpton Worked perfectly first time, thanks! And I think this is also the solution I need for my old project from 2023 to code up SiredBlood's BBR map. I was bogging down hard on the custom tech tree, which needs to be able to replace units with other units...but this should work just fine for that!

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

                      @jason-green-lowe

                      I remember something about you working on that map. Hopefully it is coming along ok, and we will get to see it soon!

                      Good luck on your projects!

                      Cheers...

                      1 Reply Last reply Reply Quote 2

                      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