Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions addons/grenades/functions/fnc_flashbangThrownFuze.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,15 @@ params ["_projectile"];
TRACE_1("params",_projectile);

if (alive _projectile) then {
private _soundFile = format ["A3\Sounds_F\arsenal\explosives\grenades\Explosion_HE_grenade_0%1.wss", floor (random 4) + 1];
playSound3D [_soundFile, _projectile, false, getPosASL _projectile, 5, 1.2, 400];
private _sounds = getArray (_projectile call CBA_fnc_getObjectConfig >> QGVAR(flashbangExplodeSound));

(if (_sounds isEqualTo []) then {
[format ["A3\Sounds_F\arsenal\explosives\grenades\Explosion_HE_grenade_0%1.wss", floor (random 4) + 1], 5, 1.2, 400]
} else {
selectRandom _sounds
}) params ["_file", "_volume", "_pitch", "_distance"];

playSound3D [_file, _projectile, false, getPosASL _projectile, _volume, _pitch, _distance];

["ace_flashbangExploded", [getPosASL _projectile]] call CBA_fnc_globalEvent;
};
9 changes: 9 additions & 0 deletions docs/wiki/framework/grenades-framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ class CfgAmmo {
ace_grenades_flashbangBangs = 6; // 6 bangs
ace_grenades_flashbangInterval = 0.25; // 0.25 seconds between each subsequent bang
ace_grenades_flashbangIntervalMaxDeviation = 0.05; // Deviation of up to ± 0.05 seconds on each fuse
ace_grenades_flashbangExplodeSound[] = { // Sound that is played upon detonation
{"A3\Sounds_F\arsenal\explosives\grenades\Explosion_HE_grenade_01.wss", 5, 1.2, 400}, // file path, volume, pitch, max distance
{"A3\Sounds_F\arsenal\explosives\grenades\Explosion_HE_grenade_02.wss", 5, 1.2, 400}
};
};
};
```
Expand All @@ -70,6 +74,11 @@ The average amount of time in seconds, after `explosionTime` has passed, between

The amount of randomness in the fuse time.

### 2.1.5 ace_grenades_flashbangExplodeSound

The sounds that can be used when the flashbang detonates. It randomly selects an entry from this array (equal chances, there are no weights involved).
If not defined, `[format ["A3\Sounds_F\arsenal\explosives\grenades\Explosion_HE_grenade_0%1.wss", floor (random 4) + 1], 5, 1.2, 400]` is used as a default instead (4 sounds total).

### 2.2 Incendiary Config Values

```cpp
Expand Down