BIS fnc randomPos: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Some wiki formatting) |
Lou Montana (talk | contribs) m (Text replacement - "(Optional, default {{hl|[]}})" to "(Optional, default <sqf inline>[]</sqf>)") |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 7: | Line 7: | ||
|version2= 0.50 | |version2= 0.50 | ||
|gr1= | |gr1= Positions | ||
|descr= Selects random position according to given params within given area | |descr= Selects random position according to given params within given area | ||
Line 19: | Line 19: | ||
* [[Location]] - location | * [[Location]] - location | ||
|p2= blacklist: [[Array]] - (Optional, default []) blacklisted areas. If not given, water is blacklisted. Areas can be: | |p2= blacklist: [[Array]] - (Optional, default <sqf inline>[]</sqf>) blacklisted areas. If not given, water is blacklisted. Areas can be: | ||
* [[Object]] - trigger | * [[Object]] - trigger | ||
* [[String]] - marker name or special tags names: "water" - exclude water, "ground" - exclude land | * [[String]] - marker name or special tags names: "water" - exclude water, "ground" - exclude land | ||
Line 25: | Line 25: | ||
* [[Location]] - location | * [[Location]] - location | ||
|p3= code: [[Code]] - (Optional, default { | |p3= code: [[Code]] - (Optional, default <sqf inline>{ true }</sqf>) custom condition which should return true for current position candidate passed in [[Magic Variables#this|_this]] variable to be accepted. If not specified all candidates are accepted | ||
|r1= [[Array]] - position candidate in format [x,y,z] or [0,0] if position cannot be found | |r1= [[Array]] - position candidate in format [x,y,z] or [0,0] if position cannot be found |
Latest revision as of 18:09, 8 November 2023
Description
- Description:
- Selects random position according to given params within given area
- Execution:
- call
- Groups:
- Positions
Syntax
- Syntax:
- [whitelist, blacklist, code] call BIS_fnc_randomPos
- Parameters:
- whitelist: Array - whitelisted areas. If not given, whole map is used. Areas can be:
- blacklist: Array - (Optional, default []) blacklisted areas. If not given, water is blacklisted. Areas can be:
- code: Code - (Optional, default { true }) custom condition which should return true for current position candidate passed in _this variable to be accepted. If not specified all candidates are accepted
- Return Value:
- Array - position candidate in format [x,y,z] or [0,0] if position cannot be found
Examples
- Example 1:
- Example 2:
- Example 3:
- Example 4:
- Example 5:
Additional Information
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
- Posted on Mar 30, 2020 - 21:33 (UTC)
- The code parameter here can be quite powerful. If using Example 5 above, adding code as below will make the returned positions always be on a road.