BIS fnc randomPos: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
(Syntax, example, and parameters were all completely wrong.)
Line 9: Line 9:
|1.00|=
|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
| Selects a random position of given whitelist array in trigger 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>_mylocation <nowiki>=</nowiki> [array, array, code] call BIS_fnc_randomPos;</pre> |= Syntax
____________________________________________________________________________________________
____________________________________________________________________________________________






|p1=Array containg position and a trigger object [ [[position]] , [[trigger]]] - [[Array]] |= Parameter 1
|p1=(''optional'') Whitelist (array containing array [[[position]], radius],  or a [[trigger]] object or tags ("water", "ground", "out"). Defaults to [world area] - [[Array]] |= Parameter 1
|p2=Whitelist (one of the following tags: "water", "ground", "out") - [[String]] |= Parameter 2
|p2=(''optional'') Blacklist (array containing the following tags gettings excluded from the result: "water", "ground", "out"). Defaults to ["water", "out"] - [[Array]] |= Parameter 2
|p3=(''optional'') Blacklist (array containing the following tags gettings excluded from the result: "water", "ground", "out") - [[Array]] |= Parameter 2
|p3=(''optional'') Custom condition. Passes position candidate to code as [[_this]] variable. If code evaluates true then position is ultimately returned - [[Code]] |= Parameter 3
|p4=(''optional'') Custom condition (effect unkown) - Code




Line 26: Line 25:
____________________________________________________________________________________________
____________________________________________________________________________________________


|x1= <code>/* lets take a look in the area of the trigger ''_triggerobject'' with the players position as center for a ''ground'' position
|x1= <code>/* lets take a look in the area of the trigger ''_triggerobject'' with a longitude greater than 10000
but no position in the water or outside of the trigger, return the value to _myvariable and execute the custom condition hint(...); */
but no position in the water or outside of the trigger, return the position to _myposition */


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


| |mp= Can be used on client or server maschine.
| |mp= Can be used on client or server machine.


| |= See also
| |= See also

Revision as of 14:45, 16 November 2015


Hover & click on the images for description

Description

Description:
Selects a random position of given whitelist array in trigger 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 machine.
Groups:
Uncategorised

Syntax

Syntax:
_mylocation = [array, array, code] call BIS_fnc_randomPos;
Parameters:
(optional) Whitelist (array containing array [[[position]], radius], or a trigger object or tags ("water", "ground", "out"). Defaults to [world area] - Array
(optional) Blacklist (array containing the following tags gettings excluded from the result: "water", "ground", "out"). Defaults to ["water", "out"] - Array
(optional) Custom condition. Passes position candidate to code as _this variable. If code evaluates true then position is ultimately returned - 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 a longitude greater than 10000 but no position in the water or outside of the trigger, return the position to _myposition */ _myposition = [ [_triggerobject], ["water","out"], {_this select 0 > 10000} ] 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