Help and Discussion for Air Raid and Bombing siren begins here...
ORIGINAL POST:
You guys are great, it's time I give back some. Got this working yesterday.
A little script to add an AIR RAID complete with bombing and siren to a STATIC location or RANDOM locations
Siren is an authentic recording from Israel!
Yes the bombs will kill you! They blow up cars too!
EDIT!!!! BELOW CODE IS OLD! SEE POST 3 FOR CURRENT CODE
Let me know if you try it! Or know a better way to do anything!
Thanks to arma scripters DarkXess and Maxjoiner, dayz scripters Sarge(big thanks!), grafzhal (for learning from your code), multiple ai scripts and scripts that play sounds were also looked at/torn apart in order for me to learn more. Thanks to everyone! Wouldn't have been possible without you! did i mention Sarge(big thanks!)?
ORIGINAL POST:
You guys are great, it's time I give back some. Got this working yesterday.
A little script to add an AIR RAID complete with bombing and siren to a STATIC location or RANDOM locations
Siren is an authentic recording from Israel!
Yes the bombs will kill you! They blow up cars too!
EDIT!!!! BELOW CODE IS OLD! SEE POST 3 FOR CURRENT CODE
______________________________________________
1
Select your code; either:
Random Locations (tested 26/04/2013 @2pmEST working) NEWEST!
Static 1 Location (UN-tested and confirmed MAY BE BUGGY)
(If you feel like trying your hand I could use some help with http://pastebin.com/YMKDSpYJ
essentially, the animated ai airraid code works so far but my AI gets killed by server cleanup)
Save this as mmmyum_bomb.sqf in the root of your pbo (dayz_chernarus1.pbo/mmmyum_bomb.sqf)
______________________________________________
2
Call via init.sqf with this line:
Just put it at the bottom of your list here
CALL init.sqf (above) OR ADD mission.sqm (below)
Add to vehicles class after markers
Via mission.sqm same as Excelsior bridge or my automatic Aircraft Carrier
in there
______________________________________________
3
Add at bottom of description.ext
______________________________________________
4
Put sound folder in pbo folder
download sound folder here
http://speedy.sh/44dYf/sound.7z
_______________________________________
Bugs? see post 131 - working out bugs related to sirens not playing, locality, and new animated ai air raid script.
AnimatedAIBomber script 0.42a see post http://opendayz.net/threads/air-raid-bombing-and-siren.9464/page-8#post-39038
//////////////////////////////////////////////////////////////
Random version working well, change to two of the same location if you want static.
1
Select your code; either:
Random Locations (tested 26/04/2013 @2pmEST working) NEWEST!
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
private ["_espl","_sound","_pos2","_pos2cnt","_seconds","_rndLoc","_place","_position","_choice","_duration","_xpos","_ypos","_targetpos","_loc","_target","_pos","_siren","_pos1","_choise","_ray","_dblsecs","_repeat","_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];
//sound siren
_pos = position _target;
diag_log format ["AIRRAID: POS: %1 | TARGET: %2 | SHOULD MATCH",_pos,_targetpos];
_siren = createVehicle ["HeliHEmpty",position _target,[], 0, "NONE"];
[nil,_siren,rSAY,['eve', 3500]] call RE;
sleep 60;
_pos1 = position _siren;
diag_log format ["AIRRAID: SIREN: %1 | TARGET: %2 | SHOULD MATCH APPROX",_pos1,_targetpos];
[nil,_siren,rSAY,['puk', 3500]] call RE;
sleep 60;
[nil,_siren,rSAY,['eve', 3500]] call RE;
sleep 60;
[nil,_siren,rSAY,['nam', 3500]] call RE;
sleep 10;
[nil,_siren,rSAY,['puk', 3500]] call RE;
sleep 60;
[nil,_siren,rSAY,['nam', 3500]] call RE;
sleep 5;
//start bombing init
_choise = _choice; // choise bombing: 1 = light 2 = medium 3 = heavy
_ray = 120; // ray of bombing
_seconds = _duration; // time bombing
_dblsecs = _seconds * 2;
diag_log format ["AIRRAID: Bombing Area: %1 %2",_xpos,_ypos];
//start bombing
_pos2 = [getPosATL _siren];
While {_seconds > 1} do {
_sound = createVehicle ["HeliHEmpty",position _target,[], _ray, "NONE"];
[nil,_sound,rSAY,['mortar1', 3500]] call RE;
_pos2 set [_seconds, getPosATL _sound];
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"];
};
_pos2 = [_dblsecs,getPosATL _espl];
_pos2cnt = count _pos2;
diag_log format ["AIRRAID: BOMB: %1 | TARGET: %2 | SHOULD MATCH APPROX ||| debug arraycount %3 |",str(_pos2),_targetpos,_pos2cnt];
_seconds = _seconds - 1;
deletevehicle _sound;
};
//cleanup
sleep 60;
_repeat = _repeat - 1;
deletevehicle _espl;
deletevehicle _siren;
deletevehicle _loc;
deletevehicle _target;
diag_log format ["AIRRAID: Going down for sleep: Repeat:%1 | Sleep:%2",_repeat,_break];
sleep _break;
};
exit
Static 1 Location (UN-tested and confirmed MAY BE BUGGY)
Code:
removed - just use random code with all same location for each case,
this had not been tested in some time so I removed it.
(If you feel like trying your hand I could use some help with http://pastebin.com/YMKDSpYJ
essentially, the animated ai airraid code works so far but my AI gets killed by server cleanup)
Save this as mmmyum_bomb.sqf in the root of your pbo (dayz_chernarus1.pbo/mmmyum_bomb.sqf)
______________________________________________
2
Call via init.sqf with this line:
Code:
_airraid = [] execVM "mmmyum_bomb.sqf";
Code:
if (isServer) then {
//you will have entries here
//put my code at the bottom of the list
}
CALL init.sqf (above) OR ADD mission.sqm (below)
Code:
class Vehicles
{
class Item0
{
position[]={13977.627, 0.12955765, 10752.155};
azimut=240;
special="NONE";
id=1;
side="EMPTY";
vehicle="USVehicleBox_EP1";
text="target";
init="null = [target,1,120,60] execVM ""mmmyum_bomb.sqf"";";
};
items=1;
};
Add to vehicles class after markers
Via mission.sqm same as Excelsior bridge or my automatic Aircraft Carrier
Code:
... class Item6
{
position[]={13510.764,0.44504455,5249.3027};
name="spawn4";
type="Empty";
};
};
//CODE GOES HERE!!!!!! ////CODE GOES HERE!!!!!! ///////////////////
//CODE GOES HERE!!!!!! ///////CODE GOES HERE!!!!!! //////////////////////
//CODE GOES HERE!!!!!! //////////CODE GOES HERE!!!!!! /////////////////////////
};
class Intro
{
addOns[]=
{
"chernarus"
};...
in there
______________________________________________
3
Add at bottom of description.ext
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[] = {""};
};
};
4
Put sound folder in pbo folder
download sound folder here
http://speedy.sh/44dYf/sound.7z
_______________________________________
Bugs? see post 131 - working out bugs related to sirens not playing, locality, and new animated ai air raid script.
AnimatedAIBomber script 0.42a see post http://opendayz.net/threads/air-raid-bombing-and-siren.9464/page-8#post-39038
//////////////////////////////////////////////////////////////
Random version working well, change to two of the same location if you want static.
Thanks to arma scripters DarkXess and Maxjoiner, dayz scripters Sarge(big thanks!), grafzhal (for learning from your code), multiple ai scripts and scripts that play sounds were also looked at/torn apart in order for me to learn more. Thanks to everyone! Wouldn't have been possible without you! did i mention Sarge(big thanks!)?