You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To prune a long story short, fight command uses Enemy_InLos_ValidTarget to see if a target is valid, which in turn uses
bool CMobileCAI::IsValidTarget
Which contains
if (owner->unitDef->noChaseCategory & enemy->category) return false
therefore in 'some cases' (I can't see why not all, however), fight commands will not realise an enemy that is in the 'nochasecategory' is something it should consider as a real target and stop moving when in range of.
Nochasecategory is intended to be what it says on the tin, eg a unit will still shoot and engage with units there, but not pursue if they run away. The code seems to not always amount to that end result.
Example, this unit has 'nochasecategory="ALL"', will shoot a target as expected, but will not halt when fight-moved into range.
(However razorbacks with same tag, do halt correctly when given same command, so there is something else at play too)
When the nochasecategory tag is removed, they will halt at fight distance correctly.
nochaseonweaponon.mp4nochaseoffweaponon.mp4
The text was updated successfully, but these errors were encountered:
To prune a long story short, fight command uses Enemy_InLos_ValidTarget to see if a target is valid, which in turn uses
bool CMobileCAI::IsValidTarget
Which contains
if (owner->unitDef->noChaseCategory & enemy->category) return false
therefore in 'some cases' (I can't see why not all, however), fight commands will not realise an enemy that is in the 'nochasecategory' is something it should consider as a real target and stop moving when in range of.
Nochasecategory is intended to be what it says on the tin, eg a unit will still shoot and engage with units there, but not pursue if they run away. The code seems to not always amount to that end result.
spring/rts/Game/GameHelper.cpp
Line 491 in ab88be7
spring/rts/Sim/Units/CommandAI/MobileCAI.cpp
Line 573 in ab88be7
Discord discussions and more clips start around here: https://discord.com/channels/549281623154229250/724924957074915358/1233044341866369074
Example, this unit has 'nochasecategory="ALL"', will shoot a target as expected, but will not halt when fight-moved into range.
(However razorbacks with same tag, do halt correctly when given same command, so there is something else at play too)
When the nochasecategory tag is removed, they will halt at fight distance correctly.
nochaseonweaponon.mp4
nochaseoffweaponon.mp4
The text was updated successfully, but these errors were encountered: