Jump to content
Sign in to follow this  
jubbie

Addon sound

Recommended Posts

Hullo

I'm attempting to add a sound to my addon. Everything but the sound seems to work. I've tried two different things. The radio is actually a radio on a table. It is named "radio".

I defined the sound in my addon config. Everything looks good there. I also added an event handler to the entry for the object.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

CfgSounds

{

    class radiochatter

    {

    name = {"Radio chatter", db+0, 0, 1};

    sound[] = {"myaddon\sounds\radiochatter.wav"};

    title[] ={};

    };

};

AND later on

class EventHandler

    {

     "_this exec ""\myaddon\radio.sqs""";

    }

And my radio.sqs looks like this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_radio = this select 0

#start

@(_radio animationphase "antenna" ==1 and (getdammage _radio < 0.9)

_radio say "radiochatter";

~1

goto "start";

When I go with this course of action, nothing happens. The antenna is animated and everything works, except there is no sound at all and no error message.

Alternately, I just tried to do this with my radio.sqs:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_radio = this select 0

#start

@(_radio animationphase "antenna" ==1 and (getdammage _radio < 0.9)

_radio say "\myaddon\sounds\radiochatter.wav";

~1

goto "start";

When I do this, everything looks good, but when I use the user action to put up the antenna, I get an error message saying

Quote[/b] ]

Sound "\myaddon\sounds\radiochatter.wav" not found

I also attempted to do this with the radio.sqs:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_radio = this select 0

#start

@(_radio animationphase "antenna" ==1 and (getdammage _radio < 0.9)

_radio say ""\myaddon\sounds\radiochatter.wav"";

~1

goto "start";

And that gave me this error message:

Quote[/b] ]

_radio say ""\myaddon\sounds\radiochatter.wav""; Error Unknown Operator

Any ideas?

Share this post


Link to post
Share on other sites

The first way (... say "radiochatter") was quite right.

Maybe your sound files aren't in mono format? Stereo will not work in OFP

Share this post


Link to post
Share on other sites

No, they're in mono format. I've had the exact same sound file working as a trigger in the game, but I can't get it to emit from and be a part of the addon. sad_o.gif

Share this post


Link to post
Share on other sites

OK, I figured it out.

Quote[/b] ]

CfgSounds

{

   class radiochatter

   {

   name = {"Radio chatter", db+0, 0, 1};

   sound[] = {"myaddon\sounds\radiochatter.wav"};

   title[] ={};

   };

};

should be

Quote[/b] ]

CfgSounds

{

   class radiochatter

   {

   name = {"Radio chatter", db+0, 0, 1};

   sound[] = {"\myaddon\sounds\radiochatter.wav"};

   title[] ={};

   };

};

Dumb mistake on my part. Cheers, Hardrock. smile_o.gif

Share this post


Link to post
Share on other sites
Quote[/b] ]

CfgSounds

class engine

{

sound[]={"\scud_P38\engine.wav",db+55,1}

name = "";

titles[] = {};

};

the DB+55 part is volume, 1 part is playback speed

Quote[/b] ]CfgSounds

{

   class radiochatter

   {

 sound[] = {"\myaddon\sounds\radiochatter.wav", db+0, 1};  

 name = "";

 title[] ={};

   };

};

and maybe up the db+0 to db+50 or something depending on the orig volume.

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  

×