CannotTarget not working
-
I am trying the new CanNotTarget feature. It seems to have no effect, casualties are being taken normally. I am using 2.0.16209. Am I using the feature in an incorrect way?
<attachmentList> <attachment name="unitAttachment" attachTo="infantry" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType"> <option name="movement" value="1"/> <option name="attack" value="1"/> <option name="defense" value="2"/> <option name="artillerySupportable" value="true"/> <option name="transportCost" value="1"/> <option name="canNotTarget" value="fighter:bomber"/> </attachment> <attachment name="unitAttachment" attachTo="blockhouse" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType"> <option name="movement" value="0"/> <option name="attack" value="1"/> <option name="defense" value="2"/> <option name="canNotTarget" value="fighter:bomber"/> </attachment> <attachment name="unitAttachment" attachTo="artillery" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType"> <option name="movement" value="1"/> <option name="attack" value="2"/> <option name="defense" value="2"/> <option name="artillery" value="true"/> <option name="attackAA" value="1"/> <option name="targetsAA" value="fighter:bomber"/> <option name="isAAforCombatOnly" value="true"/> <option name="maxAAattacks" value="1"/> </attachment> <attachment name="unitAttachment" attachTo="armour" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType"> <option name="movement" value="2"/> <option name="canBlitz" value="true"/> <option name="attack" value="3"/> <option name="defense" value="2"/> <option name="canBlitz" value="true"/> <option name="canNotTarget" value="fighter:bomber"/> </attachment> <attachment name="unitAttachment" attachTo="armour_ge" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType"> <option name="movement" value="2"/> <option name="canBlitz" value="true"/> <option name="attack" value="3"/> <option name="defense" value="3"/> <option name="canBlitz" value="true"/> <option name="canNotTarget" value="fighter:bomber"/> </attachment> <attachment name="unitAttachment" attachTo="fighter" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType"> <option name="movement" value="20"/> <option name="isAir" value="true"/> <option name="attack" value="1"/> <option name="defense" value="1"/> <option name="offensiveAttackAA" value="1"/> <option name="AttackAA" value="1"/> <option name="targetsAA" value="infantry:artillery:armour_ge"/> <option name="isAAforCombatOnly" value="true"/> <option name="canNotBeTargetedBy" value="infantry:armour:armour_ge:blockhouse"/> </attachment> <attachment name="unitAttachment" attachTo="bomber" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType"> <option name="movement" value="20"/> <option name="isAir" value="true"/> <option name="attack" value="3"/> <option name="defense" value="3"/> <option name="canNotBeTargetedBy" value="infantry:armour:armour_ge:blockhouse"/> </attachment>
-
@RogerCooper Those 2 "sub options" are the only ones that aren't fully implemented yet:
Most functionality will now work for land/air subs but there are still some further changes need especially for canNotTarget and canNotBeTargetedBy as these are hardcoded to just check if empty or not.So the only thing you can do with them at the moment is have them function as subs/air do as they are still partially hardcoded. The main reason is it is pretty complex to implement because they need to group the rolls separately based on the targets or not being targeted by not just hardcoded to air units.
For canNotTarget, I think if you add isFirstStrike=true to them then it will fire before other units and not be able to hit air units (can only not target air units and must be used with isFirstStrike at the moment).
For canNotBeTargetedBy, you could for instance set it to all the air units and I think that should work (only works for all air units at the moment).
-
@redrum said in CannotTarget not working:
For canNotTarget, I think if you add isFirstStrike=true to them then it will fire before other units and not be able to hit air units (can only not target air units and must be used with isFirstStrike at the moment).
How about the fact that in v1 submarines don't first strike in defence, but still cannot target air units?
-
@Cernel Whether defending subs first strike happens if either property ww2v2 or "Defending Subs Sneak Attack" is true. But even if they don't first strike on defense due to both of those being false then the subs (or other units that have canNotTarget) will not target air units and just roll separately but essentially at the same time as the normal non-first strike rolls.
-
@redrum said in CannotTarget not working:
@RogerCooper Those 2 "sub options" are the only ones that aren't fully implemented yet:
Most functionality will now work for land/air subs but there are still some further changes need especially for canNotTarget and canNotBeTargetedBy as these are hardcoded to just check if empty or not.I'm not finding this line in pos2. Is this a quote from somewhere?
So the only thing you can do with them at the moment is have them function as subs/air do as they are still partially hardcoded. The main reason is it is pretty complex to implement because they need to group the rolls separately based on the targets or not being targeted by not just hardcoded to air units.
For canNotTarget, I think if you add isFirstStrike=true to them then it will fire before other units and not be able to hit air units (can only not target air units and must be used with isFirstStrike at the moment).
For canNotBeTargetedBy, you could for instance set it to all the air units and I think that should work (only works for all air units at the moment).
At least on lines 1940 and 1941, pos2 is not explaining how to set "canNotTarget" and "canNotBeTargetedBy" to all air units, if you can do it in some other ways but to list all of them or to use the "isSub" option, as I understand you are saying.
I also suggest rewording "cancels out an isSub unit's first strike and submerge abilities" to just "cancel all abilities defined by the following options: canEvade, isFirstStrike, canNotBeTargetedBy, canMoveThroughEnemies" (maybe the 4 elements of this option should have been athomized too).
Other than that, this matter should really be fully documented in pos2, if it is not going to be supported very soon. -
@redrum I wait until this is fully implemented before changing the scenario. Please let me know when your are ready.
-
@RogerCooper Ok. If you do have a zip with some of the examples you posted that would be helpful for testing.
-
-
I remember one of the first things I thought about Axis & Allies is that battleships should not sink submarines, though in the Axis & Allies world submarines fight only when they are not submerged, and never when they are submerged, that I'm pretty sure goes completely against what everyone pictures about submarines (though reading about WW2 I, then, learned that submarines often fought on the surface, actually).
-
So how to set "canNotTarget" and "canNotBeTargetedBy" to all air units?
-
@Cernel either use isSub or set it to any valid unit type. The engine just checks if those properties are not empty and hard code to all air units.
-
Having an expanded possibility of excluding unit types from the set of eligible targets should preferably come with clearer and better ways of defining the total destruction situations, like the autoremoval of undefended transports in v3 or alone aa guns in v5.
I've opened a GitHub issue, for at least clarifying what currently is for the latter:
https://github.com/triplea-game/triplea/issues/5363I've a case, I'm experimenting with, that is the following, code-wise (I'm excluding a couple of related units, namely onager and fort):
<attachment name="unitAttachment" attachTo="ballista" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType"> <option name="movement" value="1"/> <option name="transportCost" value="3"/> <option name="attack" value="2"/> <option name="defense" value="2"/> <option name="isFirstStrike" value="true"/> <option name="canNotTarget" value="wall:fort"/> <option name="requiresUnits" value="city"/> </attachment> <attachment name="unitAttachment" attachTo="wall" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType"> <option name="movement" value="0"/> <option name="attack" value="0"/> <option name="defense" value="0"/> <option name="hitPoints" value="1"/> <option name="whenHitPointsDamagedChangesInto" value="1:true:wall_breached"/> <option name="requiresUnits" value="city"/> <option name="isAir" value="true"/> </attachment> <attachment name="unitAttachment" attachTo="wall_breached" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType"> <option name="isInfrastructure" value="true"/> <option name="movement" value="0"/> <option name="attack" value="0"/> <option name="defense" value="0"/> <option name="hitPoints" value="2"/> <option name="whenHitPointsRepairedChangesInto" value="0:false:wall"/> </attachment>
Practically, this means that "ballista" cannot kill "wall", that is actually a positive disability, as the defender almost always wants to take "wall" as casualty (practically, the same concept as the "gas" of Domination NML, that is better against territories defended by trenches for the fact of being unable to hit them).
However, this creates the issue that you may have only ballistas attacking only walls, a battle that may never end (and will never end if the ballistas were offloaded) (practically, the same concept as ending up with only fighters or bombers against only submarines in v3).
I wish that, in this scenario, the walls would be destroyed, and also turning into 1 hitpoint damaged wall_breacheds. Is there a way I can already obtain this, especially with reference to having the wall behaving the same way as the v5 aa guns (I don't know what it takes)?
-
@Cernel I meant beside making ballista into an offensive AA units that autokills infinite walls and forts if other combat units but walls and forts are absent in the territory. I suppose, for now at least, I'll do it this way; though that is going to be confusing in the generated tooltips.
-
@Cernel I also wish, for example, 1 spearman attacking 10 walls alone (beside the city) could instantly destroy them all (like the v5 aa guns), but them still turning into wall_breacheds, like in the case I would keep rolling the battle until destroying them all (this is just for making the game faster and for the theory, as in practice experienced players can just edit the situation, in similar cases).
-
Hi, I'm just a newbie into all this.
Do you know if there is any development about being able to use these special Sub abilities?If I want to restrict Subs in First Strike phase to only hit surface warships, excluding aircraft (of course) and submarine (also), do you believe this small step can be more easily implemented?
It will not add another screen, or other phase at all. Just make aircraft and Subs not available as valid target.