Jump to content
ironhawx

Sound Loop/TriggerActivation

Recommended Posts

So I've got a trigger that activates via another trigger plays an alarm, then stops after like 5 seconds.  I've tried cond: triggerActivated trig2 && (alive alarm); and act: this nul = [thisTrigger] spawn {while {true} do {(_this select 0) say3D "Alarm_OPFOR"; sleep 10;};};  however it doesn't work.  If I had to guess, is b/c when it spawn itself again, the condition is no longer true b/c trig2 is gone and can't fire it again.  So my question is can I have the trigger before trig2 actually tell trig 3 to start, vs trig3 looking to see if trig 2 was activated?  If I could do that i could eliminate the triggerActivated from the condition, and just have (alive alarm) which means every time the trigger spawned, its condition would be true and would fire.  I've looked all over the place, spent many hours trying to figure this out but no joy.

Edit:  Ultimately what I'm trying to do, is once the boys get detected alrams go off and keep going till they destroy the alarms/loudspeakers which I have named alarm1, alarm2, and alarm 3 respectively.  I've thought of doing an external script, and using execVM "alarmSQF" to call it and just spawn the 3d alarm sounds at marker pos and use a loop in the script.  Basically they get detected via trig2 it calls the sqf, in the sqf something along the lines of

_snd = while (true):

if ((alive alarm1) && (alive alarm2) && (alive alarm3)) then

            play sound "Alarm_OPFOR" at marker1, marker 2, marker 3;

            elseIf((alive alarm1) && (alive alarm2)) then
                  play sound "Alarm_OPFOR" at marker1, marker 2;

            elseIf((alive alarm2) && (alive alarm3)) then

                          play sound "Alarm_OPFOR" at marker2, marker3;

            elseIf((alive alarm1) && (alive alarm 3)) then

                      play sound "Alarm_OPFOR" at marker 1, marker 3;

            elseIf((!alive alarm1) && (!alive alarm 2) && (!alive alarm 3)

                          return false;


Thanks for any help you can give.

Share this post


Link to post
Share on other sites
{
	private _handle = [_x] spawn
	{
		params ["_alarm"];
		private _time = 10;
		while {alive _alarm} do
		{
			[_alarm,"Alarm_OPFOR"] remoteExec ["say3D",-2,false];
			sleep _time;
		};
	};		
} forEach [alarm1,alarm2,alarm3];

Something like this?

  • Like 1

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

×