BIS fnc randomPos: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (1 revision)
No edit summary
Line 3: Line 3:
____________________________________________________________________________________________
____________________________________________________________________________________________


| tkoh |= Game name
| arma3 |=
|1.00|=


|1.00|= Game version
|game2= TKOH |=
|version2= 1.00|=
____________________________________________________________________________________________
| Selects a random position of given params in the triggers area (uses a position as center position). Includes only areas of one of the given types: ''water'', ''ground'', ''out'' (outside of the [[trigger]]) and can exclude types. Can execute a custom code as optional parameter when a position was found. |= Description
 
| <pre>_mylocation <nowiki>=</nowiki> [[position ,trigger],string,array,code] call BIS_fnc_randomPos;</pre> |= Syntax
____________________________________________________________________________________________
____________________________________________________________________________________________


| <pre>/*


Description:
Selects random position of given params within given area


Parameter(s):
|p1=Array containg position and a trigger object [ [[position]] , [[trigger]]] - [[Array]] |= Parameter 1
_this select 0 (Optional): ARRAY - whitelist of elements:
|p2=Whitelist (one of the following tags: "water", "ground", "out") - [[String]] |= Parameter 2
ARRAY - [center,radius]
|p3=(''optional'') Blacklist (array containing the following tags gettings excluded from the result: "water", "ground", "out") - [[Array]] |= Parameter 2
OBJECT - trigger
|p4=(''optional'') Custom condition (effect unkown) - Code
STRING - one of following tags:
"water" - all water surfaces
"ground" - all ground surfaces
"out" - area outside of map area
Default value - map area
_this select 1 (Optional): ARRAY - blacklist (same rules are for whitelist)
Default value: ["water","out"]
_this select 2 (Optional): CODE - custom condition


Returns:
ARRAY - [x,y,z]
*/




</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
|[[position]] (array with x,y,z position) - [[Array]] |= Return value
____________________________________________________________________________________________
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_randomPos]]; --> |= Syntax
|x1= <code>/* lets take a look in the area of the trigger ''_triggerobject'' with the players position as center for a ''ground'' position
 
but no position in the water or outside of the trigger, return the value to _myvariable and execute the custom condition hint(...); */
|p1= |= Parameter 1


| |= Return value
_myposition <nowiki>=</nowiki> [ [ [[position]] [[player]], _triggerobject ], "ground", ["water","out"], {hint("message");} ] [[call]] [[BIS_fnc_randomPos]];
</code> |= Syntax
____________________________________________________________________________________________
____________________________________________________________________________________________


|x1= <code></code> |=  
| |mp= Can be used on client or server maschine.
____________________________________________________________________________________________


| |= See also
| |= See also

Revision as of 16:42, 13 October 2014


Hover & click on the images for description

Description

Description:
Selects a random position of given params in the triggers area (uses a position as center position). Includes only areas of one of the given types: water, ground, out (outside of the trigger) and can exclude types. Can execute a custom code as optional parameter when a position was found.
Execution:
call
Multiplayer:
Can be used on client or server maschine.
Groups:
Uncategorised

Syntax

Syntax:
_mylocation = [[position ,trigger],string,array,code] call BIS_fnc_randomPos;
Parameters:
Array containg position and a trigger object [ position , trigger] - Array
Whitelist (one of the following tags: "water", "ground", "out") - String
(optional) Blacklist (array containing the following tags gettings excluded from the result: "water", "ground", "out") - Array
(optional) Custom condition (effect unkown) - Code
Return Value:
position (array with x,y,z position) - Array

Examples

Example 1:
/* lets take a look in the area of the trigger _triggerobject with the players position as center for a ground position but no position in the water or outside of the trigger, return the value to _myvariable and execute the custom condition hint(...); */ _myposition = [ [ position player, _triggerobject ], "ground", ["water","out"], {hint("message");} ] call BIS_fnc_randomPos;

Additional Information

See also:
See also needed

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

Notes

Bottom Section