Jump to content
Sign in to follow this  
Hodgeasaurus

(Multiplayer) Sound emit from player

Recommended Posts

Hi guys,

Now this this something that I have been searching for high and low for days now, and still I am searching. I figured it was time I asked the community upfront.

I am new to the editor and scripting so my knowledge is limited, I will admit.

I am currently trying to get a sound to emit from a player in a multiplayer mission, that everyone regardless of side/faction is able to hear in 3d. Now I am able to get the sound to play client side, but that is as far as I've got. The method of triggering the sound I would like is an addAction. In brief, the two things I would like to achieve are:

1. Get a sound to play from the players location via an addAction

2. Have the sound be audible from the area the specific player made the sound.

Think of this as a request for Arma II: Marco Polo edition.

Any more questions, feel free to ask!

EDIT:

Ok, after more and more digging, I found this thread addAction & Sound Public Variable.

Anyway of getting this same idea, to work from a player, rather than a car?

Edited by Hodgeasaurus

Share this post


Link to post
Share on other sites

Ok, So I still can't see what I am doing wrong. I'm trying to do what was in that thread I linked to, still no success. I'll post my set-up and see if you can work out what is wrong.

_Car init:

_actOn = this addAction ["Siren ON", "common\sirentrig.sqf", [], 0, false, true, "", "driver _target == _this AND !CAR_siren"];  _actOf = this addAction ["Siren OFF", "common\sirentrig.sqf", [], 0, false, true, "", "driver _target == _this AND CAR_siren"];

sirentrig.sqf

_car1 = _this select 0;
if (CAR_siren) then {
CAR_siren = false;
publicVariable "CAR_siren";
0 fadesound 1;
_sound = [_car1,nil,rSAY,"EndFade"] call RE;
} else {
CAR_siren = true;
publicVariable "CAR_siren";
While {CAR_siren} do {
	0 fadesound 1;
	_sound = [nil,_car1,rSAY,["sirencustom",50]] call RE;
	_car1 say "sirencustom";
	sleep 5.536;
};
};

description.ext

class CfgSounds
{
sounds[] = {};
class sirencustom
{
	// how the sound is referred to in the editor (e.g. trigger effects)
	name = "sirencustom";
	// filename, volume, pitch
	sound[] = {\sounds\siren.ogg, 1, 0.8};
	titles[] = {};
};
};
};

init.sqf

// begin init.sqf
// JIP fix - why does ArmA execute init.sqf for JIP players, if 'player' is not sync'd yet
CAR_siren = false;

That's all the files and text in them, as well as the cars init field.

I can hear it, other cannot...

Also, I realise this is away from the original idea, but I figured if I can get a supposedly working example going, I can try and work it over to what I need.

Edited by Hodgeasaurus

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  

×