Difference between revisions of "VN ms fnc tracker receiveNoise"

From Savage Game Design Wiki
Jump to navigation Jump to search
m (Text replacement - "]]; |p1n=" to "]] |p1n=")
m (Text replacement - "[[vn_" to "[[VN_")
Line 51: Line 51:
 
</pre><small>''(Placeholder description extracted from the function header by '''LM_exportFunctionsToWiki.sqf''')''</small>
 
</pre><small>''(Placeholder description extracted from the function header by '''LM_exportFunctionsToWiki.sqf''')''</small>
  
|s= [] call [[vn_ms_fnc_tracker_receiveNoise]]
+
|s= [] call [[VN_ms_fnc_tracker_receiveNoise]]
  
 
|p1n=
 
|p1n=

Revision as of 17:30, 23 February 2021

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

Description

/*
    Author: Wyqer, veteran29
    Date: 2019-08-10

    Description:
        Handle client generated noise.

    Parameter(s):
        _shooter    - Unit that made the noise  [OBJECT, defaults to objNull]
        _distance   - Hearable noise distance   [NUMBER, defaults to 0]

    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
(Placeholder description extracted from the function header by LM_exportFunctionsToWiki.sqf)

Syntax

Syntax
[] call VN_ms_fnc_tracker_receiveNoise
Return value
Nothing

Examples

Example 1
-