Difference between revisions of "VN ms fnc isNear"

From Savage Game Design Wiki
Jump to navigation Jump to search
vn>Unknown user
m (Generated by LM_exportFunctionsToWiki.sqf)
 
(Page filling)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
 
{{Function
 
{{Function
  
 
|v= 1.00
 
|v= 1.00
  
|a= Wyqer, veteran29
+
|author= Wyqer, veteran29
 +
 
 +
|a= global
  
 
|e=
 
|e=
Line 10: Line 11:
 
|g1= general
 
|g1= general
  
|d= <pre>/*
+
|d= Checks if most (&gt;&nbsp;50%) or any (at least 1) of the units are inside a given radius from a given object/position.
    Author: Wyqer, veteran29
 
    Date: 2019-10-14
 
    Last Update: 2020-12-05
 
    Public: Yes
 
  
    Description:
+
|s= [groupsAndUnits, centre, radius, any, distance3D] call [[VN_ms_fnc_isNear]]
        Checks if most of the units or any unit (depending on params) (of given group or array) are inside a given radius of given object/position.
 
  
    Parameter(s):
+
|p1n= groupsAndUnits
        _array  - Groups and/or units to check                  [ARRAY, defaults to []]
+
|p1t= {{Biki|Object}}, {{Biki|Group}}, {{Biki|Array}} of {{Biki|Object}} and/or {{Biki|Group}}
        _center - Center position or object                    [POSITION|OBJECT, defaults to []]
+
|p1d= array of groups and/or units
        _radius - Radius in which all units should be inside    [NUMBER, defaults to 15]
+
|p1v=
        _any    - Check if any unit of group is in area        [BOOL, defaults to false]
 
        _3D    - Check in 3D space                            [BOOL, defaults to false]
 
  
    Example(s):
+
|p2n= centre
        [[group1, group2], vn_co03_pilot, 5, true, true] call vn_ms_fnc_isNear
+
|p2t= {{Biki|Array}} format {{Biki|Position}} or {{Biki|Object}}
 
+
|p2d= the expected destination
    Returns:
+
|p2v=
        Are all (or any) given units inside given radius from given center [BOOL]
 
*/
 
 
 
</pre><small>''(Placeholder description extracted from the function header by '''LM_exportFunctionsToWiki.sqf''')''</small>
 
  
|s= [] call [[vn_ms_fnc_isNear]];
+
|p3n= radius
 +
|p3t= number
 +
|p3d= distance to check
 +
|p3v= 15
  
|p1n=
+
|p4n= any
|p1t=
+
|p4t= boolean
|p1d=
+
|p4d= check if ''any'' unit is close
|p1v=
+
|p4v= false
  
|p2n=
+
|p5n= distance3D
|p2t=
+
|p5t= boolean
|p2d=
+
|p5d= is the check done in 3D distance
|p2v=
+
|p5v= false
  
|r1t=
+
|r1t= boolean
|r1d=
+
|r1d= are all (or any) provided units inside given radius from given centre
  
|x1= <code>-</code>
+
|x1= <code>[<nowiki/>[player, groupBravo], getMarkerPos "destination", 5, true, true] call [[VN_ms_fnc_isNear]];</code>
 
}}
 
}}

Latest revision as of 17:37, 22 February 2021

← back to Functions Introduced in S.O.G. Prairie Fire v1.00
by Wyqer, veteran29
Argument(s): global
Effect(s): unknown

Description

Checks if most (> 50%) or any (at least 1) of the units are inside a given radius from a given object/position.

Syntax

Syntax
[groupsAndUnits, centre, radius, any, distance3D] call VN_ms_fnc_isNear
Parameters
groupsAndUnits: Object, Group, Array of Object and/or Group - array of groups and/or units
centre: Array format Position or Object - the expected destination
radius: Number - (Optional, default 15) distance to check
any: Boolean - (Optional, default false) check if any unit is close
distance3D: Boolean - (Optional, default false) is the check done in 3D distance
Return value
Boolean - are all (or any) provided units inside given radius from given centre

Examples

Example 1
[[player, groupBravo], getMarkerPos "destination", 5, true, true] call VN_ms_fnc_isNear;