Jump to content
Sign in to follow this  
eagledude4

Playing a vehicle sound from a mission script

Recommended Posts

I'm trying to play a sound through my mission script from a vehicle addon, but I'm getting an error that says "'no entry bin\config.bin/cfgsounds/winddown.sound'".

mission script:

_vcl say "winddown";

cfgsounds class from the addon:

class winddown {
	scope = public;
	displayName = "Wind Down";
	drySound[] = {"\il_vic\sounds\winddown.wav", 0.95, 1};
};

I realize I can add the sound to the mission itself, but I'd like to know if this way can work.

Edited by eagledude4

Share this post


Link to post
Share on other sites

Are you trying to play a sound from an addOn as a sound in game on it's own or something? That's not a proper description.ext sound class there for use from the mission editor, that's from a config file for an addOn.

Copy "winddown.wav" to the sound folder under the mission and put this in your description.ext:

class CfgSounds
{
// List of sounds (.ogg files without the .ogg extension)
sounds[] = {winddown};

// Definition for each sound
class winddown
{
	name = "winddown"; // Name for mission editor
	sound[] = {\sound\winddown.ogg, db + 0, 1.0};
	titles[] = {0, ""};
};
};

Not entirely sure wavs will work and the Biki is too slow right now to check.

Edited by kylania

Share this post


Link to post
Share on other sites

As far as I know .wav's do work... just less efficient.

In Kylania's example ... if you do use a .wav files... make sure the file extensions are .wav and not .ogg!

Share this post


Link to post
Share on other sites

I'm sorry for not clarifying fully, Yes I'm trying to play a sound from an addon. And what you described kylania was exactly what I did when I said "I realize I can add the sound to the mission itself".

Edited by eagledude4

Share this post


Link to post
Share on other sites

Umm.. this might work:

class CfgSounds
{
// List of sounds (.ogg files without the .ogg extension)
sounds[] = {winddown};

// Definition for each sound
class winddown
{
	name = "winddown"; // Name for mission editor
	sound[] = {\il_vic\sounds\winddown.wav, db + 0, 1.0};
	titles[] = {0, ""};
};
};

Also, today I learned that the pretty php code tags strip \ from text. Most unhelpful.

Share this post


Link to post
Share on other sites

Try double \\, the first is an escape character in php.

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  

×