Navigation

    TripleA Logo

    TripleA Forum

    • Register
    • Login
    • Search
    • TripleA Website
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Tags

    Screen Won't Center on Capital at Turn Start with Tech Off

    Map Making
    4
    22
    644
    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.
    • B
      beelee last edited by

      This only works when I have Tech Development turned on in Map Options. Is there a way to make it work with tech off ?

      Thanks

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

        Thanks to @wc_sumpton this has a solution.

        "endTurnNoPU" is the key. And the
        "purchaseNoPU"

        Screenshot from 2025-03-26 23-09-37.png

        This code uses the G40 game as an example.

        Screenshot from 2025-03-26 22-57-29.png

        then add to each player

        Screenshot from 2025-03-26 22-59-47.png

        Here's a full xml with it. China slightly different, otherwise the other players the same.

        global_40_expansion_uhd_boxes.xml

        @simon33 you may want to add this to the global mod

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

          @beelee

          Thanks for the call out.

          <!-- Germans Game Sequence -->
          <!-- Dummy step used to insure map is centered for human player (first step is used to center) -->
          <step name="germansNoPUEndTurn" delegate="endTurnNoPU" player="Germans"/>
          <step name="germansTech" delegate="tech" player="Germans"/>
          <step name="germansTechActivation" delegate="tech_activation" player="Germans"/>
          <step name="germansPurchase" delegate="purchase" player="Germans"/>
          <!-- Second purchase is used to give units per territory in case player loses all production capabilities -->
          <step name="germansNoPUPurchase" delegate="purchaseNoPU" player="Germans"/>
          <step name="germansPolitics" delegate="politics" player="Germans"/>
          <step name="germansCombatMove" delegate="move" player="Germans"/>
          <step name="germansAirborneCombatMove" delegate="specialCombatMove" player="Germans" display="Airborne Attack Move"/>
          <step name="germansBattle" delegate="battle" player="Germans"/>
          <step name="germansNonCombatMove" delegate="move" player="Germans" display="Non Combat Move"/>
          <step name="germansPlace" delegate="place" player="Germans"/>
          <step name="germansEndTurn" delegate="endTurn" player="Germans"/>
          

          Used in UHD WIP 1940-45 (mega_new_elk)

          Again, thank you @beelee

          Cheers...

          B C 2 Replies Last reply Reply Quote 3
          • B
            beelee @wc_sumpton last edited by

            @wc_sumpton

            Absolutely ! That's annoyed me for years and many others too I'm sure lol.

            The League guys at A&A.org gonna be diggin it lol

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

              @beelee

              Never really paid attention to it until I started helping you and @Black_Elk with the other map. I never bother with developing and redeveloping map setups. I told you I was learning a lot working with you both. Of course, @TheDog deserve some of the credit, having his maps with collecting income first is what lead me to this idea.

              Cheers...

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

                @wc_sumpton

                RightArm.png

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

                  @beelee

                  We have to issue a warning when using this method, so here goes!
                  Warning! endTurnNoPU only stop the PUs that are gathered from territories! Objectives will still be paid!
                  Take PoS2 which has a first step of "Tech" which can be turned off in the 'Game Options'.
                  Adding endTurnNoPU as the first step:

                  <!-- endTurnNoPU add to center map on player if "Tech Development" is unchecked -->
                  <!-- Italians Game Sequence -->
                  <step name="italianNoPUEndTurn" delegate="endTurnNoPU" player="Italians"/>
                  <step name="italianTech" delegate="tech" player="Italians"/>
                  <step name="italianPurchase" delegate="purchase" player="Italians"/>
                  <step name="italianPolitics" delegate="politics" player="Italians"/>
                  <step name="italianCombatMove" delegate="move" player="Italians"/>
                  <step name="italianBattle" delegate="battle" player="Italians"/>
                  <step name="italianNonCombatMove" delegate="move" player="Italians" display="Non Combat Move"/>
                  <step name="italianPlace" delegate="place" player="Italians"/>
                  <step name="italianTechActivation" delegate="tech_activation" player="Italians"/>
                  <step name="italianEndTurn" delegate="endTurn" player="Italians"/>
                  

                  Now the Russian player you get this:
                  Screenshot_Russian_Objective.png
                  Please note that the Russian will receive no message, but because of the objective they will receive the 4 PUs.
                  This can be handled with a "switch":

                   <!-- This condition controls when National Objective happen with a switch -->
                   <!-- and should be added to all objectiveAttachment -->
                   <attachment name="conditionAttachmentNationalObjectiveSwitch" attachTo="Germans" javaClass="RulesAttachment" type="player">
                  	<option name="switch" value="true"/>
                   </attachment>
                   <!-- German Objectives -->
                   <attachment name="objectiveAttachmentGermans1_EasternEurope" attachTo="Germans" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
                  	<option name="conditions" value="conditionAttachmentNationalObjectiveSwitch"/>
                  	<option name="objectiveValue" value="4"/>
                  	<option name="alliedOwnershipTerritories" value="East Balkans:Eastern Europe:Ukraine S.S.R.:Belorussia:West Russia:Norway:Karelia S.S.R.:Archangel:Caucus" count="7"/>
                   </attachment>
                  

                  The condition should be added to every objectiveAttachment. Then 2 triggers control the "switch".

                   <!-- PoS2 used conditionAttachment_Americans_Aid_UK as an "AlwaysTrue" condition -->
                   <!-- While this is ok, this condition should be checking if Americans have -->
                   <!-- enough PUs to give to the British -->
                   <!-- This trigger changes NationalObjectiveSwitch to false -->
                   <attachment name="triggerAttachmentNationalObjectiveFalse" attachTo="Germans" javaClass="TriggerAttachment" type="player">
                  	<option name="conditions" value="conditionAttachment_Americans_Aid_UK"/>
                  	<option name="players" value="Germans"/>
                  	<option name="playerAttachmentName" value="RulesAttachment" count="conditionAttachmentNationalObjectiveSwitch"/>
                  	<option name="playerProperty" value="switch" count="false"/>
                  	<option name="when" value="before:italianNoPUEndTurn"/>
                  	<option name="when" value="before:russianNoPUEndTurn"/>
                  	<option name="when" value="before:germanNoPUEndTurn"/>
                  	<option name="when" value="before:britishNoPUEndTurn"/>
                  	<option name="when" value="before:japaneseNoPUEndTurn"/>
                  	<option name="when" value="before:americanNoPUEndTurn"/>
                   </attachment>
                   <!-- This trigger changes NationalObjectiveSwitch to true -->
                  <attachment name="triggerAttachmentNationalObjectiveTrue" attachTo="Germans" javaClass="TriggerAttachment" type="player">
                  	<option name="conditions" value="conditionAttachment_Americans_Aid_UK"/>
                  	<option name="players" value="Germans"/>
                  	<option name="playerAttachmentName" value="RulesAttachment" count="conditionAttachmentNationalObjectiveSwitch"/>
                  	<option name="playerProperty" value="switch" count="true"/>
                  	<option name="when" value="after:italianNoPUEndTurn"/>
                  	<option name="when" value="after:russianNoPUEndTurn"/>
                  	<option name="when" value="after:germanNoPUEndTurn"/>
                  	<option name="when" value="after:britishNoPUEndTurn"/>
                  	<option name="when" value="after:japaneseNoPUEndTurn"/>
                  	<option name="when" value="after:americanNoPUEndTurn"/>
                   </attachment>
                  

                  So now you have this for the Russian player:
                  Screenshot_No_Russian_Objective.png
                  Even though the Russian objective is true, there is no payment line. The first line is switching off the objective, the second, highlighted line, is the NoPU not giving any PUs for territories. The last line, which happens after the NoPU turns the objectives back on.

                  There are other items to worry about, such as territoryAttachment "resources" and with unitAttachment "createsResourcesList" and "createsUnitsList". These are also done during an endTurn/endTurnNoPU. These would need to be reset with trigger that use "-reset-", and another trigger to return them back to their original values.

                  Any active step can be used but each come with their own set of "problems", but I find that endTurn/endTurnNoPU will always happen and can be used in different ways.

                  Enclosed is a modified PoS2 file.
                  modified_PoS2.zip
                  As always Have Fun!!

                  Cheers...

                  P.S Credit needs to be given to @TheDog and GCD '41, which I blatantly ripped off. Check out the map and xml, there's alot of good stuff there.
                  All hail @TheDog 🎉🙌👌😁👍

                  Cheers...

                  1 Reply Last reply Reply Quote 4
                  • W
                    wc_sumpton last edited by wc_sumpton

                    As an aside note, I purposely left out "upkeepCost" in relationshipTypeAttachment, because I feel no one use it. Because it is an attachment, this too can be manipulated with trigger, and can be changed in so that a "Child" player could give a percentage of their income to a "Parent" without having the "Parent" give back.

                    It is a fun option and could be used in maps like TWW.

                    Cheers...

                    1 Reply Last reply Reply Quote 2
                    • C
                      Cernel Moderators last edited by

                      This solution is a hack to work around a problem, so I would say that one ought also to open an issue to have it solved at the program level (but I understand that the chance of a developer ever fixing it is likely very low).

                      Maybe @brazza would take up this one?

                      W B 2 Replies Last reply Reply Quote 1
                      • W
                        wc_sumpton @Cernel last edited by

                        @cernel

                        Yes and no. Of all the steps in TripleA, these two will always hit. There may be conditions where one of the other steps may be skipped. Maybe you want to spawn a submarine from a sub-pen prior to combat movement. Display opening messages that will be displayed, endTurn\endTurnNoPU with maxRunCount="1".

                        This may be a "hack" here, but once it's there it can be exploited for other things.

                        @cernel said in Screen Won't Center on Capital at Turn Start with Tech Off:

                        (but I understand that the chance of a developer ever fixing it is likely very low)

                        I think you are right about this though.

                        Cheers...

                        1 Reply Last reply Reply Quote 2
                        • B
                          Brazza @Cernel last edited by

                          @cernel
                          I am willing to help but I don't know enough for xml programming.

                          I can start at beginning to learn about this but in that case there is no guarantee that I can complete within any limited time.

                          Sorry about that.

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

                            @brazza

                            @Cernel Is talking about changing the engine (JAVA), so that the "centering hack" is not needed.

                            Cheers...

                            B 1 Reply Last reply Reply Quote 2
                            • B
                              Brazza @wc_sumpton last edited by

                              @wc_sumpton
                              Oh thanks, I misunderstood.

                              Sure I should be able to fix it. I will take it once the issue is opened.

                              W C 2 Replies Last reply Reply Quote 1
                              • W
                                wc_sumpton @Brazza last edited by

                                @brazza said in Screen Won't Center on Capital at Turn Start with Tech Off:

                                Oh thanks, I misunderstood.

                                No problem. It happens to the best of us (and also those of us that are not so good).

                                @brazza said in Screen Won't Center on Capital at Turn Start with Tech Off:

                                Sure I should be able to fix it. I will take it once the issue is opened.

                                That's still debatable. I'm really not sure what would be wanted. But thanks for the offer, it is greatly appreciated.

                                Cheers...

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

                                  @wc_sumpton

                                  yea idk might be more of a feature request as opposed to bug fix ?

                                  @Cernel how would you phrase it ? Do you want to open a git issue so @Brazza can work on it ? I'm not sure the best way to word it.

                                  Edit
                                  I guess I could go with the topic/thread title. I don't really want to call it a bug though.

                                  Edit 2
                                  I guess maybe it's a bug since it does it when tech is on.

                                  W 1 Reply Last reply Reply Quote 1
                                  • W
                                    wc_sumpton @beelee last edited by wc_sumpton

                                    @beelee

                                    The problem is centering on the player's capital at the start of their round. It would very disorienting if TripleA centered on every step. So, the engine does this only on the first step. If the first is skipped so is the centering.

                                    If centering is important to the map maker, then it should be designed so that this first is not missed.

                                    This, IMHO, is an XML problem, and is solvable. So, I see no need for any engine change.

                                    Again, that is just my opinion.

                                    Cheers...

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

                                      To me this is a non-issue, completely solvable. There are other things that, IMO, are more important. The "Active Units" window located in the lower right corner. It's broken. Because of its uselessness, l drought many people use it. It should either be fixed to work properly or just removed. It's a simple fix.
                                      Another simple improvement would be for the "Movement" window to show all the units that can move without having to set display all units.

                                      These are just a few, that would, IMHO, be better.

                                      Cheers...

                                      B 1 Reply Last reply Reply Quote 2
                                      • B
                                        beelee @wc_sumpton last edited by beelee

                                        @wc_sumpton

                                        I don't use it

                                        Edit
                                        Hmm ... wonder what we could replace it with 🙂

                                        1 Reply Last reply Reply Quote 1
                                        • C
                                          Cernel Moderators @wc_sumpton last edited by

                                          @wc_sumpton said in Screen Won't Center on Capital at Turn Start with Tech Off:

                                          @beelee

                                          Thanks for the call out.

                                          <!-- Germans Game Sequence -->
                                          <!-- Dummy step used to insure map is centered for human player (first step is used to center) -->
                                          <step name="germansNoPUEndTurn" delegate="endTurnNoPU" player="Germans"/>
                                          <step name="germansTech" delegate="tech" player="Germans"/>
                                          <step name="germansTechActivation" delegate="tech_activation" player="Germans"/>
                                          <step name="germansPurchase" delegate="purchase" player="Germans"/>
                                          <!-- Second purchase is used to give units per territory in case player loses all production capabilities -->
                                          <step name="germansNoPUPurchase" delegate="purchaseNoPU" player="Germans"/>
                                          <step name="germansPolitics" delegate="politics" player="Germans"/>
                                          <step name="germansCombatMove" delegate="move" player="Germans"/>
                                          <step name="germansAirborneCombatMove" delegate="specialCombatMove" player="Germans" display="Airborne Attack Move"/>
                                          <step name="germansBattle" delegate="battle" player="Germans"/>
                                          <step name="germansNonCombatMove" delegate="move" player="Germans" display="Non Combat Move"/>
                                          <step name="germansPlace" delegate="place" player="Germans"/>
                                          <step name="germansEndTurn" delegate="endTurn" player="Germans"/>
                                          

                                          Used in UHD WIP 1940-45 (mega_new_elk)

                                          Again, thank you @beelee

                                          Cheers...

                                          I would actually also argue that the fact that this hack works at all is a problem too (an unwanted behaviour). In my opinion, the visual should not be centred on "germansNoPUEndTurn" (ever) because that phase requires no actions from the player.

                                          1 Reply Last reply Reply Quote 0
                                          • C
                                            Cernel Moderators @Brazza last edited by

                                            @brazza said in Screen Won't Center on Capital at Turn Start with Tech Off:

                                            @wc_sumpton
                                            Oh thanks, I misunderstood.

                                            Sure I should be able to fix it. I will take it once the issue is opened.

                                            https://github.com/triplea-game/triplea/issues/13241

                                            👍

                                            Cernelius created this issue in triplea-game/triplea

                                            open Visual Do Not Center on Capital if First Phase is Inactive (2.7.14934) #13241

                                            B 1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • First post
                                              Last post
                                            Copyright © 2016-2018 TripleA-Devs | Powered by NodeBB Forums