I don't know if this will help you or not, but for my Raven mod, this is how I'm using sounds:
Basically, I have at least two files:
- config.cpp which defines classnames, volume, etc for sounds
- whatever.sqf file that calls the sounds by their classnames
I've had best results using "say" as I can control the volume in the config (not the real volume, but how far the sound "spreads" out from the source)
config.cpp:
Code:
class CfgSounds
{
// List of sounds (to appear in triggers)
/* NOTE - I HAVE DISABLED THIS LINE AS IT WAS DISABLING THE SOUNDS FROM PLAYING FOR SOME REASON */
// sounds[] = {propBuzz,antiTamper,watchBeep_alarm,propBuzz2,prop_startup,addTime};
// Definition for each sound
class propBuzz
{
name = "propBuzz"; // Name for mission editor
sound[] = {\raven\sounds\propBuzz.ogg, db-25, 1.0};
titles[] = {0, ""};
};
class antiTamper
{
name = "antiTamper"; // Name for mission editor
sound[] = {\raven\sounds\antiTamper.ogg, db-15, 1.0}; // db-15 spreads a little farther than db-25 as it was hard to hear over the engine noise
titles[] = {0, ""};
};
class watchBeep_alarm
{
name = "watchBeep_alarm"; // Name for mission editor
sound[] = {\raven\sounds\watchBeep_alarm.ogg, db-25, 1.0};
titles[] = {0, ""};
};
class propBuzz2
{
name = "propBuzz2"; // Name for mission editor
sound[] = {\raven\sounds\propBuzz2.ogg, db-25, 1.0};
titles[] = {0, ""};
};
class prop_startup
{
name = "prop_startup"; // Name for mission editor
sound[] = {\raven\sounds\prop_startup.ogg, db-25, 1.0};
titles[] = {0, ""};
};
class addTime
{
name = "addTime"; // Name for mission editor
sound[] = {\raven\sounds\addTime.ogg, db-25, 1.0};
titles[] = {0, ""};
};
};
Here's a script that plays the engine sound for the Raven while it is in flight:
mavSoundOn.sqf:
Code:
private ["_microAirVehicle"];
_microAirVehicle = _this;
while {mavSoundOn == 1} do
{
_microAirVehicle say ["propBuzz2",1]; // I AM CALLING THE CLASSNAME OF THE SOUND DIRECTLY - NOT A STRING
sleep 0.9980; // WAS 0.9984
};