Units in Combat - can we limit what a nonAA unit can target in combat?
-
Units in Combat - can we limit what a nonAA unit can target in combat?
context: i would like to make a unit that can only target fortifications (eg trenches) in combat.
i can see other uses for this ability (or restriction).
is this possible?there seems to be some hardcoded restrictions but i have failed to find an option that isn't for AA.
-
@cameron
Yes, see 1941 Global Command Decision, it uses this
<option name="canNotTarget" value="$All-Air$"/>
a lotand Aircraft use this, they cannot target infantry
<option name="canNotTarget" value="$All-Infantry--Motorized$:$All-Air$"/>and a 4 engine Bomber cannot target sea units
<option name="canNotTarget" value="$All-Air$:$All-Sea$"/>Also checkout Artillery line 6275 it suppresses -1 to enemy Bunker Atk & Def
-
interesting...
"canNotTarget" is not in the XML Option Browser... i'm wondering how many other options are missing...
i don't suppose that there is a "canOnlyTarget" option...?i shall have to explore yet another xml and experiment.
-
XML Option Browser is a very good tool. But it is also updated. A better source would be PoS2 xml, but that too is lacking.
Cheers...
-
i find the PoS2 xml rather hard to parse. it's more helpful if i already know what i'm looking for...
although i can never get over the name - i can't help but read "PoS" as "Piece of S..." -
@cameron canNotTarget is in POS 2.
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 values: colon delimited list of units that can't target this unit, ex. air units not being able to target subs
Lots of great options in there.
-
@wc_sumpton said in Units in Combat - can we limit what a nonAA unit can target in combat?:
A better source would be PoS2 xml, but that too is lacking.
Can you make a post with the list of all that is missing?
-
unitAttachment:
"canRetreatOnStalemate" is still not documented.conditionAttachment:
"isAI" 2.6+ only not documented.unitSupportAttachment:
"bonusType" needs to be reworded:
This, to me, would be very hard to explain. Given
Attack with 2 Infantry 1 Elite and 1 Artillery
Infantry attacks at 1
Elite attacks at 2
Artillery can support both Infantry and Elite with a bonus of 1
number = 1
stack count = 3
both infantry attack at 1, artillery attacks at 2, elite attacks at 3
number = 2
stack count = 3
both infantry attack at 1, artillery attacks at 2, elite attacks at 4
number = 3
stack count =2
one infantry attacks at 1, one infantry and artillery attack at 2, elite attacks at 4
number = X
stack count = -1
both infantry attack at 1, artillery attacks at 2, elite attacks at 5.I won't try to explain what happens when another support unit, Heavy Artillery is added. The bonusType can be the same, but count can be different. And then...
So, in this I defer to someone better than me to explain how this works.
Cheers...
P.S. When I first posted these tests, I had forgotten that I had "improvedArtillerySupport" enabled. Thus the test numbers were incorrect. I have corrected the numbers, and the outcomes have become more predictable. I apologies for any misinformation this may have caused.
Cheers...
-
@rogercooper said in Units in Combat - can we limit what a nonAA unit can target in combat?:
canNotTarget ...
i guess i was hoping i could just list the two units i want it to be able to target rather than list every other unit - combination of laziness and desire for less clutter and desire to have less things to update when i invariably end up adding more units...