ACE3/addons/cookoff/CfgSounds.hpp
Joko 2a6fd19762
Cookoff - Improve ammo detonation sounds (#5327)
* initital commit

* use Define for SOS

* fix some issues that got introduced in 1.70

* Prepare config for sounds

* add New Sounds 

improve distanced volume values

* add LAxemann to Author

* add Object Pooling

improve Distances

* fix small mistake

* change pool clearing timing

* change pool wait time

* fix Cookoff sound cleanup

* change to Jonpas Method

change random Distance add

* improve sound Volume over Distance (asked by Bux)

improve mid sounds

* improve a calculation

* Use playSound3D locally

* Make sounds configurable by 3rd party mods

* Added comments, used macros

* Update CfgSounds.hpp

---------

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
2024-02-04 01:36:59 -08:00

67 lines
2.8 KiB
C++

#define VOLUME 2
#define PITCH 1
#define SHOTSOUND(type,dist,N,maxDistance)\
class GVAR(TRIPLES(type,dist,N)) {\
sound[] = {QPATHTOF(sounds\type\DOUBLES(dist,N).wss), VOLUME, PITCH, maxDistance};\
titles[] = {};\
}
#define SHOTSOUNDCLASS(type,dist,maxDistance)\
SHOTSOUND(type,dist,1,maxDistance);\
SHOTSOUND(type,dist,2,maxDistance);\
SHOTSOUND(type,dist,3,maxDistance)
#define SHOTSOUNDCLASSTYPE(type,maxDistance)\
SHOTSOUNDCLASS(type,close,maxDistance);\
SHOTSOUNDCLASS(type,mid,maxDistance);\
SHOTSOUNDCLASS(type,far,maxDistance)
// Allows other mods to change sounds for cook-off
class CfgSounds {
// These macros set up the sounds for the various classes
SHOTSOUNDCLASSTYPE(shotbullet,1250);
SHOTSOUNDCLASSTYPE(shotrocket,1600);
SHOTSOUNDCLASSTYPE(shotshell,1300);
// Missiles use the same sounds as rockets
class GVAR(shotmissile_close_1): GVAR(shotrocket_close_1) {};
class GVAR(shotmissile_close_2): GVAR(shotrocket_close_2) {};
class GVAR(shotmissile_close_3): GVAR(shotrocket_close_3) {};
class GVAR(shotmissile_mid_1): GVAR(shotrocket_mid_1) {};
class GVAR(shotmissile_mid_2): GVAR(shotrocket_mid_2) {};
class GVAR(shotmissile_mid_3): GVAR(shotrocket_mid_3) {};
class GVAR(shotmissile_far_1): GVAR(shotrocket_far_1) {};
class GVAR(shotmissile_far_2): GVAR(shotrocket_far_2) {};
class GVAR(shotmissile_far_3): GVAR(shotrocket_far_3) {};
// Submunitions have the same sound as bullets, but a higher maxDistance
class GVAR(shotsubmunitions_close_1): GVAR(shotbullet_close_1) {
sound[] = {QPATHTOF(sounds\shotbullet\close_1.wss), VOLUME, PITCH, 1600};
};
class GVAR(shotsubmunitions_close_2): GVAR(shotbullet_close_2) {
sound[] = {QPATHTOF(sounds\shotbullet\close_2.wss), VOLUME, PITCH, 1600};
};
class GVAR(shotsubmunitions_close_3): GVAR(shotbullet_close_3) {
sound[] = {QPATHTOF(sounds\shotbullet\close_3.wss), VOLUME, PITCH, 1600};
};
class GVAR(shotsubmunitions_mid_1): GVAR(shotbullet_far_1) {
sound[] = {QPATHTOF(sounds\shotbullet\mid_1.wss), VOLUME, PITCH, 1600};
};
class GVAR(shotsubmunitions_mid_2): GVAR(shotbullet_mid_2) {
sound[] = {QPATHTOF(sounds\shotbullet\mid_2.wss), VOLUME, PITCH, 1600};
};
class GVAR(shotsubmunitions_mid_3): GVAR(shotbullet_mid_3) {
sound[] = {QPATHTOF(sounds\shotbullet\mid_3.wss), VOLUME, PITCH, 1600};
};
class GVAR(shotsubmunitions_far_1): GVAR(shotbullet_far_1) {
sound[] = {QPATHTOF(sounds\shotbullet\far_1.wss), VOLUME, PITCH, 1600};
};
class GVAR(shotsubmunitions_far_2): GVAR(shotbullet_far_2) {
sound[] = {QPATHTOF(sounds\shotbullet\far_2.wss), VOLUME, PITCH, 1600};
};
class GVAR(shotsubmunitions_far_3): GVAR(shotbullet_far_3) {
sound[] = {QPATHTOF(sounds\shotbullet\far_3.wss), VOLUME, PITCH, 1600};
};
};