Jump to content
Sign in to follow this  
kampfgeist

Fade out Alarm (without..)

Recommended Posts

Hey there,

I simply would like to fade out an alarm after X seconds, so the sound is not that annoying to the player, since he has to "stay" in the alarmed area for a while..

I tried the "time" fadeSound "volume" but this fades the the whole sounds out.. and I'd really like to hear the enemy and me shooting and stuff..

So qustion is there a way to just fade out the alarm sound I triggered?

Share this post


Link to post
Share on other sites

try with CREATESOUNDSOURCE and DELETEVEHICLE:

["EAST", BASE, 300] execVM "SetAlarm.sqf";

// *******************************************************************************
// **          Name: SetAlarm.sqf
// **   Description: create and delete zone alarm
// *******************************************************************************
// **        Author: RAVEN
// **          Site: www.ArmedAssault.com.ar
// ** Forum: http://www.armedassault.com.ar/forums/viewtopic.php?f=9&t=2235
// **
// **           Usage: [side, object_center_of_zone, zone_radius] execVM "SetAlarm.sqf";
// **                 side within quotes: "WEST", "EAST"
// *******************************************************************************

private ["_obj","_radar","_espera","_lista","_SoundOn","_activa"];

_side = _this select 0;
_obj  = _this select 1;
_dist = _this select 2;

_espera = false;
_activa = false;

while {true} do
{
  _radar = createTrigger ["EmptyDetector", position _obj];
  _radar setTriggerActivation [_side, "present", true];
  _radar setTriggerArea [_dist, _dist, 0, true];
  _radar setTriggerStatements ["this", "", ""];
  _radar setTriggerText "Area de deteccion";
  _radar setTriggerTimeout [0, 0, 0, false];
  _radar setTriggerType "SWITCH";

  _espera = true;
  while {_espera} do
  {
     _lista = list _radar;
     sleep 1.00;
     if (count _lista > 0) then
     {
        if (not _activa) then
        {
           _soundOn = createSoundSource ["Alarm", position _obj, [], 0];
           _activa = true;
        }
     }
     else
     {
        if (_activa) then
        {
           deletevehicle _soundOn;
           _activa = false;
           _espera = false;
        };
     };
  };
};

Share this post


Link to post
Share on other sites

If I want something quickly i mostly just make a trigger which plays the alarm sound (via effects>trigger>alarm), this can be set off many ways as you'd expect.

I then name the trigger 'alarm1' or something and create either some AI waypoint or another trigger with the deleteVehicle alarm1 command. Along with deleting the original trigger it also stops the alarm.

Its quick and dirty but it works fine for me and the people who play my scenarios.

EDIT:

This doesnt fade btw, it just shuts the alarm off which for me is the realistic option as opposed to it fading, its also nice because you can accurately position the original trigger where the sound comes from. Sorry if u specifically wanted the fade itself and not just to shut it off.

Edited by turzy

Share this post


Link to post
Share on other sites

Oh big thanks guys!

I would have faded it out really quick anyway.. since like you said turzy, it is the most realistic way to "switch" an alarm off..

I will also check out the script, I might learn something good :)

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  

×