Air raid - bombing and siren

@ mmmyum HI! yes I got it working - no sirens at the moment. Just checking paths etc to make sure no syntax errors.

Welcome back :)
 
how would i go about merging these 2 bits of code of sounds?

Code:
//sounds
class CfgSounds
{
  sounds[]={nam,eve,puk};
class nam
  {
    name = "Siren1";
    sound[] = {\sound\SirenLoopMono.ogg, db-6, 1.0};
    titles[] = {""};
  };
class eve
  {
    name = "Siren2";
    sound[] = {\sound\Sirens.ogg, db-6, 1.0};
    titles[] = {""};
  };
class puk
  {
    name = "Siren3";
    sound[] = {\sound\Sirens2.ogg, db-6, 1.0};
    titles[] = {""};
  };
};

&

Code:
// sounds
class CfgSounds
{
    sounds[] = {};
 
    class playerSnoring
    {
    name="playerSnoring";
    sound[]={sfx\snoring.ogg,0.9,1};
    titles[] = {};
    };
};

Would it be this that i would need to do?

Code:
// sounds
 
class CfgSounds
{
  sounds[]={nam,eve,puk,playerSnoring};
class nam
  {
    name = "Siren1";
    sound[] = {\sfx\SirenLoopMono.ogg, db-6, 1.0};
    titles[] = {""};
  };
class eve
  {
    name = "Siren2";
    sound[] = {\sfx\Sirens.ogg, db-6, 1.0};
    titles[] = {""};
  };
class puk
  {
    name = "Siren3";
    sound[] = {\sfx\Sirens2.ogg, db-6, 1.0};
    titles[] = {""};
  };
class playerSnoring
    {
    name="playerSnoring";
    sound[]={sfx\snoring.ogg,0.9,1};
    titles[] = {};
    };
};
 
Yup you just have to add the player snoring class as you did. Make sure you've got the brackets right and it should work.
 
Hey stig that's great! And thanks!

Now have you tried the play sound command? We need to figure out if you can access the sounds at all, that command will play it for everyone regardless of distance.
 
Hey mmmyum - I did end up getting this to work (no sound though), but we've decided to turn it off for now...maybe save it for special events. Am still a big fan of the script though, so thanks for it :cool:

Poor hospital in Elektro didn't stand much of a chance lol..

bombing1.png
 
Glad you like it! I'm still working on why these sirens won't play. Nice pic too! Definitely could be sweet for events. I think I will build a random timer in eventually too.

Calling it through the init or mission.sqm?
If you get a chance, throw in a playSound command to see if you can get to the sounds at all.
 
Code:
// sounds
 
class CfgSounds
{
  sounds[]={nam,eve,puk,playerSnoring};
class nam
  {
    name = "Siren1";
    sound[] = {\sfx\SirenLoopMono.ogg, db-6, 1.0};
    titles[] = {""};
  };
class eve
  {
    name = "Siren2";
    sound[] = {\sfx\Sirens.ogg, db-6, 1.0};
    titles[] = {""};
  };
class puk
  {
    name = "Siren3";
    sound[] = {\sfx\Sirens2.ogg, db-6, 1.0};
    titles[] = {""};
  };
class playerSnoring
    {
    name="playerSnoring";
    sound[]={sfx\snoring.ogg,0.9,1};
    titles[] = {};
    };
};

The last sound that is defined in the titles line has this

titles[] = {};

Now in the original code on page 1 it has this

titles[] = {""};
Which is correct?
 
@stig
One last thing before bed - if you're trying to get the sounds to play, does the playSound command work?

playSound "puk";

In cfgsounds that double quotes shouldnt really matter, maybe make it consistent with the ones from my OP. I haven't tried krixes tent sleeping script yet so I'm not 100% about this.
 
Code:
// sounds
 
class CfgSounds
{
  sounds[]={nam,eve,puk,playerSnoring};
class nam
  {
    name = "Siren1";
    sound[] = {\sfx\SirenLoopMono.ogg, db-6, 1.0};
    titles[] = {""};
  };
class eve
  {
    name = "Siren2";
    sound[] = {\sfx\Sirens.ogg, db-6, 1.0};
    titles[] = {""};
  };
class puk
  {
    name = "Siren3";
    sound[] = {\sfx\Sirens2.ogg, db-6, 1.0};
    titles[] = {""};
  };
class playerSnoring
    {
    name="playerSnoring";
    sound[]={sfx\snoring.ogg,0.9,1};
    titles[] = {};
    };
};

The last sound that is defined in the titles line has this

titles[] = {};

Now in the original code on page 1 it has this

titles[] = {""};
Which is correct?

this is a mixture of 2 scripts that im using, the last sound defined is from a different script so i just included it the same way it was in that script. you will also notice the location of the sounds is different from the first post on here ;)
 
Glad you like it! I'm still working on why these sirens won't play. Nice pic too! Definitely could be sweet for events. I think I will build a random timer in eventually too.

Calling it through the init or mission.sqm?
If you get a chance, throw in a playSound command to see if you can get to the sounds at all.

Was calling via init.sqf

Can probably give playSound a try at some point
 
this is a mixture of 2 scripts that im using, the last sound defined is from a different script so i just included it the same way it was in that script. you will also notice the location of the sounds is different from the first post on here ;)
With that bit of code are you getting siren sounds? I notice that the cfg is inconsistent - the path names refer to the same folder both with a leading \ and without (sfx\snoring.ogg and \sfx\Sirens.ogg, etc) - this could be an issue maybe?
I believe titles handles the subtitles that play at the same time as the sound plays, just so you guys know. Shouldn't matter really what's in there, as long as the format's nice.
 
Was calling via init.sqf

Can probably give playSound a try at some point
Great, that would be really helpful! If that does not work, I'm thinking it may be the call through init.sqf - unless someone has sirens working, that is calling via init.sqf. I will test this call method later today if I have time, as I have only ever called in my mission.sqm.
 
With that bit of code are you getting siren sounds? I notice that the cfg is inconsistent - the path names refer to the same folder both with a leading \ and without (sfx\snoring.ogg and \sfx\Sirens.ogg, etc) - this could be an issue maybe?
I believe titles handles the subtitles that play at the same time as the sound plays, just so you guys know. Shouldn't matter really what's in there, as long as the format's nice.
As of yet i have never been in the right place at the right time (random script used) so only know its working from the logs however the other script (healing when sleeping at the tent) the sound works ok for that. I didnt realise i had the leading \ so will update it and see how it goes.

Out of intrest, what does this do? "db-6, 1.0" as the other sound file has "0.9,1"
 
As of yet i have never been in the right place at the right time (random script used) so only know its working from the logs however the other script (healing when sleeping at the tent) the sound works ok for that. I didnt realise i had the leading \ so will update it and see how it goes.

Out of intrest, what does this do? "db-6, 1.0" as the other sound file has "0.9,1"
That's volume adjustment, I believe. DB is decibels, so you're setting at -6. Not 100% on the second numbers meaning.
 
A little script to add an AIR RAID complete with bombing and siren to a STATIC location or RANDOM locations
UPDATED: April 17 4pmEST


Random Locations (tested and confirmed 16/04 chernarus) updated april 16 around 7pm
Code:
////////////////////////////////////////////////////////////////////////////////////////
//      DayZ Air Raid written by                                                    //
//              mmmyum    with    work    from                                      //
// sirens: http://www.armaholic.com/page.php?id=12598 by DarkXess                    //
// bombs: http://www.armaholic.com/page.php?id=15612 by Maxjoiner                    //
////////////////////////////////////////////////////////////////////////////////////////
 
/////////////////////////SETUP repeat and break
sleep 10;
_repeat = 30;                            //times to repeat
_break = 120;                            //time to break between attacks
_position = [13135.9, 10393.3, 1.5]; //leave this
_xpos = 13135.9;
_ypos = 10393.3;
//repeat script
diag_log format ["AIRRAID: Starting..."];
sleep 2;
While {_repeat > 1} do {
/////////////////////////SETUP position
//                                      enter positions below. format x,y,z
_rndLoc=floor(random 6);
_place=
switch (_rndLoc) do
{
case 0: {"Electro"};
      case 1: {"Berezino"};
      case 2: {"NEAF"};
case 3: {"Stary"};
case 4: {"Vybor"};
case 5: {"Gorka"};
};
diag_log format ["AIRRAID: Random Location: %1 | %2",_rndLoc,_place];
    _position=
    switch (_rndLoc) do
    {
      case 0: {[10480.6, 2217.8, 1.5]};
      case 1: {[12043.9, 9091.3, 1.5]};
      case 2: {[12073.9, 12724.3, 1.5]};
case 3: {[6143.6, 7721.5, 1.5]};
case 4: {[3815.1, 8865.0, 1.5]};
case 5: {[9659.0, 8795.3, 1.5]};
    };
//////////////////////////SETUP type of bombing and duration
_choice = 1;
_duration = 60;
/////////////////////////
_xpos = _position select 0;
_ypos = _position select 1;
_targetpos = [_xpos, _ypos, 1.5];
_loc = createVehicle ["HeliHEmpty", _targetpos,[], 0, "NONE"];
_target = createVehicle ["HeliHEmpty",position _loc,[], 0, "NONE"];  // target bombing
sleep 2;
diag_log format ["AIRRAID: INCOMING ATTACK: Sounding Siren at: %1 %2 | Repeat: %3| Type: %4 | Duration: %5",_xpos,_ypos,_repeat,_choice,_duration];
//sounds
_pos = position _target;
diag_log format ["AIRRAID: POS: %1 | TARGET: %2 | SHOULD MATCH",_pos,_targetpos];
_siren = createVehicle ["HeliHEmpty",position _target,[], 0, "NONE"];
_siren say ["eve",1000];                                                        // siren sound
sleep 60;
_siren say ["puk",1000];                                                        // siren sound
sleep 60;
_siren say ["eve",1000];                                                        // siren sound
sleep 60;
_siren say ["nam",1000];                                                        // siren sound
sleep 60;
_siren say ["puk",1000];
sleep 60;                                                                      // wait a while
_siren say ["nam",1000];
sleep 5;                                                                      //thats enough warning
 
//start bombing init
_choise = _choice;    // choise bombing: 1 = light 2 = medium 3 = heavy
_ray = 120;          // ray of bombing
_seconds = _duration; // time bombing
 
diag_log format ["AIRRAID: Bombing Area: %1 %2",_xpos,_ypos];
//start bombing
While {_seconds > 1} do {
_sound = createVehicle ["HeliHEmpty",position _target,[], _ray, "NONE"];
_sound say ["mortar1",1000];
sleep 2;
 
If (_choise == 1) then {
_espl = createVehicle ["SH_105_HE",position _sound,[], 0, "NONE"];
};
If (_choise == 2) then {
_espl = createVehicle ["SH_125_HE",position _sound,[], 0, "NONE"];
};
If (_choise == 3) then {
_espl = createVehicle ["BO_GBU12_LGB",position _sound,[], 0, "NONE"];
};
_seconds = _seconds - 1;
deletevehicle _sound;
};
sleep 60;
_repeat = _repeat - 1;
deletevehicle _siren;
deletevehicle _loc;
deletevehicle _target;
diag_log format ["AIRRAID: Going down for sleep: Repeat:%1 | Sleep:%2",_repeat,_break];
sleep _break;               
};
exit
Saved this as mmmyum_bomb.sqf in fixes folder (dayz_chernarus1.pbo/fixes/mmmyum_bomb.sqf)

I added to this to init.sqf
Code:
_airraid = [] execVM "fixes\mmmyum_bomb.sqf";
Just put it at the bottom of your list here
Code:
if (isServer) then {
_serverMonitor =  [] execVM "\z\addons\dayz_code\system\server_monitor.sqf";
_airraid = [] execVM "fixes\mmmyum_bomb.sqf";
};
And added this to description.ext

Code:
//sounds
class CfgSounds
{
  sounds[]={nam,eve,puk};
class nam
  {
    name = "Siren1";
    sound[] = {\fixes\sfx\SirenLoopMono.ogg, db-6, 1.0};
    titles[] = {""};
  };
class eve
  {
    name = "Siren2";
    sound[] = {\fixes\sfx\Sirens.ogg, db-6, 1.0};
    titles[] = {""};
  };
class puk
  {
    name = "Siren3";
    sound[] = {\fixes\sfx\Sirens2.ogg, db-6, 1.0};
    titles[] = {""};
  };
};
Is this the newest version? I've been reading through and I've found multiple posts and multiple threads.

I want to use the init.sqf version. Is there a working init.sqf version using Sarge AI?
Couldn't tell if the .031 version is for mission.sqf or init.sqf

Thanks for the help,
Matt
 
Ok, I've been working on some things guys. First, updated animated random air raids with AI spawns!
Requires: simple AI (should work with any of them)
changing of kill a hacker methods - having some trouble here
if you've got working animated heli crashes, this has the same requiments -

Animated random air raids also has the full worldspace random selector built into it, should select from a large list of cities
At the moment, I'm having trouble with the killed a hacker section - despite setting the Sarge variable like in animated heli crashes, dayz is killing my AI pilot (not the chopper), which is obviously a problem. I'm missing something, not sure what. Here's from my RPT
Code:
13:17:31 "RANDOM WORLDSPACE: Komarovo | [3654.09,2475.95,1.5]"
13:17:33 Warning: z\addons\dayz_communityassets\models\razor.p3d:0 Error while trying to generate ST for points: 214, 349, 208
13:17:34 "RANDOM WORLDSPACE SELECTED: 19 | City: Komarovo | Coords: 3654.09  2475.95 |||Try 30"
13:17:34 "AIRRAID: SEL: [3654.09,2475.95,1.5] | TARGET: [3654.09,2475.95,1.5] | SHOULD MATCH APPROX"
13:17:36 "AIRRAID: BOMBER: UH-1H | Lift Off at [1623.71,218.188,300] | with Backup WP [7492.67,15263]"
13:17:36 "AIRRAID: BOMBER: UH-1H | TYPE: UH1H_DZ |"
13:17:36 "AIRRAID: BOMBER: UH-1H started flying from [1623.71,218.188,300] to [3582.26,2404.67] NOW!(TIME:4|)"
13:17:36 "AIRRAID: BOMBER: LANDINGZONE: [3582.26,2404.67,0] | BOMBER POS: [1623.71,218.188,131.767] | POS LAND: [3582.26,2404.67]"
13:17:38 "CLEANUP: KILLING A HACKER Haley Smith C 1-1-B:1 REMOTE IN UH1H_DZ"
13:17:38 Client: Object 3:39 (type Type_69) not found.
13:17:38 Client: Object 3:39 (type Type_70) not found.
13:17:54 "Deleting object UH1H_DZ with invalid ID at pos [6989.98,175.771,133.228]"
Lots of the code has been borrowed and changed from animated heli crashes as I've been learning as I go - so I'm still going to have to work on stomping this bug out. Anyone got any ideas?

I'm trying to learn locality properly now, and I will add a private declaration for the variables [EDIT - server cleanup still kills pilot with private declaration]. May also separate out into functions eventually.

PASTEBIN with ANIMATED RANDOM AIRRAID AI BOMBERS!
http://pastebin.com/YMKDSpYJ
 
Updating the OP now. There are multiple versions, but the RANDOM one in the OP is working correctly for me (this update is just adding more diag_logs for people's debugging). Most stable up to date is always in the OP.

Animated Airraid AI Bombing is in super alpha, and is basically unworking. Just posted and update of that. When that works, it will be added to OP.

Random/Static Airraid scripts have no requirements - everything is built in, just add the things from the OP (cfgSound and sound folder) - simply execute it via init.sqf (possible reason sirens aren't playing?) or mission.sqm (how I do it). It does depend on createVehicle command (makes sirens/bombs/sounds) so you will have to deal with your BE.
 
Updating the OP now. There are multiple versions, but the RANDOM one in the OP is working correctly for me (this update is just adding more diag_logs for people's debugging). Most stable up to date is always in the OP.

Animated Airraid AI Bombing is in super alpha, and is basically unworking. Just posted and update of that. When that works, it will be added to OP.

Random/Static Airraid scripts have no requirements - everything is built in - simply execute it via init.sqf or mission.sqm (how I do it). It does depend on createVehicle command (makes sirens/bombs/sounds) so you will have to deal with your BE.

I call it through init.sqf so maybe why sound not being called??
 
Back
Top