Forum Jump :

Author Message


Posts: 17
Rank:


Level: Member

Country: us
Location:
Occupation:
Age: 42
In-game name:

 
#1 Posted at 2015-09-13 18:50        
     
So Looking around cannot seem to find any information on this.

I'm trying to figure out either a script that is set off on activation, or a way inside the trigger in the on activation to make a trigger play a sound _only_ to people in a vehicle not to everyone in the game. Looking for multiplayer situations (obviously).

The idea is for situations where chopper pilots need to fly a specific flight plan to avoid RADAR. If they veer into radar (trigger area) a sound will play and a message will display just for that chopper that set off the trigger telling them they are being pinged by RADAR.(maybe then also setting off air defenses via trigger.)

Ideally it would play and show the hint for the players in the helicopter but would be ok it if was just for the pilot.


Anyone have any ideas on how to accomplish this?

edit: clarified language,

This post was edited by Quorum (2015-09-14 16:06, ago)


Author Message


Posts: 1589
Rank:


Level: Member

Country: pf
Location: Tahiti
Occupation: too many Arma
Age: 59
In-game name: Kobayashi Maru

 
#2 Posted at 2015-09-14 18:22        
     
playmusic is a local effect function. Just apply this method: https://community.bistudio.com/wiki/playMusic
Then apply to units you want.
{if (_x in my_helo) then {playmusic ....} } forEach crew my_helo;
or if (_x == driver my_helo ) then ...

PLEASE CONTACT ME ON BI FORUMS FOR ANY SCRIPT / MOD QUESTION. TKS

Advertisement


Author Message


Posts: 10
Rank:


Level: Member

Country: nl
Location:
Occupation:
Age:
In-game name: MrSanchez

 
#3 Posted at 2015-09-14 19:18        
     
Hi...I don't usually post here.

Happened to click on this thread. Pierre, your code won't work because playMusic has local effect, like you said. Using foreach doesn't make it any less local.

Because its a trigger..just use 'player in helo' in trigger condition...helo being the variable name for the chopper..thats easy...and then just use playMusic..should only play for the people in the helo.

This post was edited by PhonicStudios (2015-09-14 19:25, ago)


Author Message


Posts: 1589
Rank:


Level: Member

Country: pf
Location: Tahiti
Occupation: too many Arma
Age: 59
In-game name: Kobayashi Maru

 
#4 Posted at 2015-09-14 21:58        
     
PhonicStudios your remark is interesting, indeed. I thought a foreach condition in a script (on server) did the job.
I probably missed the argument locality which is not specified for this function. If you had to script that without trigger (in editor) so, how did you do?

PLEASE CONTACT ME ON BI FORUMS FOR ANY SCRIPT / MOD QUESTION. TKS

Author Message


Posts: 17
Rank:


Level: Member

Country: us
Location:
Occupation:
Age: 42
In-game name:

 
#5 Posted at 2015-09-15 00:05        
     
SO I think I figured out a way to do it, almost.

I have

Condition of the tirgger:
player in thisList

Then in the On Activation:

if (player == Pilot1) then { ["RADAR",["","WARNING!"]] call BIS_fnc_showNotification;;};
if (player == Pilot2) then { ["RADAR",["","WARNING!"]] call BIS_fnc_showNotification;;};
if (player == Pilot3) then { ["RADAR",["","WARNING!"]] call BIS_fnc_showNotification;;};


if (player == Pilot1) then {  Pilot1 say3D "RADAR";};
if (player == Pilot2) then {  Pilot2 say3D "RADAR";};
if (player == Pilot3) then {  Pilot2 say3D "RADAR";};

I configured the BIS_fnc_showNotification in cfgNotifications.hpp (using f3 framework) like

// Notification for the F3 RADAR PING Component
class RADAR {
	title= "WARNING! WARNING! WARNING!";
	description= "RADAR ping detected";
	iconPicture = "\A3\ui_f\data\map\markers\military\warning_ca.paa";
	duration = 8;
	color[] = {1,0,0,1};
	priority = 7;
};



I configured the class CfgSounds like this in the description.ext, where RADAR.ogg is just a beeping audio file I created.

class CfgSounds
{
	sounds[] = {};
	class RADAR
	{
		// how the sound is referred to in the editor (e.g. trigger effects)
		name = "my_wolf_sound";
		// filename, volume, pitch
		sound[] = {"RADAR.ogg", 1, 1};
		// subtitle delay in seconds, subtitle text 
		titles[] = {1, "RADAR Ping Detected"};
	};
};

This almost works. It will not fire when I fly over the trigger while in the helicopter. . . but if I land and get out it will fire off, give me a warning in the center of the screen and play the RADAR.ogg file from my unit.

Any ideas how to get this to work while flying in the helicopter or am I barking up the wrong tree?

Q


Author Message


Posts: 1589
Rank:


Level: Member

Country: pf
Location: Tahiti
Occupation: too many Arma
Age: 59
In-game name: Kobayashi Maru

 
#6 Posted at 2015-09-15 02:33        
     
Just probably because player is an helo unit for the trigger while you fly. Then, variable player is not pilot1... but the helo. It sounds weird but player in not in thislist. He's in vehicle!
To confirm, try this simple test in trigger act (for blufor present i presume):
0 = [thislist] spawn {while {true} do {sleep 0.5; hintSilent format ["%1, %2, %3", _this select 0, player == pilot1,player in (_this select 0)]}}

Just change for: (vehicle player) in thislist . It works for foot player or player in any vehicle.

PLEASE CONTACT ME ON BI FORUMS FOR ANY SCRIPT / MOD QUESTION. TKS

Author Message


Posts: 17
Rank:


Level: Member

Country: us
Location:
Occupation:
Age: 42
In-game name:

 
#7 Posted at 2015-09-15 03:08        
     
# Pierre MGI :
Just change for: (vehicle player) in thislist . It works for foot player or player in any vehicle.

Fantastic! Worked perfectly. I simply changed the trigger condition to

(vehicle player) in thislist

and now it sets off the alarm and notification pefectly for the pilots.

Thank you for your help!

Q