assignedTarget – Talk

From Bohemia Interactive Community
Revision as of 11:53, 11 January 2023 by Lou Montana (talk | contribs) (Text replacement - "<code>" to "<code style="display: block">")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Does this function return the current target of a unit in all instances? This means does it return the target of a unit whether another unit or scripting assigns it and/or when the unit choses the target by itself.

--Havoc 16:25, 25 December 2006 (CET)


Yes, it seems to. At least in Arma2 1.05. I did a test with an Apache and with a rifleman, using an init-field of
nul = this spawn { while{alive _this} do { sleep 0.2; hintSilent str(assignedTarget _this); }; };
to watch what they were up to, and in both cases once they autonomously targeted an enemy, it was shown in the hint dialog. In the case of the soldier he was the only one in the group, so wasn't assigned a target by a separate leader. Might be interesting to note that they don't immediately target everything they see - I was using switchCamera to show me the AI's POV and the rifleman had a square "lock" indicator come up shifting between two enemies he'd spotted, and it took a while before he actually decided to target one. --nomdeplume 18:14, 31 December 2009 (CET)