Navigation

    TripleA Logo

    TripleA Forum

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

    End turn trigger calculation

    Map Making
    3
    10
    198
    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.
    • stalinpasha
      stalinpasha last edited by

      I wrote small code that gives 5 pu to Germans at the end of his turn, if Holland is contolled by Neutral_True. It appears below the screen as +5 but doesn't be collected at the end of the turn. It didn't shown in end turn summary too. So, what should I add to my code to show it in end turn summary and make true calculation?

      	<attachment name="conditionAttachment_Germans_Check_Neutral_Netherlands" attachTo="Neutral_True" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
      		<option name="directOwnershipTerritories" value="Holland" count="1"/>
      	</attachment>
      
      	<attachment name="conditionAttachment_Germans_Neutral_Netherlands" attachTo="Germans" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
      		<option name="conditions" value="conditionAttachment_Germans_Check_Neutral_Netherlands"/>
      	</attachment>	
      
      	    <!-- Germans Triggers -->
      	<attachment name="triggerAttachment_Germans_Neutral_Netherlands_Imports" attachTo="Germans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
      		<option name="trigger" value="conditionAttachment_Germans_Neutral_Netherlands"/>
      		<option name="resource" value="PUs"/>
      		<option name="resourceCount" value="5"/>
      	</attachment>
      

      Additional question: Pact of Steel 2 says that Strategic Bombing can do damage directly player's PUs. How can add ability to my zeppelins damage directly to the player's PUs?

      <!-- Damage From Bombing Done To Units Instead Of Territories has Strategic Bombing and Rockets do damage to a specific unit rather than directly to the player's PUs or to a territory. -->
      <property name="Damage From Bombing Done To Units Instead Of Territories" value="true" editable="false">
        <boolean/>
      </property>
      1 Reply Last reply Reply Quote 0
      • W
        wc_sumpton last edited by

        @stalinpasha

        Second question first. To change SBR damage to affect PUs change the property to false:

        <!-- Damage From Bombing Done To Units Instead Of Territories has Strategic Bombing and Rockets do damage to a specific unit rather than directly to the player's PUs or to a territory. -->
        <property name="Damage From Bombing Done To Units Instead Of Territories" value="false" editable="false">
          <boolean/>
        </property>
        

        Change the second condition in your first example to a 'National Objective':

         <attachment name="objectiveAttachment_Germans_Neutral_Netherlands_Imports" attachTo="Germans" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
           <option name="conditions" value="conditionAttachment_Germans_Neutral_Netherlands"/>
           <option name="objectiveValue" value="5"/>
        </attachment>
        

        Now the trigger is not needed.

        Or just add a "when" option to the trigger:

        <!-- Germans Triggers -->
        <attachment name="triggerAttachment_Germans_Neutral_Netherlands_Imports" attachTo="Germans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
           <!--- changed trigger to conditions -->
           <option name="conditions" value="conditionAttachment_Germans_Neutral_Netherlands"/>
           <option name="resource" value="PUs"/>
           <option name="resourceCount" value="5"/>
           <option name="when" value="after:germanyEndTurn"/>
        </attachment>
        

        Both way should work for what you are asking.

        Cheers.

        stalinpasha 1 Reply Last reply Reply Quote 0
        • stalinpasha
          stalinpasha @wc_sumpton last edited by

          @wc_sumpton Thanks for your helpful support. I changed it but didn't work. Holland is controlled by Neutral_True initially.
          1.png

          	<attachment name="conditionAttachment_Germans_Neutral_Netherlands" attachTo="Neutral_True" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
          		<option name="directOwnershipTerritories" value="Holland" count="1"/>
          	</attachment>		
          
          	<!-- Germans Triggers -->
          	<attachment name="triggerAttachment_Germans_Neutral_Netherlands_Imports" attachTo="Germans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
          	<!--- changed trigger to conditions -->
          		<option name="conditions" value="conditionAttachment_Germans_Neutral_Netherlands"/>
          		<option name="resource" value="PUs"/>
          		<option name="resourceCount" value="5"/>
          		<option name="when" value="after:germanyEndTurn"/>
          	</attachment>
          B 1 Reply Last reply Reply Quote 0
          • B
            beelee @stalinpasha last edited by

            @stalinpasha double check "after:germanyEndTurn" usually it'll be the same as attachTo="Germans" but not always.

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

              @stalinpasha
              If I am understanding you correctly Neutral_True control Holland at the start of the game, and as long as Neutral_True retain control of Holland you want Germany to collect an additional 5PUs. Also you did not report any errors so you must have caught my "condition" value="conditionAttachment_Germans_Neutral_Netherlands" should have been "conditionAttachment_Germans_Check_Neutral_Netherlands". One more thing, the switch that needs a switch

              <property name="National Objectives" value="true" editable="false">
                 <boolean/>
              </property>
              

              In summery, your first condition with the national objective:

              <attachment name="conditionAttachment_Germans_Check_Neutral_Netherlands" attachTo="Neutral_True" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
                 <option name="directOwnershipTerritories" value="Holland" count="1"/>
              </attachment>
              
               <attachment name="objectiveAttachment_Germans_Neutral_Netherlands_Imports" attachTo="Germans" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
                 <option name="conditions" value="conditionAttachment_Germans_Check_Neutral_Netherlands"/>
                 <option name="objectiveValue" value="5"/>
              </attachment>
              

              With the property switch, should give you what you want.

              @beelee good catch, but I think @stalinpasha was trying the first part. Still a very good catch!!

              Cheers...

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

                @wc_sumpton Thanks a lot. Finally, I have hunger games in Germany:D
                1.png

                Any recommends how I add tech to map? I tried to copy from other maps but didn't success yet.

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

                  @stalinpasha
                  First check your properties:

                   <property name="Tech Development" value="true" editable="true">
                       <boolean/>
                   </property>
                  

                  Also depending on how the tech is to be selected you may want to check some of these:

                  <!-- ww2v2 rules override many individual rules to create revised rules -->
                  <property name="WW2V2" value="false" editable="false">
                     <boolean/>
                  </property>
                  <!-- Unlike the WW2V2 option, WW2V3 actually sets very little: If no techs specified then it will create WW2V3 default techs, and if a game is not WW2V2 and not WW2V3, then it must be 'classic' rules [this is applicable for when rockets fire, and how aa guns may stack, the default win conditions for classic games, and that air units create retreat paths for ground/sea units]-->
                  <property name="WW2V3" value="true" editable="false">
                      <boolean/>
                  </property>
                  <property name="WW2V3 Tech Model" value="true" editable="false">
                      <boolean/>
                  </property>
                  

                  If these are set and you are still having problems, let the board know. We are here to help!

                  Cheers...

                  stalinpasha 1 Reply Last reply Reply Quote 0
                  • stalinpasha
                    stalinpasha @wc_sumpton last edited by stalinpasha

                    @wc_sumpton

                    I receive java null pointer exception, when I got hit. My custom tech is about unlocking ww1 tank. I think my buytank productionRule works well, so exception related to tech activation.

                    1.png

                    <technology>
                    	<technologies>
                    		<techname name="caterpillar_combat_vehicle"/>
                    	</technologies>
                    	
                    	<playerTech player="AustroHungarians">
                    		<category name="caterpillar_combat_vehicle">
                    			<tech name="caterpillar_combat_vehicle"/>			
                    		</category>
                    	</playerTech>
                    </technology>
                    
                    
                    	<attachment name="conditionAttachmentUnlockTankA" attachTo="AustroHungarians" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
                    					<option name="techs" value="caterpillar_combat_vehicle" count="1"/>
                    	</attachment>
                    	
                    	
                    	<attachment name="triggerAttachmentAustriaUnlockTank" attachTo="AustroHungarians" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
                                	<option name="trigger" value="conditionAttachmentUnlockTankA"/>
                    				<option name="productionRule" value="productionAustroHungarians:buytank"/>
                    				<option name="uses" value="1"/>
                    				<option name="when" value="after:austrohungariansTechActivation"/>
                        </attachment>	
                    

                    Error Log:

                    Tem 31, 2020 6:55:34 AM games.strategy.engine.framework.GameRunner lambda$start$0
                    SEVERE: null
                    java.lang.NullPointerException
                    at games.strategy.engine.data.changefactory.GenericTechChange.<init>(GenericTechChange.java:22)
                    at games.strategy.engine.data.changefactory.ChangeFactory.genericTechChange(ChangeFactory.java:184)
                    at games.strategy.triplea.delegate.TechTracker.addAdvance(TechTracker.java:62)
                    at games.strategy.triplea.delegate.TechActivationDelegate.start(TechActivationDelegate.java:51)
                    at games.strategy.engine.framework.ServerGame.startStep(ServerGame.java:511)
                    at games.strategy.engine.framework.ServerGame.runStep(ServerGame.java:414)
                    at games.strategy.engine.framework.ServerGame.startGame(ServerGame.java:290)
                    at java.util.Optional.ifPresent(Unknown Source)
                    at games.strategy.engine.framework.startup.launcher.LocalLauncher.launchInNewThread(LocalLauncher.java:41)
                    at games.strategy.engine.framework.startup.launcher.AbstractLauncher.lambda$launch$0(AbstractLauncher.java:51)
                    at java.lang.Thread.run(Unknown Source)

                    List of rules that I added:

                    			<property name="Tech Development" value="true" editable="true">
                    					<boolean/>
                    			</property>
                    
                    			<property name="Remove All Tech Tokens At End Of Turn" value="false" editable="true">
                    					<boolean/>
                    			</property>
                    
                    
                    			<property name="WW2V3" value="true" editable="false">
                    					<boolean/>
                    			</property>
                    
                    			<property name="WW2V3 Tech Model" value="true" editable="false">
                    					<boolean/>
                    			</property>
                    
                    			<property name="Selectable Tech Roll" value="false" editable="false">
                    					<boolean/>
                    			</property>
                    B 1 Reply Last reply Reply Quote 0
                    • B
                      beelee @stalinpasha last edited by

                      @stalinpasha yea I agree it doesn't seem to be activating correctly. I'm not sure what the "ChangeFactory" is about. At any rate, do you have:

                      <delegate name="tech_activation" javaClass="games.strategy.triplea.delegate.TechActivationDelegate" display="Activate Technology"/>

                      All I can think of at the moment. The Wizard wc_ probably chime in soon 🙂

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

                        @beelee

                        I started a new topic for this discussion.

                        Cheers...

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