Screen Won't Center on Capital at Turn Start with Tech Off
-
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
-
Thanks to @wc_sumpton this has a solution.
"endTurnNoPU" is the key. And the
"purchaseNoPU"This code uses the G40 game as an example.
then add to each player
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
-
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...
-
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
-
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...
-
-
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:
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:
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 @TheDogCheers...
-
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...
-
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?
-
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...
-
@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.
-
-
@wc_sumpton
Oh thanks, I misunderstood.Sure I should be able to fix it. I will take it once the issue is opened.
-
@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...
-
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. -
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...
-
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...
-
-
@wc_sumpton said in Screen Won't Center on Capital at Turn Start with Tech Off:
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.
-
@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