Difference between revisions of "VN ms fnc tracker receiveNoise"

From Savage Game Design Wiki
Jump to navigation Jump to search
m (Text replacement - "[[vn_" to "[[VN_")
(Page filling)
 
Line 1: Line 1:
[[Category:TODO]]
 
 
{{Function
 
{{Function
  
Line 6: Line 5:
 
|author= Wyqer, veteran29
 
|author= Wyqer, veteran29
  
|a=
+
|a= global
  
|e=
+
|e= global
  
 
|g1= tracker
 
|g1= tracker
  
|d= <pre>/*
+
|d= Handle client generated noise - slightly (0.01) reveals the shooter to surrounding units, friends or foes.
    Author: Wyqer, veteran29
 
    Date: 2019-08-10
 
  
    Description:
+
|s= [unit, distance] call [[VN_ms_fnc_tracker_receiveNoise]]
        Handle client generated noise.
 
  
    Parameter(s):
+
|p1n= unit
        _shooter    - Unit that made the noise  [OBJECT, defaults to objNull]
+
|p1t= object
        _distance  - Hearable noise distance  [NUMBER, defaults to 0]
+
|p1d= the unit that made a noise
 
 
    Returns:
 
        Function reached the end [BOOL]
 
*/
 
params [
 
    ["_shooter", objNull, [objNull]],
 
    ["_distance", 100, [0]]
 
];
 
 
 
private _nearbyUnits = allUnits inAreaArray [getPos _shooter, _distance, _distance];
 
private _nearbyGroups = _nearbyUnits apply {group _x};
 
 
 
{
 
    // we can consider moving AIs on top of heard shot,
 
    // would need a exclude for static sentries (eg. on trees)
 
    // units _x doMove position _shooter;
 
 
 
    // we can consider something more complex here,
 
    // current tests show that even giving little info about player makes AI a lot more aggresive
 
    [_x, [_shooter, 0.01]] remoteExec ["reveal", _x];
 
} forEach (_nearbyGroups arrayIntersect _nearbyGroups);
 
 
 
#ifdef VN_DEBUG
 
    systemChat format ["[Tracker] Noise propagated: %1, %2", _shooter, _distance];
 
#endif
 
 
 
true
 
</pre><small>''(Placeholder description extracted from the function header by '''LM_exportFunctionsToWiki.sqf''')''</small>
 
 
 
|s= [] call [[VN_ms_fnc_tracker_receiveNoise]]
 
 
 
|p1n=
 
|p1t=
 
|p1d=
 
 
|p1v=
 
|p1v=
  
|p2n=
+
|p2n= distance
|p2t=
+
|p2t= number
|p2d=
+
|p2d= hearable noise distance
|p2v=
+
|p2v= 100
  
|r1t=
+
|r1t= boolean
|r1d=
+
|r1d= function's success
  
|x1= <code>-</code>
+
|x1= <code>[player, 50] call [[VN_ms_fnc_tracker_receiveNoise]];</code>
 
}}
 
}}

Latest revision as of 16:15, 26 February 2021

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

Description

Handle client generated noise - slightly (0.01) reveals the shooter to surrounding units, friends or foes.

Syntax

Syntax
[unit, distance] call VN_ms_fnc_tracker_receiveNoise
Parameters
unit: Object - the unit that made a noise
distance: Number - (Optional, default 100) hearable noise distance
Return value
Boolean - function's success

Examples

Example 1
[player, 50] call VN_ms_fnc_tracker_receiveNoise;