Navigation

    TripleA Logo

    TripleA Forum

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

    How to prevent this cavalry unit to scramble to sea battles

    Map Making
    3
    19
    739
    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.
    • TorpedoA
      TorpedoA last edited by TorpedoA

      This is a roman times cavalry unit called Equites.
      All my other cavalry units are like this.

      <attachment name="unitAttachment" attachTo="Equites" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
      <option name="attack" value="3"/>
      <option name="defense" value="3"/>
      <option name="movement" value="2"/>
      <option name="airAttack" value="3"/>
      <option name="airDefense" value="3"/>
      <option name="transportCost" value="6"/>
      <option name="canAirBattle" value="true"/>
      <option name="createsResourcesList" value="-1:PUs"/>
      <option name="canBlitz" value="true"/>
      <option name="canEvade" value="true"/>
      <option name="isAirBase" value="true"/>
      <option name="canScramble" value="true"/>
      <option name="maxScrambleDistance" value="1"/>
      <option name="requiresUnits" value="Metropolis"/>
      <option name="requiresUnits" value="City"/>
      </attachment>
      

      It can evade, scramble and participate in air battles which simulates in my game skirmish and ranged combat. To be able to participate in air battles, one should know that it is possible even without being a isAir unit at all. You just set canAirBattle, airAttack and airDefense. Done.

      Now to the problem: This unit does scramble from land to a sea battle whenever one occures at the bordering sea territory.

      The following options are set like this.

      <property name="Scramble To Sea Only" value="false" editable="false">
      
      <property name="Scramble From Island Only" value="false" editable="false">
      
      <property name="Scramble To Any Amphibious Assault" value="false" editable="true">
      
      <property name="Can Scramble Into Air Battles" value="true" editable="true">
      

      What possibilities do i have to prevent the scramble to sea territories?

      TheDog 1 Reply Last reply Reply Quote 0
      • TheDog
        TheDog @TorpedoA last edited by

        @torpedoa
        You will have to use movementCostModifier and territoryEffectAttachment
        see here
        https://forums.triplea-game.org/topic/2892/how-i-am-using-movementcostmodifier

        The sea areas will have a cost to enter of say +5, to prevent the Cavalry from entering the sea area.

        Remember you will have to restructure the xml to use territoryEffectAttachment

        TorpedoA 2 Replies Last reply Reply Quote 2
        • TorpedoA
          TorpedoA @TheDog last edited by

          @thedog Just minutes ago i tried this but that doesnt work.

          <attachment name="territoryEffectAttachment" attachTo="Ocean"javaClass="games.strategy.triplea.attachments.TerritoryEffectAttachment" type="territoryEffect">
          <option name="unitsNotAllowed" value="Equites"/>
          </attachment>
          

          Now i try with movement modifier.
          Thy for help

          1 Reply Last reply Reply Quote 0
          • TorpedoA
            TorpedoA @TheDog last edited by TorpedoA

            @thedog

            Below the cavalry scrambles but cannot move back to the territory which it was before.

            <option name="movementCostModifier" value="Equites" count="-5"/>
            

            And here it scrambles and can move back.

            <option name="movementCostModifier" value="Equites" count="5"/>
            

            Both options above and unitsNotAllowed are not working for scramble then i have to think.

            TheDog 1 Reply Last reply Reply Quote 0
            • TheDog
              TheDog @TorpedoA last edited by

              So you have

              • setup the effected territory as
                <attachment name="territoryAttachment" attachTo="SZ47" javaClass="games.strategy.triplea.attachments.TerritoryAttachment" type="territory">
                <option name="territoryEffect" value="Ocean" />
                </attachment>
              • You have moved the unitAttachment and supportAttachment xml block of code after the territoryEffectAttachment block of code?
              TorpedoA 3 Replies Last reply Reply Quote 1
              • TorpedoA
                TorpedoA @TheDog last edited by

                @thedog I have in order: Unit, Support, Territory, TerritoryEffect

                1 Reply Last reply Reply Quote 0
                • TorpedoA
                  TorpedoA @TheDog last edited by

                  @thedog said in How to prevent this cavalry unit not to scramble to sea battles:

                  You have moved the unitAttachment and supportAttachment xml block of code after the territoryEffectAttachment block of code?

                  Do you mean that i have to put territoryEffect above unit and support? And where to put territories?
                  If possible give me the right order of those in question.

                  1 Reply Last reply Reply Quote 0
                  • TorpedoA
                    TorpedoA @TheDog last edited by

                    @thedog said in How to prevent this cavalry unit not to scramble to sea battles:

                    setup the effected territory as
                    <attachment name="territoryAttachment" attachTo="SZ47" javaClass="games.strategy.triplea.attachments.TerritoryAttachment" type="territory">
                    <option name="territoryEffect" value="Ocean" />
                    </attachment>

                    Sure. I just put all sea zones into territoryAttachments right below the other land territoiyAttachments which were already there like you showing here. This was the first thing i did. After that i just put 1 territoryEffect with Ocean below all territoryAttachments.

                    TheDog 1 Reply Last reply Reply Quote 0
                    • TheDog
                      TheDog @TorpedoA last edited by

                      order is
                      technology
                      territoryAttachment
                      territoryEffectAttachment
                      unitAttachment
                      supportAttachment

                      TorpedoA 3 Replies Last reply Reply Quote 0
                      • TorpedoA
                        TorpedoA @TheDog last edited by

                        @thedog thy very much, i try it

                        1 Reply Last reply Reply Quote 0
                        • TorpedoA
                          TorpedoA @TheDog last edited by

                          @thedog The change in order didnt do anything. I am more and more to think that scramble ingores certain restrictions.

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

                            @TorpedoA

                            Scramble is used for "isAir" units so the game logic is not checking if the unit can enter the zone since "isAir" unit can enter both water/land zones. I dough that you will be able to prevent the unit for entering that zone without some modification to the underling code.

                            Cheers...

                            TorpedoA 2 Replies Last reply Reply Quote 2
                            • TorpedoA
                              TorpedoA @wc_sumpton last edited by

                              @wc_sumpton Yes, i think you are right. Even though it is not a isAir unit. You can scramble even if you are not isAir.

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

                                @TorpedoA

                                Understand, but the scramble ability was a feature that was added to TripleA, and the way it was coded works well for 'isAir'.

                                Cheers...

                                TorpedoA 1 Reply Last reply Reply Quote 1
                                • TorpedoA
                                  TorpedoA @wc_sumpton last edited by

                                  @wc_sumpton I think i have to play around this options then.
                                  canNotTarget
                                  values: colon delimited list of units that this unit can't target in battles, ex. subs not being able to target air units
                                  canNotBeTargetedBy
                                  Eventually there is a chance. But i guess it will not work with airBattle in a scramble situation. But lets see. I try it now.

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

                                    @wc_sumpton I dont have a problem of scrambling cavalry units. I only want it to not to be any factor of an outcome if they entere a sea battle by scramble.

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

                                      @TorpedoA

                                      I really do understand you problem. 'canNotTarget' should work, but it will not stop the unit from entering the zone. You would have to put 'canNotTarget' on both the land and sea units, so that the scrambling units are not taken as casualties. I see 'canEvade' do you have any units with 'isDestroyer' these might also cause problems.

                                      Defensive scrambling/intercepting units should use the same movement logic as regular attacking units.

                                      Cheers...

                                      TorpedoA 1 Reply Last reply Reply Quote 2
                                      • TorpedoA
                                        TorpedoA @TheDog last edited by TorpedoA

                                        @thedog @wc_sumpton
                                        Thy you both for help.
                                        I have now just set canNotBeTargetedBy and cannotTarget to the cavalry and the sea unit so it doesnt counts towards the outcome of the sea battle in which i cannot prevent the cavalry scrambling into. But it does the job.

                                        <attachment name="unitAttachment" attachTo="Equites" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
                                        <option name="attack" value="3"/>
                                        <option name="defense" value="3"/>
                                        <option name="movement" value="2"/>
                                        <option name="airAttack" value="3"/>
                                        <option name="airDefense" value="3"/>
                                        <option name="transportCost" value="6"/>
                                        <option name="canAirBattle" value="true"/>
                                        <option name="createsResourcesList" value="-1:PUs"/>
                                        <option name="canBlitz" value="true"/>
                                        <option name="canEvade" value="true"/>
                                        <option name="isAirBase" value="true"/>
                                        <option name="canScramble" value="true"/>
                                        <option name="maxScrambleDistance" value="1"/>
                                        <option name="requiresUnits" value="Metropolis"/>
                                        <option name="requiresUnits" value="City"/>
                                        <option name="canNotTarget" value="Galley"/>
                                        <option name="canNotBeTargetedBy" value="Galley"/>
                                        </attachment>
                                        
                                        1 Reply Last reply Reply Quote 2
                                        • TorpedoA
                                          TorpedoA @wc_sumpton last edited by

                                          @wc_sumpton Luckily i dont have or need isDestroyer in my ancient times mod. Thy again for helping me to find a good workaround.

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