Page MenuHomeFeedback Tracker

cursorTarget does not work on hostiles
Closed, ResolvedPublic

Description

I was trying to make a script to detect if a player looks at a unit or something else when I found it.

Details

Legacy ID
2463046637
Severity
None
Resolution
No Bug
Reproducibility
Always
Category
Scripting
Steps To Reproduce

place yourself and a unit (hostile to your side)
look at the unit and open the debug console and use the code:
Hint str cursorTarget
it will return <Null-Object>

Additional Information

After you kill the enemy the command seems to works, it gives you the unit id and group as it should...

Civilians always works...

Event Timeline

GuzzenVonLidl edited Additional Information. (Show Details)
GuzzenVonLidl set Category to Scripting.
GuzzenVonLidl set Reproducibility to Always.
GuzzenVonLidl set Severity to None.
GuzzenVonLidl set Resolution to No Bug.
GuzzenVonLidl set Legacy ID to 2463046637.May 7 2016, 7:32 PM
Bohemia added a subscriber: AD2001.Oct 2 2014, 4:36 PM

the hostile needs to be "known" before cursorTarget can return the object

player reveal [cursorTarget, 4];

wouldn't work as cursorTarget is NULL

What happens if you do

{player reveal [_x, 4]} forEach allUnits

Just tested the reveal method, it works, marking as resolved as no bug.

Mass-closing all resolved issues not updated in the last month.

Please PM me in BI Forums (http://forums.bistudio.com/member.php?55374-Fireball) if you feel your bug was closed in error.