cursorTarget: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " +" to " ")
m (Some wiki formatting)
 
(35 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{RV|type=command
{{RV|type=command


| arma2
|game1= arma2
|1.00
|version1= 1.00


|game2= arma2oa
|game2= arma2oa
Line 15: Line 15:
|gr1= Object Detection
|gr1= Object Detection


| Returns the target pointed at by the player (usually with cross-hairs). The target has to be known to the player to some degree ([[knowsAbout]] > 0). If target is completely unknown, command returns [[objNull]].
|descr= Returns the target pointed at by the player (usually with cross-hairs). The target has to be known to the player to some degree ([[knowsAbout]] > 0). If target is completely unknown, command returns [[objNull]].<br><br>
<br><br>A valid target could belong to an enemy or a friendly side. Buildings are normally known to player and so are valid targets. Try [[nearTargets]] to see what else is considered a target. While friendly targets are usually known to the player, enemy targets can be totally unknown, especially if "auto-spotting" (or sometimes called "auto-reporting") is switched off. To check if auto-spotting is enabled:<tt>[[difficultyEnabled]] "autospot"</tt>
A valid target could belong to an enemy or a friendly side. Buildings are normally known to player and so are valid targets. Try [[nearTargets]] to see what else is considered a target.
<br><br>[[cursorTarget]] also returns locked target for the duration of the lock even if there is another target under the cursor. As soon as missile is fired, [[cursorTarget]] switches to current known target under cursor or [[objNull]]. Targeting (currently "T" in Arma 3) works regardless of the state of "auto-spotting".
While friendly targets are usually known to the player, enemy targets can be totally unknown, especially if "auto-spotting" (or sometimes called "auto-reporting") is switched off. To check if auto-spotting is enabled: <sqf inline>difficultyEnabled "autospot"</sqf>.<br><br>
<br><br>Adding a target to the known list could be done with [[reveal]] command. When auto-spotting is enabled, zooming on the enemy target with cross-hairs usually reveals the target. As friendly targets are always known, zooming on friendly target could improve [[knowsAbout]] value.
[[cursorTarget]] also returns locked target for the duration of the lock even if there is another target under the cursor. As soon as missile is fired, [[cursorTarget]] switches to current known target under cursor or [[objNull]].
<br><br>[[Side relations]] can also influence target knowledge. For example [[east]] target is unknown target for [[civilian]], but making them friends with [[setFriend]] instantly improves [[civilian]] knowledge of the [[east]].
Targeting ({{Controls|T}} in {{arma3}}) works regardless of the state of "auto-spotting".<br><br>
Adding a target to the known list could be done with [[reveal]] command. When auto-spotting is enabled, zooming on the enemy target with cross-hairs usually reveals the target.
As friendly targets are always known, zooming on friendly target could improve [[knowsAbout]] value.<br><br>
[[Side Relations]] can also influence target knowledge. For example [[east]] target is unknown target for [[civilian]], but making them friends with [[setFriend]] instantly improves [[civilian]] knowledge of the [[east]].


| '''cursorTarget'''
|s1= [[cursorTarget]]


|r1= [[Object]]
|r1= [[Object]]


|x1= <code>[[alive]] [[cursorTarget]];</code>
|x1= <sqf>alive cursorTarget;</sqf>


|seealso= [[cursorObject]], [[getCursorObjectParams]], [[laserTarget]], [[nearTargets]], [[knowsAbout]], [[reveal]], [[lineIntersects]], [[lineIntersectsWith]], [[lineIntersectsObjs]], [[lineIntersectsSurfaces]], [[intersect]], [[checkVisibility]]
|seealso= [[cursorObject]] [[getCursorObjectParams]] [[laserTarget]] [[nearTargets]] [[knowsAbout]] [[reveal]] [[lineIntersects]] [[lineIntersectsWith]] [[lineIntersectsObjs]] [[lineIntersectsSurfaces]] [[intersect]] [[checkVisibility]]
}}
}}


<dl class="command_description">
{{Note
<dt><dt>
|user= GLT Myke
<dd class="notedate">Posted on  01:25, 18 February 2011 (CET)</dd>
|timestamp= 20110218002800
<dt class="note">[[GLT Myke]]</dt>
|text= If the player is in a vehicle and a lockable weapon is selected and a target is locked, the locked target will be returned, regardless if it is in sight or not.
<dd class="note">
}}
If the player is in a vehicle and a lockable weapon is selected and a target is locked, the locked target will be returned, regardless if it is in sight or not.
 
<dt><dt>
{{Note
<dd class="notedate">Posted on 11 March 2011</dd>
|user= .kju
<dt class="note">[[User:kju|kju]] </dt>
|timestamp= 20110311124800
<dd class="note">
|text= Addition to Myke's note:
Addition to Myke's note:
It also works for infantry with launchers that canLock, like Javelin or AA.
It also works for infantry with launchers that canLock, like Javelin or AA.
Only the lock cursor must be visible on the target - not a full lock necessarily.
Only the lock cursor must be visible on the target - not a full lock necessarily.
<dt><dt>
}}
<dd class="notedate">Posted on 13:09, 11 July 2009 (CEST)</dd>
 
<dt class="note">[[User:Lou Montana|Lou Montana]]</dt>
{{Note
<dd class="note">
|user= Lou Montana
*Player must [[knowsAbout|knows about]] what he is pointing to for this command to return something other than <NULL-OBJECT>
|timestamp= 20090711121300
*This command doesn't work through building windows
|text=
*This recognition doesn't work with every object : soldiers, vehicles, big houses are ok, but not trees, plants, road signs or others little things
* Player must [[knowsAbout|know about]] what he is pointing to for this command to return something other than <NULL-OBJECT>
<dt><dt>
* This command doesn't work through building windows
<dd class="notedate">Posted on 22:11, 23 August 2013 (CEST)</dd>
* This recognition doesn't work with every object : soldiers, vehicles, big houses are ok, but not trees, plants, road signs or others little things
<dt class="note">[[User:Killzone_Kid|Killzone_Kid]]</dt>
}}
<dd class="note">
To add to Lou Montana's note, use [[reveal]] command on the object you want to be detected with [[cursorTarget]] when pointing at it. Without it, distant units are most likely to return [[objNull]] even if you shoot and hit them.<br><br>Units that have been previously subjected to [[enableSimulation]] false; or [[enableSimulationGlobal]] false; may stay unrecognised for a long time even after simulation was re-enabled, returning [[objNull]] as [[cursorTarget]]. Force revealing units with [[reveal]] command usually solves the problem. For example: <code>{[[player]] [[reveal]] _x} [[forEach]] [[allUnits]];</code>


</dd>
{{Note
</dl>
|user= Killzone_Kid
|timestamp= 20130823221600
|text= To add to [[User:Lou Montana]]'s note, use [[reveal]] command on the object you want to be detected with [[cursorTarget]] when pointing at it.
Without it, distant units are most likely to return [[objNull]] even if you shoot and hit them.<br><br>
Units that have been previously subjected to [[enableSimulation]] false; or [[enableSimulationGlobal]] false; may stay unrecognised for a long time even after simulation was re-enabled, returning [[objNull]] as [[cursorTarget]].
Force revealing units with [[reveal]] command usually solves the problem. For example:
<sqf>{ player reveal _x } forEach allUnits;</sqf>
}}


{{GameCategory|arma2|Scripting Commands}}
{{Note
{{GameCategory|arma3|Scripting Commands}}
|user= DreadedEntity
{{GameCategory|tkoh|Scripting Commands}}
|timestamp= 20141203184000
|text= [[cursorTarget]] seems to change when your cursor enters an object's [[boundingBox]].
Because of this, if the player is '''inside''' the [[boundingBox]], the object will always be the current [[cursorTarget]] if the player is not looking at another object, although sometimes the object will remain the [[cursorTarget]] even if the player does.
}}


<dl class="command_description">
{{Note
<dt></dt>
|user= Pierre MGI
<dd class="notedate">Posted on December 3, 2014 - 18:40 (UTC)</dd>
|timestamp= 20150421035300
<dt class="note">[[User:DreadedEntity|DreadedEntity]]</dt>
|text= [[cursorTarget]] will not return enemy units, even very close, if "autoreport" is disabled in game difficulty settings, and if player is alone.
<dd class="note">
However, when enemy units open fire on player, the cursortarget becomes functional on these units. If player is in a group, cursortarget is also functional (report by other units).
[[cursorTarget]] seems to change when your cursor enters an object's [[boundingBox]]. Because of this, if the player is '''inside''' the [[boundingBox]], the object will always be the current [[cursorTarget]] if the player is not looking at another object, although sometimes the object will remain the [[cursorTarget]] even if the player does.
}}
</dd>
 
<dt><dt>
{{Note
<dd class="notedate">Posted on April 21, 2015 - 02:53 (UTC)</dd>
|user= Pierre MGI
<dt class="note">[[User:Pierre MGI|Pierre MGI]]</dt>
|timestamp= 20160205203800
<dd class="note">
|text= CursorTarget will return a <Null_Object> for all of thus which have a disabled simulation (_object enableSimulation false).  
Cursortarget will not return enemy units, even very close, if "autoreport" is disabled in game difficulty settings, and if player is alone.
}}
However, when enemy units open fire on player, the cursortarget becomes functional on these units. If player is in a group, cursortarget is also functional (report by other units).  
</dd>
<dt><dt>
<dd class="notedate">Posted on February 5, 2016 - 20:38 (UTC)</dd>
<dt class="note">[[User:Pierre MGI|Pierre MGI]]</dt>
<dd class="note">
CursorTarget will return a <Null_Object> for all of thus which have a disabled simulation (_object enableSimulation false).  
</dd>
</dl>

Latest revision as of 14:31, 12 March 2024

Hover & click on the images for description

Description

Description:
Returns the target pointed at by the player (usually with cross-hairs). The target has to be known to the player to some degree (knowsAbout > 0). If target is completely unknown, command returns objNull.

A valid target could belong to an enemy or a friendly side. Buildings are normally known to player and so are valid targets. Try nearTargets to see what else is considered a target. While friendly targets are usually known to the player, enemy targets can be totally unknown, especially if "auto-spotting" (or sometimes called "auto-reporting") is switched off. To check if auto-spotting is enabled: difficultyEnabled "autospot".

cursorTarget also returns locked target for the duration of the lock even if there is another target under the cursor. As soon as missile is fired, cursorTarget switches to current known target under cursor or objNull. Targeting (T in Arma 3) works regardless of the state of "auto-spotting".

Adding a target to the known list could be done with reveal command. When auto-spotting is enabled, zooming on the enemy target with cross-hairs usually reveals the target. As friendly targets are always known, zooming on friendly target could improve knowsAbout value.

Side Relations can also influence target knowledge. For example east target is unknown target for civilian, but making them friends with setFriend instantly improves civilian knowledge of the east.
Groups:
Object Detection

Syntax

Syntax:
cursorTarget
Return Value:
Object

Examples

Example 1:
alive cursorTarget;

Additional Information

See also:
cursorObject getCursorObjectParams laserTarget nearTargets knowsAbout reveal lineIntersects lineIntersectsWith lineIntersectsObjs lineIntersectsSurfaces intersect checkVisibility

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
GLT Myke - c
Posted on Feb 18, 2011 - 00:28 (UTC)
If the player is in a vehicle and a lockable weapon is selected and a target is locked, the locked target will be returned, regardless if it is in sight or not.
.kju - c
Posted on Mar 11, 2011 - 12:48 (UTC)
Addition to Myke's note: It also works for infantry with launchers that canLock, like Javelin or AA. Only the lock cursor must be visible on the target - not a full lock necessarily.
Lou Montana - c
Posted on Jul 11, 2009 - 12:13 (UTC)
  • Player must know about what he is pointing to for this command to return something other than <NULL-OBJECT>
  • This command doesn't work through building windows
  • This recognition doesn't work with every object : soldiers, vehicles, big houses are ok, but not trees, plants, road signs or others little things
Killzone_Kid - c
Posted on Aug 23, 2013 - 22:16 (UTC)
To add to User:Lou Montana's note, use reveal command on the object you want to be detected with cursorTarget when pointing at it. Without it, distant units are most likely to return objNull even if you shoot and hit them.

Units that have been previously subjected to enableSimulation false; or enableSimulationGlobal false; may stay unrecognised for a long time even after simulation was re-enabled, returning objNull as cursorTarget. Force revealing units with reveal command usually solves the problem. For example:
DreadedEntity - c
Posted on Dec 03, 2014 - 18:40 (UTC)
cursorTarget seems to change when your cursor enters an object's boundingBox. Because of this, if the player is inside the boundingBox, the object will always be the current cursorTarget if the player is not looking at another object, although sometimes the object will remain the cursorTarget even if the player does.
Pierre MGI - c
Posted on Apr 21, 2015 - 03:53 (UTC)
cursorTarget will not return enemy units, even very close, if "autoreport" is disabled in game difficulty settings, and if player is alone. However, when enemy units open fire on player, the cursortarget becomes functional on these units. If player is in a group, cursortarget is also functional (report by other units).
Pierre MGI - c
Posted on Feb 05, 2016 - 20:38 (UTC)
CursorTarget will return a <Null_Object> for all of thus which have a disabled simulation (_object enableSimulation false).