Page MenuHomeFeedback Tracker

getAttackTarget seems to always return objNull
Assigned, NormalPublic

Description

I had a bunch of AI in my squad and they were engaging some targets (air, land, man), but the command always returned objNull. It appears that the command is identical to assignedTarget.

Isn't this a bug? If not, can you please explain the purpose of this command?

Details

Severity
None
Resolution
Open
Reproducibility
Always
Operating System
Windows 7
Category
Scripting

Related Objects

Mentioned In
T153824:

Event Timeline

Leopard20 renamed this task from getAttackTarget seems to always returns objNull to getAttackTarget seems to always return objNull.
BIS_fnc_KK changed the task status from New to Assigned.

It worked fine for me for AI under my command - didnt test yet with AI only groups though.

h- added a subscriber: h-.Jul 11 2020, 7:07 PM

I had exactly the same experience as Leopard20. Objnull until I assigned the target, AI calling out targets but all was objnull until I assigned it. The only difference to assignedTarget was that after the target was killed assignedTarget went null but this command still returned the target.

Should work better from 1.99.146567

@BIS_fnc_KK
Yes, it does work better. Thanks.
Just a question: Is it possible to update the command so that it returns the target even if the unit is not engaging? (For example, if combat mode is "GREEN" or "BLUE")

h- added a comment.Aug 22 2020, 11:07 AM

Yes, it indeed seems to work better now. Huge thanks! 👍

Although, and I guess related to what Leopard is suggesting above, seems that the target is identified only when the unit starts firing at it (in AI led squad/lone AI).
Then again, I guess the command name kinda says this..

Not knowing the actual AI "thought" process dunno if it's possible to have the command grab the target the AI is wondering about before identifying it as a threat that should be engaged, or is for example AI settings something that affects this, or is it just the way the AI works and can't be helped.. Maybe we need getAIScanningTarget command 🙂

with the release of 2.00 assignedTarget seems completely broken and getAttackTarget only seems reliable when the AI is actively engaging.
CommandTarget etc will work with assignedTarget but if an AI leader is assigning targets, it never displays them. The previous release has no such issue

While monitoring a tank, assignedTarget remained objNull even when the tank was trying to engage another tank, getAttackTarget returned the correct target when the gunner started to fire.

with the release of 2.00 assignedTarget seems completely broken

It has not been touched

with the release of 2.00 assignedTarget seems completely broken

It has not been touched

That's very strange then. I ran identical tests in 2.00 and in 1.98.
In 2.00 assignedTarget never updated when an AI squad leader assigned a target.
In 1.98 it would.
Both instances were in the same default combat modes etc, maybe that's related.

Did more investigation into it, it's not working as expected in 1.98 aswell - it just appeared to work. In v1.98 assignedTarget only works when the gunner has vision on the target(ie. if the gunner is in a tank turret, it will only update assignedTarget when the turret has turned to face the target) otherwise it remains objNull. Don't think it's weirdness is related to 2.00 so either it got broke earlier or it's always been this way

BIS_fnc_KK removed BIS_fnc_KK as the assignee of this task.Nov 24 2020, 6:14 PM
BIS_fnc_KK added a subscriber: BIS_fnc_KK.