Jump to content
Sign in to follow this  
dame2010

How do i make sound to work in my addon

Recommended Posts

Hi can some one please help me with my addon . I have made a addon which works fine until the sounds meant to play ,it says the sound cant be found. Ive put it in a description ext in side my addon with the sound also.can some one post me a working one if they can or send me to a page with a working one .If I put the description in my mission folder it works fine,it plays the sound Any way this is what I have

class CfgSounds
{
sounds[] = {"gate_close","ping","sg_flash","sg_thrue2","sg_voda","sg_chevronlock",sgc_alarm};



class gate_close
 {
  name = "gate_close";
  sound[] = {"\sound\gate_close.ogg", db+1, 1};
  titles[] = {};
 };

 class ping
 {
  name = "ping";
  sound[] = {"\sound\ping.ogg", db+1, 1};
  titles[] = {};
 };

 class sg_flash
 {
  name = "sg_flash";
  sound[] = {"\sound\sg_flash.ogg", db+1, 1};
  titles[] = {};
 };

 class sg_thrue2
 {
  name = "sg_thrue2";
  sound[] = {"\sound\sg_thrue2.ogg", db+1, 1};
  titles[] = {};
 };

 class sg_chevronlock
 {
  name = "sg_chevronlock";
  sound[] = {"\sound\sg_chevronlock.ogg", db+1, 1};
  titles[] = {};
 };

   class sg_voda
 {
  name = "sg_voda";
  sound[] = {"\sound\sg_voda.ogg", db+1, 1};
  titles[] = {};
 };
 class sgc_alarm
{
	name = "sgc_alarm"; // Name for mission editor
	sound[] = {\sound\sgc_alarm.ogg, db + 1, 1.0};
	titles[] = {};
};
};

Share this post


Link to post
Share on other sites

make sure you drop down a functions module and name it BIS_fnc

also add a preload manager module

name your player: tester

test each sound in your editor by placing down a trigger switch near your player when you load into preview.

in the trigger switch On Act empty field put: tester say "gate_close";

you should hear it unless your sound files are screwed up in some way.

are you sure your path to the file is correct?

"\sound\gate_close.ogg" and not-> "\sounds\gate_close.ogg"

<edit>

K never mind what I wrote above, I see your problem in the code you do not need all the "quotes

in the class CfgSounds part of the syntax at the top. (don't change below that)

class CfgSounds 
{ 
sounds[] = {[color=#ff0000]"[/color]gate_close[color=#ff0000]"[/color],[color=#ff0000]"[/color]ping[color=#ff0000]"[/color],[color=#ff0000]"[/color]sg_flash[color=#ff0000]"[/color],[color=#ff0000]"[/color]sg_thrue2[color=#ff0000]"[/color],[color=#ff0000]"[/color]sg_voda[color=#ff0000]"[/color],[color=#ff0000]"[/color]sg_chevronlock[color=#ff0000]"[/color],sgc_alarm};

it should look like this

class CfgSounds 
{ 
sounds[] = {gate_close, ping, sg_flash, sg_thrue2, sg_voda, sg_chevronlock, sgc_alarm};

Edited by MadM0nkey
should work now

Share this post


Link to post
Share on other sites

awsome. thank you for your help madM0nkey. will try that when i finish work.

Share this post


Link to post
Share on other sites

I still can't get it to work .It still comes up with Sound sgc_alarm not found. I must have stuffed the sound path up some how. my addon name is self_destract and the sgc_alarm sound is in a folder called sounds in the addon . all I have in my addon is the self destract scripts ,sounds folder and description.ext with this

class CfgSounds {

sounds[] = {sgc_alarm};

class sg_alarm {

name = "sg_alarm";

sound = {"\self_destract\sounds\sgc_alarm.ogg", db+1, 1};

titles = {};

};

};

I can not for the life of me see where I have gone wrong.any help would be great

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  

×