Jump to content
Sign in to follow this  
Ex3B

Problem playing sounds in a mission

Recommended Posts

So I'm trying to spruce up a single player mission series I've made (using assets of my own mod - modified A2 ports and modifications of other open source mods) by adding some speech (using online text2speech generators) instead of just text over the radio.

 

I'm starting with the first missions which open with "F-35Bs", and its really useful just to know when the AI wingman fires a missile, as what type. So to that end, I've added event handlers so that the player and the AI wingman will use NATO brevity codes when firing vehicle weapons:

 

Spoiler

//Player Event handler

this addEventHandler ["Fired", 
 {  
  if (_this select 1 == "EX3B_gatling_20mm") then { playSound "EX3B_Guns_1"; player_1 sideChat "Guns Guns Guns";};  
  if (_this select 1 == "EX3B_gatling_API_HE_20mm") then { playSound "EX3B_Guns_1"; player_1 sideChat "Guns Guns Guns";}; 
  if (_this select 1 == "EX3B_gatling_25mm") then { playSound "EX3B_Guns_1"; player_1 sideChat "Guns Guns Guns";}; 
  if (_this select 1 == "EX3B_gatling_API_HE_25mm") then { playSound "EX3B_Guns_1"; player_1 sideChat "Guns Guns Guns";}; 
 
  if (_this select 1 == "weapon_AMRAAMLauncher") then { playSound "EX3B_Fox3_1"; player_1 sideChat "Fox 3";}; 
 
  if (_this select 1 == "weapon_BIM9xLauncher") then { playSound "EX3B_Fox2_1"; player_1 sideChat "Fox 2";}; 
  if (_this select 1 == "missiles_ASRAAM") then { playSound "EX3B_Fox2_1"; player_1 sideChat "Fox 2";}; 
 
 
  if (_this select 1 == "weapon_ALARMLauncher") then { playSound "EX3B_Magnum_1"; player_1 sideChat "Magnum";}; 
  if (_this select 1 == "weapon_HARMLauncher") then { playSound "EX3B_Magnum_1"; player_1 sideChat "Magnum";}; 
 
  if (_this select 1 == "missiles_SCALPEL") then { playSound "EX3B_Rifle_1"; player_1 sideChat "Rifle";}; 
  if (_this select 1 == "missiles_DAGR_HE") then { playSound "EX3B_Rifle_1"; player_1 sideChat "Rifle";}; 
  if (_this select 1 == "missiles_DAGR_HEAT") then { playSound "EX3B_Rifle_1"; player_1 sideChat "Rifle";}; 
  if (_this select 1 == "missiles_DAGR") then { playSound "EX3B_Rifle_1"; player_1 sideChat "Rifle";}; 
  if (_this select 1 == "weapon_AGM_65Launcher") then { playSound "EX3B_Rifle_1"; player_1 sideChat "Rifle";}; 
 
  if (_this select 1 == "EX3B_weapon_JSOWLauncher") then { playSound "EX3B_Paveway_1"; player_1 sideChat "Paveway";}; 
  if (_this select 1 == "weapon_SDBLauncher") then { playSound "EX3B_Paveway_1"; player_1 sideChat "Paveway";}; 
  if (_this select 1 == "weapon_GBU12Launcher") then { playSound "EX3B_Paveway_1"; player_1 sideChat "Paveway";}; 
 }]; 
 
//wingman event handler

 

this addEventHandler  
["Fired", 
 {  
  if (_this select 1 == "EX3B_gatling_20mm") then { playSound "EX3B_Guns_2"; wingman sideChat "Guns Guns Guns";}; 
  if (_this select 1 == "EX3B_gatling_API_HE_20mm") then { playSound "EX3B_Guns_2"; wingman sideChat "Guns Guns Guns";}; 
  if (_this select 1 == "EX3B_gatling_25mm") then { playSound "EX3B_Guns_2"; wingman sideChat "Guns Guns Guns";}; 
  if (_this select 1 == "EX3B_gatling_API_HE_25mm") then { playSound "EX3B_Guns_2"; wingman sideChat "Guns Guns Guns";}; 
 
  if (_this select 1 == "weapon_AMRAAMLauncher") then { playSound "EX3B_Fox3_2"; wingman sideChat "Fox 3";}; 
 
  if (_this select 1 == "weapon_BIM9xLauncher") then { playSound "EX3B_Fox2_2"; wingman sideChat "Fox 2";}; 
  if (_this select 1 == "missiles_ASRAAM") then { playSound "EX3B_Fox2_2"; wingman sideChat "Fox 2";}; 
 
  if (_this select 1 == "weapon_ALARMLauncher") then { playSound "EX3B_Magnum_2"; wingman sideChat "Magnum";}; 
  if (_this select 1 == "weapon_HARMLauncher") then { playSound "EX3B_Magnum_2"; wingman sideChat "Magnum";}; 
 
  if (_this select 1 == "missiles_SCALPEL") then { playSound "EX3B_Rifle_2"; wingman sideChat "Rifle";}; 
  if (_this select 1 == "missiles_DAGR_HE") then { playSound "EX3B_Rifle_2"; wingman sideChat "Rifle";}; 
  if (_this select 1 == "missiles_DAGR_HEAT") then { playSound "EX3B_Rifle_2"; wingman sideChat "Rifle";}; 
  if (_this select 1 == "missiles_DAGR") then { playSound "EX3B_Rifle_2"; wingman sideChat "Rifle";}; 
  if (_this select 1 == "weapon_AGM_65Launcher") then { playSound "EX3B_Rifle_2"; wingman sideChat "Rifle";}; 
 
  if (_this select 1 == "EX3B_weapon_JSOWLauncher") then { playSound "EX3B_Paveway_2"; wingman sideChat "Paveway";}; 
  if (_this select 1 == "weapon_SDBLauncher") then { playSound "EX3B_Paveway_2"; wingman sideChat "Paveway";}; 
  if (_this select 1 == "weapon_GBU12Launcher") then { playSound "EX3B_Paveway_2"; wingman sideChat "Paveway";}; 
 } 
];

 

The event handler seems to work correctly, and the side chat messages show correctly... but in the middle of combat, I don't want to be reading sidechat to know if my wingman has already fired an ARM at the radar or not. I would like to hear it (and also for ambiance/immersion, if I get this working, I will add a lot more speech to the missions).

 

The sounds being referenced are in an addon I made "EX3B_sounds", which is packed loaded with the same mod that adds the F-35B( named the "AV-35B Phantom" in the mod, but whatever)

EX3B_sounds.pbo contains the .ogg files for the NATO brevity codes, and a config.cpp file as follows:

Spoiler

class CfgPatches
{
    class Ex3B_Sounds
    {
        author="$STR_A3_Bohemia_Interactive";
        name="Arma 3 - Sound Effects";
        url="https://www.arma3.com";
        requiredAddons[]=
        {
            "A3_Sounds_F",
        };
        requiredVersion=0.1;
        units[]=
        {
        };
        weapons[]={};
    };
};
class CfgSounds
{
    sounds[] = {}; // OFP required it filled, now it can be empty or absent depending on the game's version

    class EX3B_Magnum_1
    {
        name = "EX3B_Magnum_1";                        // display name
        sound[] = { "EX3B_sounds\Magnum_1.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class EX3B_Rifle_1
    {
        name = "EX3B_Rifle_1";                        // display name
        sound[] = { "EX3B_sounds\Rifle_1.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class EX3B_Fox3_1
    {
        name = "EX3B_Fox3_1";                        // display name
        sound[] = { "EX3B_sounds\Fox3_1.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class EX3B_Fox2_1
    {
        name = "EX3B_Fox2_1";                        // display name
        sound[] = { "EX3B_sounds\Fox2_1.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class EX3B_Paveway_1
    {
        name = "EX3B_Paveway_1";                        // display name
        sound[] = { "EX3B_sounds\Paveway_1.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class EX3B_Pickle_1
    {
        name = "EX3B_Pickle_1";                        // display name
        sound[] = { "EX3B_sounds\Pickle_1.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class EX3B_Guns_1
    {
        name = "EX3B_Guns_1";                        // display name
        sound[] = { "EX3B_sounds\Guns_1.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class EX3B_Splash_1
    {
        name = "EX3B_Splash_1";                        // display name
        sound[] = { "EX3B_sounds\Splash_1.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
// second voice
    class EX3B_Magnum_2
    {
        name = "EX3B_Magnum_2";                        // display name
        sound[] = { "EX3B_sounds\Magnum_2.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class EX3B_Rifle_2
    {
        name = "EX3B_Rifle_2";                        // display name
        sound[] = { "EX3B_sounds\Rifle_2.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class EX3B_Fox3_2
    {
        name = "EX3B_Fox3_2";                        // display name
        sound[] = { "EX3B_sounds\Fox3_2.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class EX3B_Fox2_2
    {
        name = "EX3B_Fox2_2";                        // display name
        sound[] = { "EX3B_sounds\Fox2_2.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class EX3B_Paveway_2
    {
        name = "EX3B_Paveway_2";                        // display name
        sound[] = { "EX3B_sounds\Paveway_2.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class EX3B_Pickle_2
    {
        name = "EX3B_Pickle_2";                        // display name
        sound[] = { "EX3B_sounds\Pickle_2.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class EX3B_Guns_2
    {
        name = "EX3B_Guns_2";                        // display name
        sound[] = { "EX3B_sounds\Guns_2.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class EX3B_Splash_2
    {
        name = "EX3B_Splash_2";                        // display name
        sound[] = { "EX3B_sounds\Splash_2.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    }; //https://toolsaday.com/text-to-speech
};

 

I get no error messages (I used to get error messages that the sound file was not found, but I was able to fix that), I just don't hear anything.

 

What am I doing wrong?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×