Jump to content
Sign in to follow this  
drunken officer

Sounds

Recommended Posts

Hello guys.

How i have to script my config for global sound? I've a config, but the sound is local. That means, only the player who use the animation, hear the sound. But i need it in this way, that a other player, which is near can hear it.

** sound **
class CfgSounds{
class alarm2{
name = "alarm2";
sound[] = {"\polizei\sounds\alarm2.ogg",0.15,1.0};
titles[] = {};
};};

*** Animation **
class AnimationSources {
class Open_outdoor {
scope = 2;
source = "user";
animPeriod = 7;
initPhase = 1;
};};

**User action **
class UserActions{
class Open_outdoor{
scope = 2;
displayName="$STR_outdoor_open";
onlyforplayer = true;
position="benutze_outdoor";
radius=1.3; 
condition="this animationPhase ""Open_outdoor"" < 0.5";
statement="this animate [""Open_outdoor"", 1];this say'alarm2'";
};
class Close_outdoor : Open_outdoor{
displayName="$STR_outdoor_close";
condition="this animationPhase ""Open_outdoor"" >= 0.5";
statement="this animate [""Open_outdoor"", 0];this say'alarm2'";
};};

thx for help!

Share this post


Link to post
Share on other sites
solved...

How about telling us how you solved it? Maybe there are others having problems with this...

:rolleyes:

Share this post


Link to post
Share on other sites

damn not solved! It was his microphone. I heard his sound in my TS. :mad:

lass CfgSounds{

class alarm2

{

name = "alarm2";

sound[] = {"\polizei\sounds\alarm2.ogg",1,1,150};

titles[] = {};

};

}; //end cfg sound

Normally the 3. number makes the sound global. Thats the same CfgSound like a siren.

But mondkalb, your doorbell is "global", maybe you can help. :)

Share this post


Link to post
Share on other sites
Normally the 3. number makes the sound global. Thats the same CfgSound like a siren.

It doesn't. The third value is the sound volume. And normally it shouldn't be greater than 1. 150 is extremely "loud" so 3D positioning will not work.

A sound-volume of 0.1 on the other hand allows for a small radio to play "locally".

The Global/Local thing you are referring to is in regard of the Multiplayer. The "say" command is not global, which means the sound will only be played on the client's machine that executed the command.

statement = "[this, 'FrontDoor_AP', 'MBG_B3_Doorbell2',4,(_this)] execvm 'MBG_Buildings_3\MPSound.sqf';";

MPSound.sqf

_house = _this select 0;
_memorypoint = _this select 1;
_Sound = _this select 2;
_delay = _this select 3;


_temp = "MBG_SNDHELPER" createvehiclelocal getpos _house;
_temp attachTo [_house,[0,0,0],_memorypoint]; 
_temp say (_Sound);
sleep _delay;
deletevehicle _temp;

This script makes the sound appear where a door actually is. But this script won't solve your problem, though it is still the same principle of using a say command through class Useractions, I am not sure why it works for me and not for you.

Share this post


Link to post
Share on other sites

I believe the third number is the radius the sound is played at. Volume is a separate parameter.

Share this post


Link to post
Share on other sites

Ah, here the bit from the biki:

sound[] = {"fx\wolf1.ogg", 1, 1}; // filename, volume, pitch

So the first numeric value is the volume control

Share this post


Link to post
Share on other sites

That number is used to determine the loundess of a sound compared to other sounds. It is used for the purposes High Dynamic Range sound mixing, to find which sound is dominant and drowns out the others. The sound with the highest value will be played at full volume, and the others at a fraction of their full volume related to how much louder the loudest sound is.

http://community.bistudio.com/wiki/CfgVehicles_Config_Reference#Sounds_Various

Sounds Various

Complex Array:

All the following use

nameOfSound[]= {"\AddonName\AnySound(.wss)",0.000000,1,1};

1st parameter: Sound file (path). *.wss is default, *.ogg can be specified.

2nd parameter: Change of volume compared to the strongest sound that is audible at the camera's (player's) position. It means that the strongest sound is played on 100% and this sound is played weaker (calculated from dB value, distance, occlude, ...). If this sound is alone in sound scene then it is played on 100% every time.

3rd parameter: Speed of playing, 1 = normal speed/time of playing, 2 = 2 times slower, with half lower pitch.

edit: So, I think there should be a fourth parameter. If you wish it to be heard 1 km away, try 1000.

sound[] = {"\polizei\sounds\alarm2.ogg", 1.0,1.0,1000}

I think you should try with the second (loudness rank) parameter at 1. Sirens are pretty loud. Helicopter rotors will be at between 1.7 and 3.5... and a (small) turbine engine is at about 0.5.

Edited by Max Power

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  

×