OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: TheGimp on 12 Jun 2006, 12:55:31

Title: Play a custom sound when unit dies
Post by: TheGimp on 12 Jun 2006, 12:55:31
hi
i know how that i would make a trigger saying condition :not alive man
then i want a sound bite to play , how do i do this?
Title: Re: Play a custom sound when unit dies
Post by: srk on 12 Jun 2006, 13:04:52
Easy. Type this in your On Activation field:-

PlaySound "sound_name"
Title: Re: Play a custom sound when unit dies
Post by: Cheetah on 12 Jun 2006, 13:07:47
Make a "description.ext" in the folder of the mission (your_ofp_directory/users/your_username/missions/name_of_mission).


Code: [Select]
class CfgSounds
{
sounds[] = { };
class bite
{
name = "bite";
sound[] = {"bite.ogg", db+40, 1.0};
titles[] = {1, "" };
};
};

Save the sound as an ogg file named bite. (ogg requires a conversion, use a special program to do this)

In your mission, you can put in the On Activation field: playsound "bite"

Hope this helps and works :)
Title: Re: Play a custom sound when unit dies
Post by: TheGimp on 12 Jun 2006, 14:51:40
are you sure that was right? i copyed it into description and it didnt work
and what would i do to the descriptiuon .ext to add multiple sounds?
Title: Re: Play a custom sound when unit dies
Post by: srk on 12 Jun 2006, 15:55:04
Quote
and what would i do to the descriptiuon .ext to add multiple sounds?

...
class sound1
{
name = "sound1";
sound[] = {"sound1.ogg", db+40, 1.0};
titles[] = {1, "" };
};
class sound2
{
name = "sound2";
sound[] = {"sound2.ogg", db+40, 1.0};
titles[] = {1, "" };
};

...and so on.
Title: Re: Play a custom sound when unit dies
Post by: Gogs on 14 Jun 2006, 18:04:33
Quote
descriptiuon .ext

Make sure you spell it right, or it won't work. It has to be called "description.ext".

Have a folder in you mission folder called "sound" and put your sound in there...
Title: Re: Play a custom sound when unit dies
Post by: The-Architect on 15 Jun 2006, 11:49:37
Check this baby out.  ;D

http://video.google.com/videoplay?docid=7805084038164601808
Title: Re: Play a custom sound when unit dies
Post by: Gogs on 17 Jun 2006, 04:19:23
All about the soundtrack......

Any luck Cam dude?
Title: Re: Play a custom sound when unit dies
Post by: The-Architect on 17 Jun 2006, 12:36:10
 ;D
Title: Re: Play a custom sound when unit dies
Post by: TheGimp on 26 Jun 2006, 16:36:23
yeh thanks i got it working no problems :)