setMissileTargetPos: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - ": PositionAGL" to ": Array format PositionAGL")
m (Some wiki formatting)
Line 8: Line 8:
|gr2= Weapons
|gr2= Weapons


|descr= Sets a guided munition target position. The munition must have {{ic|manualControl}} config to use this command. The target position has to be inside configured missile targeting cone for command to work.
|descr= Sets a guided munition target position.
The munition must have {{ic|manualControl}} config entry to use this command.
The target position has to be inside the missile's configured targeting cone for the command to work.


|s1= munition [[setMissileTargetPos]] position
|s1= munition [[setMissileTargetPos]] position
Line 18: Line 20:
|r1= [[Nothing]]
|r1= [[Nothing]]


|x1= <code>missile1 [[setMissileTargetPos]] [[unitAimPosition]] tank1;</code>
|x1= <sqf>missile1 setMissileTargetPos unitAimPosition tank1;</sqf>


|x2= <code>_missile = [[createVehicle]] ["M_Scalpel_AT",([[player]] [[modelToWorld]] [0,0,100]),[],0,"CAN_COLLIDE"];
|x2= <sqf>
_missile [[setMissileTargetPos]] ([[player]] [[modelToWorld]] [0,100,0]);</code>
private _missile = createVehicle ["M_Scalpel_AT", player modelToWorld [0,0,100], [], 0, "CAN_COLLIDE"];
_missile setMissileTargetPos (player modelToWorld [0,100,0]);
</sqf>


|seealso= [[missileTargetPos]] [[setMissileTarget]] [[missileTarget]]
|seealso= [[missileTargetPos]] [[setMissileTarget]] [[missileTarget]]
}}
}}


{{Note
|user= Benargee
|timestamp= 20200413060400
|text= To get list of compatible missiles with {{ic|manualControl}} = 1, use the below script and paste the clipboard results to a text editor.
<sqf>
private _cfgCount = count (configfile >> "CfgAmmo");
private _pasteStr = "";


<dl class="command_description">
for "_x" from 0 to (_cfgCount - 1) do {
 
_cfg = (configFile >> "CfgAmmo") select _x;
<dt></dt>
_ammoClassName = configName _cfg;
<dd class="notedate">Posted on April 13, 2020 - 06:04 (UTC)</dd>
private _manCtrl = getNumber (configFile >> "CfgAmmo" >> _ammoClassName >> "manualControl");
<dt class="note">[[User:benargee|benargee]]</dt>
if (_manCtrl > 0) then {
<dd class="note">To get list of compatible missiles with {{ic|manualControl}} = 1, use the below script and paste the clipboard results to a text editor.
_pasteStr = _pasteStr + _ammoClassName + endl;
<code>cfgCount = [[count]] ([[configfile]] >> "CfgAmmo");
pasteStr = "";
 
[[for]] "_x" [[from]] 0 [[to]] (cfgCount - 1) [[do]] {
_cfg = (configfile >> "CfgAmmo") [[select]] _x;
_ammoClassName = [[configName]] _cfg;
manCtrl = [[getNumber]] (configfile >> "CfgAmmo" >> _ammoClassName >> "manualControl");
[[if]] (manCtrl > 0) [[then]] {
pasteStr = pasteStr + _ammoClassName + [[endl]];
};
};
};
};


[[copyToClipboard]] pasteStr;</code></dd>
copyToClipboard _pasteStr;
 
</sqf>
</dl>
}}

Revision as of 19:34, 3 May 2022

Hover & click on the images for description

Description

Description:
Sets a guided munition target position. The munition must have manualControl config entry to use this command. The target position has to be inside the missile's configured targeting cone for the command to work.
Groups:
Object ManipulationWeapons

Syntax

Syntax:
munition setMissileTargetPos position
Parameters:
munition: Object
position: Array format PositionAGL
Return Value:
Nothing

Examples

Example 1:
missile1 setMissileTargetPos unitAimPosition tank1;
Example 2:
private _missile = createVehicle ["M_Scalpel_AT", player modelToWorld [0,0,100], [], 0, "CAN_COLLIDE"]; _missile setMissileTargetPos (player modelToWorld [0,100,0]);

Additional Information

See also:
missileTargetPos setMissileTarget missileTarget

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
Benargee - c
Posted on Apr 13, 2020 - 06:04 (UTC)
To get list of compatible missiles with manualControl = 1, use the below script and paste the clipboard results to a text editor.
private _cfgCount = count (configfile >> "CfgAmmo"); private _pasteStr = ""; for "_x" from 0 to (_cfgCount - 1) do { _cfg = (configFile >> "CfgAmmo") select _x; _ammoClassName = configName _cfg; private _manCtrl = getNumber (configFile >> "CfgAmmo" >> _ammoClassName >> "manualControl"); if (_manCtrl > 0) then { _pasteStr = _pasteStr + _ammoClassName + endl; }; }; copyToClipboard _pasteStr;