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

    Remove tech using triggers

    Scheduled Pinned Locked Moved Map Making
    17 Posts 4 Posters 4.9k 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.
    • P Offline
      Prussia
      last edited by Prussia

      Thanks, Redrum. What about removing a tech using trigger?

      redrumR 1 Reply Last reply Reply Quote 0
      • redrumR Offline
        redrum Admin @Prussia
        last edited by

        @prussia Do you mean removing a tech that is available to research or remove a tech that has already been researched? Can you give an example of how you want to use it?

        TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

        1 Reply Last reply Reply Quote 0
        • P Offline
          Prussia
          last edited by

          My units are not differentiated by nation, i.e. all russian and german infantry have "Infantry" type so I can't quite easily use the code you provided. so I have a work around.

          I have a tech called "winter equipment" which is used to counter the effects of "winter" terrain.

          I code the winter equipment tech with exactly the opposite of the penalties to winter terrain. Therefore whoever has that tech will have advantage in "winter" terrain.

          My "Winter" terrain is triggered to apply to territories in round 3, 7, 11, etc. so for the tech to work properly, I need:

          Either a) be able to remove the tech on other rounds so that the advantage don't give advantage in other seasons or

          b) be able to tell the engine to only apply this tech in a specific terrain.

          If you have other simpler codes that would be welcome. If I have to re-code the units by nation then that's basically recoding the entire XML file.

          redrumR HeppsH General_ZodG 3 Replies Last reply Reply Quote 0
          • redrumR Offline
            redrum Admin @Prussia
            last edited by

            @prussia I'm not aware of any way to remove a tech. I think you'd have to have triggered add/remove the specific terrain bonuses directly not using a tech.

            TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

            1 Reply Last reply Reply Quote 0
            • HeppsH Offline
              Hepps Moderators @Prussia
              last edited by

              @prussia If you made your "Winter Equipment" Tech that only effects unit values when the Winter terrain is present.... then the tech should not add bonuses when the terrain is not present.

              So really I don't think you'd ever need the tech to be removed.

              "A joyous heart sours with the burden of expectation"
              Hepster

              redrumR 1 Reply Last reply Reply Quote 2
              • redrumR Offline
                redrum Admin @Hepps
                last edited by

                @hepps Good point... not sure why I didn't think of that.

                TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

                1 Reply Last reply Reply Quote 0
                • P Offline
                  Prussia
                  last edited by

                  I tried it yesterday but it didn't work out the way i thought it would:

                              <attachment name="Winter_Equipment_Action_R" attachTo="Russians" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
                  				<option name="conditions" value="Winter_Equipment_Condition_R"/>
                  				<option name="territoryEffects" value="Moderate.Winter-Climate"/>
                  				<option name="territoryEffectProperty" value="combatOffenseEffect" count="0:infantry"/>
                  				<option name="territoryEffectProperty" value="combatDefenseEffect" count="0:infantry"/>					
                  				<option name="when" value="before:russianPurchase"/>
                              </attachment>	
                  

                  What happened: ALL nations's infantry became immume to winter effects, not just russians.

                  HeppsH 1 Reply Last reply Reply Quote 0
                  • HeppsH Offline
                    Hepps Moderators @Prussia
                    last edited by Hepps

                    @prussia Yes because you are applying the effect to "Infantry".

                    So the way it is written is that the Russians initiate and fire a trigger activating "winter_Equipment_Condition_R" that affects the performance of all "Infantry" where there is the presence of "Moderate.Winter-Climate".

                    You need to specify that it should only affect Russian Infantry.

                    "A joyous heart sours with the burden of expectation"
                    Hepster

                    1 Reply Last reply Reply Quote 0
                    • P Offline
                      Prussia
                      last edited by

                      I'm trying not to define units by nation, like Russian.infantry vs German.infantry because that would basically require me to redo the entire XML =(

                      Is it possible to code this like any other tech, like this but with additional terrain restrictions?

                      			<attachment name="techAbilityAttachment" attachTo="jetPower" javaClass="games.strategy.triplea.attachments.TechAbilityAttachment" type="technology">
                      					<option name="attackBonus" value="1:fighter"/>
                      					<option name="attackBonus" value="1:tactical_bomber"/>
                      					<option name="defenseBonus" value="1:fighter"/>
                      					<option name="defenseBonus" value="1:tactical_bomber"/>
                      			</attachment>
                      
                      HeppsH redrumR 3 Replies Last reply Reply Quote 0
                      • HeppsH Offline
                        Hepps Moderators @Prussia
                        last edited by Hepps

                        @prussia That would require the addition of the "Winter Equipment" Tech to the Hard coded technologies as part of the Global Properties in the Engine. If I am not mistaken.

                        But am not sure.

                        "A joyous heart sours with the burden of expectation"
                        Hepster

                        redrumR 1 Reply Last reply Reply Quote 0
                        • HeppsH Offline
                          Hepps Moderators @Prussia
                          last edited by

                          @prussia The other issue is that tech would then apply bonuses universally. Not specific to a terrain type.

                          "A joyous heart sours with the burden of expectation"
                          Hepster

                          1 Reply Last reply Reply Quote 0
                          • redrumR Offline
                            redrum Admin @Hepps
                            last edited by

                            @hepps I believe you can define your own custom techs that aren't hardcoded in the engine. An example of this I believe is in Global 40 (Airborne_Forces😞

                            <attachment name="techAbilityAttachment" attachTo="Airborne_Forces" javaClass="games.strategy.triplea.attachments.TechAbilityAttachment" type="technology">
                              <option name="airborneForces" value="true"/>
                              <option name="airborneCapacity" value="2:airfield"/>
                              <option name="airborneBases" value="airfield"/>
                              <option name="airborneTypes" value="infantry"/>
                              <option name="airborneDistance" value="3"/>
                              <option name="airborneTargettedByAA" value="AA:infantry"/>
                            </attachment>
                            

                            TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

                            1 Reply Last reply Reply Quote 1
                            • redrumR Offline
                              redrum Admin @Prussia
                              last edited by

                              @prussia For territoryEffects to be different for different nations, you pretty much have to move towards an XML which defines unique units like RussianInfantry, GermanInfantry, etc. Otherwise you can't specify different territoryEffect bonuses per nation.

                              TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

                              1 Reply Last reply Reply Quote 1
                              • General_ZodG Offline
                                General_Zod Moderators
                                last edited by

                                Correct, best way would be, to create nation specific units. I had to do this with my version winter climate effects. I put my mod on back burner for now. Until I rethink the whole tech model. I think using so much luck in game changing technologies, can be annoying.

                                I think best way to approach winter climate as a technology for now, is to make it a national advantage only, for Russia. Because Germany will surely research "winter combat training" tech as soon as possible. Especially if it only 5pu per token. Keeping failed tokens only solidifies the decision to try for it.

                                So with the existing tech model, this method is highly likely to defeat the entire purpose of creating the winter climates and all the hard work of making nation specific units, in the first place. Unless you make some drastic tech model changes, of course.

                                1 Reply Last reply Reply Quote 1
                                • General_ZodG Offline
                                  General_Zod Moderators @Prussia
                                  last edited by

                                  @prussia
                                  The method you are trying to use by switching the tech on and off has a terrible side effect. Anyone that uses the battle calculator won't get accurate outcomes while the tech is off. So advance planning will be very difficult.

                                  1 Reply Last reply Reply Quote 0

                                  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