Difference between revisions of "VN ms fnc tracker receiveNoise"

From Savage Game Design Wiki
Jump to navigation Jump to search
m (1 revision imported)
m (Text replacement - " |a= " to " |author= ")
Line 4: Line 4:
 
|v= 1.00
 
|v= 1.00
  
|a= Wyqer, veteran29
+
|author= Wyqer, veteran29
  
 
|e=
 
|e=

Revision as of 18:35, 5 January 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
-