Jump to content
Sign in to follow this  
xJordannx

Say3d heard all over the map

Recommended Posts

Hi, I'm having an issue with getting say3d to work the way I want, basically I want it so if I press a button on the keyboard it will say a sound in the area of the person pressing the button, however it is saying the sound over the entire map.

Here is my init.sqf for say3d:

if (isNil "PVEH_netSay3D") then {
   PVEH_NetSay3D = [objNull,0];
};

"PVEH_netSay3D" addPublicVariableEventHandler {
     private["_array"];
     _array = _this select 1;
    (_array select 0) say3D (_array select 1);
};

fn_netSay3D.sqf:

private ["_obj","_snd"];

_obj = _this select 0;    //object
_snd = _this select 1;    //sound

// broadcast PV
PVEH_netSay3D = [_obj,_snd];
publicVariable "PVEH_netSay3D";

// run on current machine also if not dedi server
if (not isDedicated) then {_obj say3D _snd};

true

and the keybind part:

	case 79:
   {
    nul = [player,"sound1"] call fn_netSay3D;
   };

Any help would be appreciated,

Thanks.

Share this post


Link to post
Share on other sites

Have you tried changing the volume value in your description.ext for your sounds?

Share this post


Link to post
Share on other sites
Have you tried changing the volume value in your description.ext for your sounds?

I have my sounds in a file called sounds.hpp.

here is the file:

class sound1
{
name     = "sound1";    
sound[]  = {"\music\sound1.ogg", 1, 1};
titles[] = {};
};

What would you recommend me changing the volume to?

Share this post


Link to post
Share on other sites

Play around with it. Someone told me that you're actually changing the sound curve loss of volume, not the direct volume (A higher value will be audiable a longer distance).

I've had this value before for these types of things, but it really depends on the original volume of the sound.

class sound1
{
name     = "sound1";    
sound[]  = {"\music\sound1.ogg", db-25, 1};
titles[] = {};
};

Share this post


Link to post
Share on other sites
Play around with it. Someone told me that you're actually changing the sound curve loss of volume, not the direct volume (A higher value will be audiable a longer distance).

I've had this value before for these types of things, but it really depends on the original volume of the sound.

class sound1
{
name     = "sound1";    
sound[]  = {"\music\sound1.ogg", db-25, 1};
titles[] = {};
};

Perfect, thanks very much.

Share this post


Link to post
Share on other sites
Play around with it. Someone told me that you're actually changing the sound curve loss of volume, not the direct volume (A higher value will be audiable a longer distance).

I've had this value before for these types of things, but it really depends on the original volume of the sound.

class sound1
{
name     = "sound1";    
sound[]  = {"\music\sound1.ogg", db-25, 1};
titles[] = {};
};

Found a problem with this, once a player gets into the radius with another player that has previously said a sound out of the radius, the player will hear everything he has previously said.

Share this post


Link to post
Share on other sites

Yes that is an engine bug and has been resolved in one of the beta patches.

[95783] Fixed: Some sounds (esp. say) queued if played out of hearing range.

I guess you could try an ugly approach until it has been fixed, maybe

"PVEH_netSay3D" addPublicVariableEventHandler {
     private["_array"];
     _array = _this select 1;
     if ((player distance (_array select 0)) < 50) then {
          (_array select 0) say3D (_array select 1);
     };
};

Edited by cuel

Share this post


Link to post
Share on other sites

class sound1
{
name     = "sound1";    
sound[]  = {"\music\sound1.ogg", 1, 1, 500};
titles[] = {};
};

Fixed.

Share this post


Link to post
Share on other sites

The "500" is used as the radius of the sound.

Share this post


Link to post
Share on other sites

Doesn't seem to be in the wiki

You're not talking about the maxTitlesDistance that's available for the say command?

Edit: Which I've never seen working as intended.

Share this post


Link to post
Share on other sites

Hello!

I am working on a suicide bomber script for a special event on our wasteland server.

Basicly what it should do is on keypress, play a soundfile in Directchannel (or at location of player) that can be heard let´s say up to 100 meters of the player that issues it, then a animation and a bomb is spawned at the player.

But I can only get the say3D command to work while broadcasting on the whole server.

onkeypress.sqf

//> key

case 86:

{

if(((getPlayerUID player) in serverAdministrators)) then

{

[nil,nil,rEXECVM,"client\systems\playerMenu\akbar.sqf",[player,allunits]] call RE;

execVM "client\systems\playerMenu\suicidebomb.sqf";

};

akbar.sqf

player say3D "akbar1";

//player playmove "AmovPercMstpSlowWrflDnon_Salute";

description.ext

class CfgSounds

{

sounds[] = {alahuakbar};

class akbar1

{

name = "akbar1"; // Name for mission editor

sound[] = {"sounds\alahuakbar.ogg", db-25, 1.0};

titles[] = {0, "TESTING"};

};

};

suicidebomb.sqf

_bombpos = [ getPosasl player select 0, getPosasl player select 1, (getPosasl player select 2) +0.2];

sleep 5;

_tmp = "Bo_Mk82" createVehicle _bombpos; _tmp setPosasl _bombpos;

I tried the player Say command and several other things but can´t seem to get it to work. I also tried changing the volume in the description.ext, and in the code above the sound still broadcasts from north map edge to south map edge, that is for the whole server.

Could anyone hint me towards a solution for this?

Any help would be much appreciated!

Also: xJordanX, would you mind showing me you description.ext? Havent tried a solution like you are using, only playerSay which I cant seem to get to work.

Edited by haz3

Share this post


Link to post
Share on other sites

I can't help you, but you are not alone with sound volume issues. Often when I add sounds to an object or player it is to loud and the radius of that it is being heard is to big. I personally gave up with messing with settings (seems broken/borked) and just edit the sound itself in audacity till it sounds soft enough and a hearable in a smaller radius.

Share this post


Link to post
Share on other sites

It's been said before, but you can include a third parameter in your CfgSounds to limit the radius in which the sound will be heard. But, first, check that your sound is actually mono, not stereo.

Share this post


Link to post
Share on other sites

You can check your sounds with audacity - the option to convert from stereo to mono is under 'Tracks' -> Stereo track to mono

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  

×