Jump to content

Sign in to follow this  
mons00n

Using default sounds with CBA

Recommended Posts

I can't seem to find a way to do this, but then again I'm fairly new to scripting. I'm having issues with createSoundsource and would like to try CBA_fnc_globalsay3d; but it seems that CBA can't find the sound file I'm referring to even though it works through createSoundsource. I'm calling CBA via:

[_marker, "Sound_Alarm2"] call CBA_fnc_globalSay3d;

Is there any way to point CBA to the default sounds? Thanks!

Share this post


Link to post
Share on other sites

I don't use this too much but I am pretty sure you need an object for the sound and not a marker. http://community.bistudio.com/wiki/Object . You need some type of object to "Say" the sound or for the sound to emanate from. You could probably even use an invisible object if you wanted.

Also do you get any errors in your rpt?

Share this post


Link to post
Share on other sites
  Riouken said:
I don't use this too much but I am pretty sure you need an object for the sound and not a marker. http://community.bistudio.com/wiki/Object . You need some type of object to "Say" the sound or for the sound to emanate from. You could probably even use an invisible object if you wanted.

Also do you get any errors in your rpt?

I forgot to mention this, you're absolutely correct. I've changed to an object and the error is that it cannot find Sound_Alarm2, this may be because that particular sound is a member of CfgVehicles and not CfgSound. So I guess I should ask how would I make Sound_Alarm2 a CfgSound object as well? Alternatively is there any way to extract the sound file and just stick it in my mission folder?

Share this post


Link to post
Share on other sites

Yes you can add it to your mission as a custom sound:

http://community.bistudio.com/wiki/Description.ext#cfgSounds

Tutorial:

http://ofp.toadlife.net/downloads/tutorials/tutorial_sound/tutorial_sound.html

Although I doubt you would have to go to that depth, just define it as a custom sound in your description.ext and point to it in CfgVehicles. since it should be on everyone's comptuer already.

But maybe some sound experts will come along and give some better/more advice. Like I said I dont mess with sounds to much.

Share this post


Link to post
Share on other sites
  Riouken said:
just define it as a custom sound in your description.ext and point to it in CfgVehicles. since it should be on everyone's comptuer already.

How would I do this exactly? I've added custom sounds before and that's no problem, but how to point it to CfgVehicles...that I'm not 100% on.

Share this post


Link to post
Share on other sites

It should have a defalt location or path like (Im just making this up but it will look like this) ca\extra\sounds\general\Sound_Alarm2.ogg // or something like that.

---------- Post added at 06:56 PM ---------- Previous post was at 06:43 PM ----------

This is UNTESTED but I think this will get the path for you, you can give it a shot.

// Run in game to get the path for "Sound_Alarm2" will hint and copy it to clipboard.


_path = getText(configFile >> "cfgVehicles" >> "Sound_Alarm2" >> "model");




hint _path;


copyToClipboard _path;

Share this post


Link to post
Share on other sites
  Riouken said:
It should have a defalt location or path like (Im just making this up but it will look like this) ca\extra\sounds\general\Sound_Alarm2.ogg // or something like that.

---------- Post added at 06:56 PM ---------- Previous post was at 06:43 PM ----------

This is UNTESTED but I think this will get the path for you, you can give it a shot.

// Run in game to get the path for "Sound_Alarm2" will hint and copy it to clipboard.


_path = getText(configFile >> "cfgVehicles" >> "Sound_Alarm2" >> "model");




hint _path;


copyToClipboard _path;

no good, 'model' returns nothing, "icon" returns the path shown here, but that's just an icon path....arrrg. Wish there was an easy way to just extract the sound and I'll throw it in my mission folder.

Share this post


Link to post
Share on other sites
  mons00n said:
no good, 'model' returns nothing, "icon" returns the path shown here, but that's just an icon path....arrrg. Wish there was an easy way to just extract the sound and I'll throw it in my mission folder.

Have you tried this:

AirAlarmSfx

That is listed in in the link, if it is already in configsound then you can just use it with the cba command.

Share this post


Link to post
Share on other sites
  Riouken said:
Have you tried this:

AirAlarmSfx

That is listed in in the link, if it is already in configsound then you can just use it with the cba command.

Sure did, gonna give up for the evening =(

Share this post


Link to post
Share on other sites

Well I changed things up a bit and decided to go with CBA_fnc_globalExecute. It seems to do the trick even though it's a little picky:

  Quote
_obj = _speakers select 0;

[-1, {snd0 = createSoundSource ["Sound_Alarm2", _this, [],0]}, _obj] call CBA_fnc_globalExecute;

_obj = _speakers select 1;

[-1, {snd1 = createSoundSource ["Sound_Alarm2", _this, [],0]}, _obj] call CBA_fnc_globalExecute;

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  

×