Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
Howard

Localizing playSound for pilot/gunner.

Recommended Posts

Hi, everyone.

I'm making a mission solely based on John Spartan & Saul's F/A-18 mod.

(http://forums.bistudio.com/showthread.php?164308-F-A-18-Super-Hornet-for-ARMA-3)

I've added an element of danger to the mission by making a script which will drain the aircraft's health to 0 after it falls below ~75%.

Along with this I also have added "bitching betty" audial warnings when the aircraft aircraft starts being drained and after it falls below 16% health.

Now, this is a multiplayer mission and I've been having some trouble with the warning sounds...

Initially I tried using "playSound" for playing the warnings, but I noticed that I could hear these while outside of the vehicle and at any range.

I've tried using "say" & "say3D" as well, but I can hardly hear these sounds inside the vehicle (but they can be heard very well in 3rd person). I think this might be an issue with the F/A-18 mod.

So I've been wanting to revert back to playSound but I can't figure out how I would go about making only the pilot & gunner of the aircraft that is being damaged hear what's being played by playSound

Here's a snippet of the script:

if (_minor && {damage _unit >= 0.16}) then {
	 _unit say3d "warning";
           _unit vehiclechat "WARNING";
           sleep 1;
           _unit say3d "systemsfailure";
           _unit vehiclechat "SYSTEMS FAILURE";
		_minor = false;

_unit is defined as "this" in a parameter in the initialization line of each aircraft.

Any help would be much appreciated.

Share this post


Link to post
Share on other sites

playSound already has local effect (according to the Biki). So it's just a case of checking whether the player is in the aircraft before playing the sound.

I don't have time to look into that right now, but if nobody else answers before I get back I'll take a quick look.

---------- Post added at 17:33 ---------- Previous post was at 17:14 ----------

I'd do something like this, this would need to run on each client:

{if (_x == player) then {playSound["warning",true];playSound["systemsfailure",true];};} forEach (crew _unit);

Note that I'm by no means a seasoned script writer, so there could be a more optimized way of achieving this.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×