BIS fnc objectsGrabber: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Found in arma 3 under A2 Functions. Unknown version. mentioned in spotrep 04)
 
m (Fix SQF)
 
(48 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{RV|type=function


{{Function|= Comments
|game1= arma2
____________________________________________________________________________________________
|version1= 1.00


| arma2 |= Game name
|game2= arma2oa
|version2= 1.50


|?|= Game version
|game3= tkoh
____________________________________________________________________________________________
|version3= 1.00


| <pre>/*
|game4= arma3
File: objectGrabber.sqf
|version4= 0.50
Author: Joris-Jan van 't Land


Description:
|gr1= Object Manipulation
Converts a set of placed objects to an object array for the DynO mapper.
Places this information in the debug output for processing.


Parameter(s):
|descr= Converts a set of placed objects to an object array ('''as a [[String]]''') for the [[BIS_fnc_objectsMapper|DynO mapper]].<br>
_this select 0: position of the anchor point (Array)
Format is the following. First, the header:
_this select 1: size of the covered area (Scalar)
<sqf>
_this select 2: grab object orientation? (Boolean) [default: false]
/*
Grab data:
Returns:
Mission: TheMissionName
Ouput text (String)
World: Stratis
Anchor position: [3781.59, 3289.67]
Area size: 50
Using orientation of objects: yes/no
*/
*/
</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
</sqf>
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_sortBy]]; --> |= Syntax
Then, data:
<sqf>
[
["B_UAV_01_F",[-5.23706,-0.183594,-0.00126648],167.39,1,0,[0.605018,-0.575293],"","",true,false],
["C_Offroad_01_F",[-4.25903,4.62158,0.0630951],224.14,1,0,[0.812812,0.190543],"","",true,false]
]
</sqf>


|p1= |= Parameter 1
or, if object orientation is not used:
<sqf>
[
["B_UAV_01_F",[-5.23706,-0.183594,-0.00126648],167.39,1,0,[],"","",true,false],
["C_Offroad_01_F",[-4.25903,4.62158,0.0630951],224.14,1,0,[],"","",true,false]
]
</sqf>


| |= Return value
|s1= [position, size, objectOrientation] call [[BIS_fnc_objectsGrabber]]
____________________________________________________________________________________________


|x1= <code></code> |=
|p1= position: [[Position]] - (Optional, default [0,0]) 2D or 3D position, center of the "grabbing" area
____________________________________________________________________________________________


| |= See also
|p2= size: [[Number]] - (Optional, default 50) size (radius) of the "grabbing" area


}}
|p3= objectOrientation: [[Boolean]] - (Optional, default [[false]]) capture object orientation or not. Format [[BIS_fnc_getPitchBank]]


<h3 style="display:none">Notes</h3>
|r1= [[String]] - arrays are in format [classname, relPos, azimuth, fuel, damage, pitchBankResult, vehicleVarName, initCommands, simulationEnabled, isASL]:
<dl class="command_description">
* classname: [[String]]
<!-- Note Section BEGIN -->
* relPos: [[Array]]
* azimuth: [[Number]]
* fuel: [[Number]]
* damage: [[Number]]
* pitchBankResult: [[Array]] - return from [[BIS_fnc_getPitchBank]] (only if ''objectOrientation'' is true)
* vehicleVarName: [[String]]
* initCommands: [[String]]
* simulationEnabled: [[Boolean]]
* isASL: [[Boolean]]


<!-- Note Section END -->
|x1= <sqf>[getPos player, 20, true] call BIS_fnc_objectsGrabber;</sqf>
</dl>


<h3 style="display:none">Bottom Section</h3>
|seealso= [[BIS_fnc_objectsMapper]] [[BIS_fnc_getPitchBank]] [[BIS_fnc_setPitchBank]]
[[Category:Function Group: Arrays|{{uc:sortBy}}]]
}}
[[Category:Functions|{{uc:sortBy}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:sortBy}}]]

Latest revision as of 17:44, 1 November 2022

Hover & click on the images for description

Description

Description:
Converts a set of placed objects to an object array (as a String) for the DynO mapper.
Format is the following. First, the header:
/* Grab data: Mission: TheMissionName World: Stratis Anchor position: [3781.59, 3289.67] Area size: 50 Using orientation of objects: yes/no */
Then, data:
[ ["B_UAV_01_F",[-5.23706,-0.183594,-0.00126648],167.39,1,0,[0.605018,-0.575293],"","",true,false], ["C_Offroad_01_F",[-4.25903,4.62158,0.0630951],224.14,1,0,[0.812812,0.190543],"","",true,false] ]
or, if object orientation is not used:
[ ["B_UAV_01_F",[-5.23706,-0.183594,-0.00126648],167.39,1,0,[],"","",true,false], ["C_Offroad_01_F",[-4.25903,4.62158,0.0630951],224.14,1,0,[],"","",true,false] ]
Execution:
call
Groups:
Object Manipulation

Syntax

Syntax:
[position, size, objectOrientation] call BIS_fnc_objectsGrabber
Parameters:
position: Position - (Optional, default [0,0]) 2D or 3D position, center of the "grabbing" area
size: Number - (Optional, default 50) size (radius) of the "grabbing" area
objectOrientation: Boolean - (Optional, default false) capture object orientation or not. Format BIS_fnc_getPitchBank
Return Value:
String - arrays are in format [classname, relPos, azimuth, fuel, damage, pitchBankResult, vehicleVarName, initCommands, simulationEnabled, isASL]:

Examples

Example 1:
[getPos player, 20, true] call BIS_fnc_objectsGrabber;

Additional Information

See also:
BIS_fnc_objectsMapper BIS_fnc_getPitchBank BIS_fnc_setPitchBank

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