How do you make a unit autodestroyed if alone without being an infrastructure or a transport


  • Moderators

    Like it works for the "aaGun" of "World War II Global 1940 2nd Edition".

    I have a unit that has:

    <option name="defense" value="0"/>

    but it doesn't work.

    So, assuming that is needed, what else is needed?


  • Moderators Admin

    @Cernel It should controlled by the unit attachments... destroyed instead of capture.


  • Moderators

    @Hepps The v5 maps (thus Global 2nd Edition too) aaGun units are not infrastructures.


  • Moderators Admin

    @Cernel Oh ok. Was a guess.


  • Moderators Admin

    @Cernel Seems they actually are...

    <attachment name="unitAttachment" attachTo="aaGun" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
      <option name="isAAforCombatOnly" value="true"/>
      <option name="isRocket" value="true"/>
      <option name="canNotMoveDuringCombatMove" value="true"/>
      <option name="isInfrastructure" value="true"/>
      <option name="canBeDamaged" value="false"/>
      <option name="movement" value="1"/>
      <option name="transportCost" value="3"/>
      <option name="canBeGivenByTerritoryTo" value="British"/>

  • Moderators Admin

    @Hepps Seems that was Global... not 2nd edition. Might have to do with what the term aaGun controls.


  • Moderators Admin

    @Hepps Also take a look at @CrazyG House of Habsburg... if I remember correctly his cannon unit functions the same way.


  • Moderators

    @Hepps said in How do you make a unit autodestroyed if alone:

    @Hepps Also take a look at @CrazyG House of Habsburg... if I remember correctly his cannon unit functions the same way.

    Yes, but that is because those cannons are infrastructures, thus captured if alone, then destroyed instead of captured.

    I should have been more specific, as I agree making the unit an infrastructure that is destroyed on captured answer my question, but this is not what I was searching for.

    I'll change the title from:

    How do you make a unit autodestroyed if alone

    to:

    How do you make a unit autodestroyed if alone without being an infrastructure or a transport

    This is an example of a unit that is not an infrastructure, nor a transport, but it is autodestroyed if alone, from the "World War II v5 1942 Second Edition" game:

        <attachment name="unitAttachment" attachTo="aaGun" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
          <option name="movement" value="1"/>
          <option name="attack" value="0"/>
          <option name="defense" value="0"/>
          <option name="transportCost" value="3"/>
          <option name="canNotMoveDuringCombatMove" value="true"/>
          <option name="isAAforCombatOnly" value="true"/>
          <option name="maxAAattacks" value="3"/>
          <option name="isRocket" value="true"/>
        </attachment>
    

  • Moderators Admin

    @Cernel Yes so if you look at POS then I believe naming a unit specifically "aaGun"... automatically adds certain attributes to it. If I remember correctly it had something to do with backwards compatibility from when the engine was first created. Your answer is likely in that paragraph.


  • Moderators Admin

    @Cernel It also could be something that is dictated by the Global property.


  • Moderators

    I found the answer, but, not being a developer, I cannot be sure this is all (but I think it is).

    In order to have Defence 0 non-infrastructure land units automatically destroyed if defending alone, the "Transport Casualties Restricted" property must be true.

    Because if transports are restricted from taking hits, then defenceless land units die. Otherwise, not.


  • Admin

    @Cernel That seems correct. Should be able to do a quick test to validate it.


  • Moderators

    I've also tested the offence 0 case.

    In "Lord of the Rings: Middle Earth", if I send hobbits only in attack, they will not automatically die.

    In the same map, if I add this property (and remove all transport capacity options):

                    <property name="Transport Casualties Restricted" value="true" editable="false">
                            <boolean/>
                    </property>
    

    They still not automatically die.

    So, I've tried giving hobbits both attack and defence value of 0 (previously they have attack 0 and defence 1).

    They still not automatically die.

    So, I've removed from the hobbits the artillery supportable option (even though I was sending hobbits alone, so that didn't matter).

    They still not automatically die.

    So, I've removed all options from the hobbits (this way they are attack, defence and movement all 0), and edited them into the enemy territory to attack. So now the hobbits are this:

        <attachment name="unitAttachment" attachTo="hobbits" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
        </attachment>
    

    The program is not accepting that I want all default. So I have to have at least 1 option, it seems. So this:

        <attachment name="unitAttachment" attachTo="hobbits" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
          <option name="attack" value="0"/>
        </attachment>
    

    Now the hobbits are all destroyed automatically while attacking.

    So, wondering this was maybe because of having no retreat zones, I've changed the hobbits to this:

        <attachment name="unitAttachment" attachTo="hobbits" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
          <option name="movement" value="1"/>
          <option name="attack" value="0"/>
          <option name="defense" value="0"/>
        </attachment>
    

    But, instead of moving anything, I edited all the hobbits in the enemy territory to attack, so to have no retreat choices (the hobbits all attacking without using their movement 1).

    Now the hobbits are all destroyed automatically while attacking, as well.

    So, with the same coded game (xml) file, I, again, attacked by moving into, thus having the retreat option.

    Again, in this case, they don't automatically die.

    So now I've set the "Transport Casualties Restricted" option false, and edited all the hobbits inside the enemy territory to attack, so to have no retreat choices.

    Now, instead, the hobbits don't automatically die (I have no choices, having no retreat abilities, but I must make all combat rounds needed for the enemy to kills all my hobbits).

    So, it seems that the program behaves the following way:

    Non infrastructure land units are automatically destroyed in attack, against defending units, only if all these conditions are verified:

    • The "Transport Casualties Restricted" property is true.
    • All attacking land units have "attack" value 0.
    • The attacking land units have no retreat options.

    However, to be sure about this matter, I would need a developer to tell exactly how the attack case work, and under what conditions non-infrastructure and non-transport attacking units are automatically destroyed.


  • Admin

    @Cernel So I'm assuming this works different for attacking transports?


  • Moderators

    @redrum I intend to test the same scenario with "World War II Revised" transports instead of "Lord of the Rings: Middle Earth" hobbitses, making the same steps.


  • Moderators

    In "World War II Revised", if I send transports only in attack, they will not automatically die.

    In the same map, if I add this property:

                    <property name="Transport Casualties Restricted" value="true" editable="false">
                            <boolean/>
                    </property>
    

    and remove all transport capacity options, also setting movement equal to 1, so that now transports are not actually able to transport anything, this being its new attachment:

        <attachment name="unitAttachment" attachTo="transport" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
          <option name="movement" value="1"/>
          <option name="isSea" value="true"/>
          <option name="attack" value="0"/>
          <option name="defense" value="1"/>
        </attachment>
    

    They still not automatically die.

    So, I've tried giving transports both attack and defence value of 0, this being the new attachment:

        <attachment name="unitAttachment" attachTo="transport" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
          <option name="movement" value="1"/>
          <option name="isSea" value="true"/>
          <option name="attack" value="0"/>
          <option name="defense" value="0"/>
        </attachment>
    

    They still not automatically die.

    So, I've removed all options from the transports but only the "is sea" one, set at true, and edited them into the hostile sea zone to attack:

        <attachment name="unitAttachment" attachTo="transport" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
          <option name="isSea" value="true"/>
        </attachment>
    

    Now the transports are all destroyed automatically while attacking.

    So, wondering this was maybe because of having no retreat zones, I've changed the transports to this:

        <attachment name="unitAttachment" attachTo="transport" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
          <option name="movement" value="1"/>
          <option name="isSea" value="true"/>
          <option name="attack" value="0"/>
          <option name="defense" value="0"/>
        </attachment>
    

    But, instead of moving anything, I edited all the transports in the hostile sea zone to attack, so to have no retreat choices (the transports all attacking without using their movement 1).

    Now the transports are all destroyed automatically while attacking, as well.

    So, with the same coded game (xml) file, I, again, attacked by moving into, thus having the retreat option.

    Again, in this case, they don't automatically die.

    So now I've set the "Transport Casualties Restricted" option false, and edited all the transports inside the enemy territory to attack, so to have no retreat choices.

    Now, instead, the transports don't automatically die (I have no choices, having no retreat abilities, but I must make all combat rounds needed for the enemy to kills all my transports).

    So, it seems that the program behaves the following way:

    Non infrastructure and non transport (I've used the unit called "transport", but without transport capacity assigned, thus they are transports in name only) sea units are automatically destroyed in attack, against defending units, only if all these conditions are verified:

    • The "Transport Casualties Restricted" property is true.
    • All attacking land units have "attack" value 0.
    • The attacking land units have no retreat options.

    This means that, as long as they are both non transports, offenceless land and sea units appear behaving the same way.

    Of course, actual sea transports under the "Transport Casualties Restricted" property should, instead, behave like "transport" units currently do in "World War II v3 1941".


  • Moderators

    I've tested "World War II v3 1941" transports (no changes made to the game (xml) file), editing 99 Germans transports in 3 Sea Zone and sending them all alone to attack 2 Sea Zone.

    The offenceless (actual) transports are never automatically destroyed, but you are kept being presented with the option of retreating or press the attack.

    Gameplay wise, this behaviour allows you to "strafe" with only (offenceless) transports, by sending transports from different sea zones, retreating them all into one of them.

    I believe this is a rules consistent behaviour, as far as v3 goes, as the only ruleset in which you cannot send transports only in attack is Classic, while from Revised onwards you can do it. And in all rulesets, from Classic to v5, offenceless transports alone are never automatically destroyed, if they can retreat.

    @Panther for confirmation.

    From the testing, therefore, it seems that offenceless sea units behave the same way, in attack, regardless of having transport capacity or not (and, in turn, they behave the same way as offenceless land units).

    Basically here TripleA, with the autodestruction of offenceless, appears doing nothing but saving you time, in the case in which you have no retreat ability, thus you would eventually lose all transports anyways. What is strange (and makes no sense to me), however, is that this autodestruction behaviour is apparently related to a v3 only property, while, per correct intended rules, transports alone and unable to retreat were autodestroyed already back in Classic (and would make sense just to do it in any case, if only since it's just a time saving feature, apparently (I guess one should also test the case of offenceless units having offensive AA attacks)).


  • Moderators Admin

    @Cernel
    In Anniversary and later rulesets you can't send only transports to a sea battle. By the rules "Transports may not attack in a sea battle without being accompanied by at least one unit with an attack value."


  • Moderators

    @Panther Ah, didn't remember that. I thought that transports were just regular combat units except for taken last and defenceless autoremoval.

    So, is it Revised the only ruleset in which you can send transports alone in attack?


  • Moderators

    @Panther said in How do you make a unit autodestroyed if alone without being an infrastructure or a transport:

    @Cernel
    In Anniversary and later rulesets you can't send only transports to a sea battle. By the rules "Transports may not attack in a sea battle without being accompanied by at least one unit with an attack value."

    Anyways, aside from the fact that you cannot send them alone, I believe all the rest is consistent. I mean, once they are alone in offence and they can retreat, you are free to keep having them killed or retreat any time you want right, without any autoremoval? Only Classic you are obliged to retreat them as soon as you can.


Log in to reply