Jump to content
Sign in to follow this  
Quack O'Neill

CfgSFX & Sounds

Recommended Posts

I have CfgSounds set up and they work fine with Say3D Say2D but im trying to add in this below and i keep getting No Entry error

class CfgSounds
{
    sounds[] = {};
 


	class stEveLoop
	{
		sound0[] = {"music\voice\steve\watts.ogg", db-10, 1.0, 1000, 0.2, 0, 15, 30};
		sound1[] = {"@music\voice\steve\theoldcountsteve.ogg", db-10, 1.0, 1000, 0.2, 0, 15, 30};
		sound2[] = {"music\voice\steve\lilly.ogg", db-10, 1.0, 1000, 0.2, 0, 15, 30};
		sounds[] = {sound0, sound1, sound2};
		empty[] = {"", 0, 0, 0, 0, 0, 0, 0};
	};

its not closed off because everything else inside of cfgsounds works fine.  im just showing the bit that wont work.
I also tried this with CfgSfx but i got the same error. I tried removing the @ symbol but i get the same error.

I have this in my units init.

playsound "stEveLoop";


Anyone know how to get this multiple file player code working ?

Iv got this in my units init now and im not getting any errors but the sounds arnt playing either

playSound stEveLoop;


 

Share this post


Link to post
Share on other sites

That's the syntax used for cfgSFX, which does not work for cfgSounds. I assume you copy/pasted it, since there appears to be a corrupted character or two - type it all out by hand, or paste it into a code block here and delete the red dots that appear:

 

muWRrSc.png

 

  • Like 1

Share this post


Link to post
Share on other sites

How are you getting those red dots to show up ? i tried all the language options but they wouldnt show up.

yeah its copied and pasted from the wiki. its the owl example

class CfgSounds
{
    sounds[] = {};
 

	class stEveLoop
	{
		
		sound0[] = {"music\voice\steve\watts.ogg", db + 6, 1.0, 1000, 0.2, 0, 15, 30};
		sound1[] = {"@music\voice\steve\theoldcountsteve.ogg", db + 2, 1.0, 1000, 0.2, 0, 15, 30};
		sound2[] = {"music\voice\steve\lilly.ogg", db + 2, 1.0, 1000, 0.2, 0, 15, 30};
		sounds[] = {sound0, sound1, sound2};
		empty[] = {"", 0, 0, 0, 0, 0, 0, 0};
	};
    
};


class CfgSFX
{

	sounds[] = {};

		class stEveLoop1
	{
		
		sound0[] = {"music\voice\steve\watts.ogg", db + 6, 1.0, 1000, 0.2, 0, 15, 30};
		sound1[] = {"@music\voice\steve\theoldcountsteve.ogg", db + 2, 1.0, 1000, 0.2, 0, 15, 30};
		sound2[] = {"music\voice\steve\lilly.ogg", db + 2, 1.0, 1000, 0.2, 0, 15, 30};
		sounds[] = {sound0, sound1, sound2};
		empty[] = {"", 0, 0, 0, 0, 0, 0, 0};
	};

};

 

Share this post


Link to post
Share on other sites
1 hour ago, Quack O'Neill said:

How are you getting those red dots to show up ? i tried all the language options but they wouldnt show up.

 

I'm not, they are simply there. If you don't see any when you paste your code into a code block, then you're fine.

Share this post


Link to post
Share on other sites

whats the best way to trigger a CfgSfx sound ? cause theres no examples on the wiki

playSound stEveLoop; 
playSound3D stEveLoop;
stEve Say 3D stEveLoop; 

none of the above give any errors but the sounds arnt playing and i know the trigger is activating and if i use the normal syntax / examples to play a single sound it all works fine

do I need a .wss file ? thats something that dont match the example on the wiki but i dont know what a .wss is 

Share this post


Link to post
Share on other sites
1 hour ago, Quack O'Neill said:

whats the best way to trigger a CfgSfx sound ? cause theres no examples on the wiki

playSound stEveLoop; 
playSound3D stEveLoop;
stEve Say 3D stEveLoop; 

 

According to the Wiki entry for CfgSFX, these are played "either directly with setSoundEffect command or indirectly with createSoundSource command".

 

But in your example, stEveLoop is what you defined in CfgSounds, and stEveLoop1 is what you configured with CfgSFX.

 

I believe as for your CfgSounds entries, these are done with say3D, which has a variety of syntaxes but simplest is

speakerName say3D stEveLoop;

EDIT: Sorry I hadn't followed closely enough, so I see that the CfgSounds entries are invalid and this won't work.

  • Like 1

Share this post


Link to post
Share on other sites

But again, that CfgSounds entry is invalid. Use CfgSFX.

Share this post


Link to post
Share on other sites

this dont work but it didnt give any errors
stEve say3D stEveLoop;

i am using CfgSfx but iv tried it in both

i tried this example below 
setSoundEffect ["Alarm", "", "", ""];

but i changed it so it looked like this 
setSoundEffect ["stEveLoop"];

but it wasnt happy because it expected 4 elements not 1 😞 maybe it wants sound0 sound1 or something 

Share this post


Link to post
Share on other sites

what dose this part below do ? it makes no sense to me at all 🙂 i tried adding the name between the quote marks / changing the numbers but nothing happened
empty[] = {"", 0, 0, 0, 0, 0, 0, 0};

Share this post


Link to post
Share on other sites

Please take a look at the wiki pages for CfgSounds and CfgSFX that I linked.  The page for CfgSFX clearly answers your question under the heading "Class Structure".  

 

I'm afraid that you've got sections of one mixed in with sections of another - the syntaxes are different, you can't mix them.

  • Like 1

Share this post


Link to post
Share on other sites
3 hours ago, Quack O'Neill said:

it expected 4 elements not 1 😞 maybe it wants sound0 sound1 or something

 

There's no way anyone could possibly know! Oh, hang on: 

 https://community.bistudio.com/wiki/setSoundEffect

 

Quote

 

Syntax: 

trigger setSoundEffect [sound, voice, soundEnv, soundDet]

 

Parameters: 

trigger: Object

sound: String - Plays a 2D sound as if playSound was used from CfgSounds (mission or main config)

voice: String - Attaches a 3D sound from CfgSounds (mission or main config) to the object that activated the trigger and plays it as if say3D was used

soundEnv: String - Plays an environmental sound from CfgEnvSounds (mission or main config)

soundDet: String - Creates a dynamic sound object attached to a trigger defined in CfgSFX (mission or main config)  <<<--- LOOK HERE

 

Return Value: Nothing

 

triggerName setSoundEffect ["", "", "", "stEveLoop"];  //stEveLoop defined in CfgSFX

 

  • Like 1

Share this post


Link to post
Share on other sites

🙂 sweet thanks guys it is working now 

this in the units init worked.
triggerName setSoundEffect ["", "", "", "stEveLoop"];

thank guys 🙂 

Share this post


Link to post
Share on other sites

hi im trying to get it to play a random sound every time an addAction is used.

class CfgSounds
{
    sounds[] = {};

		class oiyMateyHeyMate
    	{
        	name = "oiyMateyHeyMate";
        	sound0[] = {"\music\voice\heymateycanyou.ogg", db + 0, 1.0};
		sound1[] = {"\music\voice\oiymaytee.ogg", db + 0, 1.0};
		sound2[] = {"\music\voice\canyouhearme.ogg", db + 0, 1.0};
		sounds[] = {sound0, sound1, sound2};
		playSound = (sounds select ([0,(count sounds)-1] call BIS_fnc_randomInt));
		titles[] = {0,""};
    	};
    
};

Iv tried this in my CfgSfx and it gives no errors but no sounds are played. So now its in the CfgSounds where i think its meant to be but its not working. Iv tried removing \ before music but i still get No Entry error

theres lots iv tried to get it to working but im not gonna post all of that cause it would be a mess to look at.

Share this post


Link to post
Share on other sites

You can't run code in the config like that. Define all of your sounds separately then select one at random on execution.

  • Like 1

Share this post


Link to post
Share on other sites
On 3/23/2022 at 5:15 PM, Quack O'Neill said:

yeah its copied and pasted from the wiki. its the owl example

could you link to the source, it is nonsense of course, so it needs to be edited on wiki if true

Share this post


Link to post
Share on other sites
16 minutes ago, killzone_kid said:

could you link to the source, it is nonsense of course, so it needs to be edited on wiki if true

 

I think he just took the example from https://community.bistudio.com/wiki/CfgSFX and mashed it together with CfgSounds. I told him it wouldn't work, but... 😕

  • Like 1

Share this post


Link to post
Share on other sites
21 hours ago, Harzach said:

and mashed it together with CfgSounds

if that’s the case it obviously not gonna work

  • Haha 1

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  

×