Air raid - bombing and siren

near as I can tell from the database structure you must have a spawn point in the world_vehicles table that links to a type number(unique vehicle class of uh1h or mi16_dz ect.) in the vehicles table. this will automatically add the item to the instance vehicles table on spawn for tracking. so in theory if you have a premade spawn point for the chopper put in your database and the code calls the creation and destruction of that spawn point vehicle(from id.world_vehicle) that is what would be required. The database code will be a simple sql append query to the instance_vehicles table and an sql delete query from the same table on destruction. I can write the query's but I am unsure how to call them from a .sqf.

So I suppose the question is what is the code to call sql query's from .sqf . The only place needed to be cleaned on delete would be the object from the instance vehicles table where it can be re added on creation. The rest is the ai control. I believe will be the same with perhaps a slightly different syntax way to refer to the object. If you can use ai to control any spawned vehicle to waypoints then that part will work.
 
Once you get the hive write call working it'll be easier to just add it to the databases when alive and delete when dead than add a damage event handler or anything fancy - it only needs to be in the database that is relayed to your map tool
http://opendayz.net/threads/pulling-data-from-sql-table-in-script.10052/page-4#post-46696
Here is one of the threads on hive write and read - there are a few others as well. They have the code that calls the SQL queries from sqf.

I don't have much time to look at this until I wrap up at least one of my current projects. Good luck.
 
Air raids are working great on my epoch server!!
I'm really interested in testing the radio mod for it but cant get it working.
Can someone help to set it up.
 
hi mmmyum,

I (and my players) really want to get this running, but I can't for the life of me figure out what I'm doing wrong. I know it has to be something stupid but I've gone over the directions twice now.

If you would please, please take a peek at this, I would be super appreciative.

Installed along with this are Sarge AI, and admin dome, auto refuel, self blood bag, and player2's knockout script, all playing very nice together. I just can't figure out how I'm screwing this up. :(

As it is configured now (with a huge thanks to ManateeHunter!) for Celle, I have markers for the first two bombing spots, set the code to just pick between those two, and I set them for repeated bombing on a short refresh. But I go there and never happens. Also I don't see anything in the .RPT file regarding the bombers spawning, or anything else related to the script. Halp!!

Dropboxed server/mission pbo
https://www.dropbox.com/s/ur0qky679tnqg2l/dayz_mission.pbo
https://www.dropbox.com/s/rif5eb24up91ymi/dayz_server.pbo
 
SCRIPT ADDITION
OK, thanks to help from @AxeCain we now have a working warning message system!
Simply run's a cuttext warning on each client who has a radio - warning of next location to be bombed.
You'll need to run a new script on each client (put in mission init under if (!isDedicated) and execVM)

http://pastebin.com/0EaJrjSt

In the top of the file is a comment explaining how to add one line of code to server_airraid.

WARNING: NOT FOR NOOBS - working great, needs more heavy testing on a fully populated server, but is still alpha quality.

@mmmyum & @AxeCain
I got every thing but this working on my DayZ.ST server can we get little more information on how to enabled this part please. Awesome Air Raids btw love it!
 
server_airRaid add this line
AirraidPlayerMsg = _city; publicVariable "AirraidPlayerMsg";
here:
Code:
 //////////////////////////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"];
 
AirraidPlayerMsg = _city; publicVariable "AirraidPlayerMsg";

Then for the init.sqf
Save the code from player_radioMsg to a .sqf in your mission pbo (for example - mission.pbo/scripts/player_radioMsg.sqf)
Add this line to the if (!isDedicated) part

[] execVM "scripts/player_radioMsg.sqf";

Like this:
Code:
if (!isDedicated) then {
//Conduct map operations
0 fadeSound 0;
waitUntil {!isNil "dayz_loadScreenMsg"};
dayz_loadScreenMsg = (localize "STR_AUTHENTICATING");
 
//Run the player monitor
_id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
//lights
[] execVM "lights\street_lights.sqf";
//weather
[] execVM "Scripts\effects.sqf";
//autorefuel
[] execVM "Scripts\kh_actions.sqf";
 
//radioplayeryum
[] execVM "fixes/player_radioMsg.sqf";
 
_playerMonitor =[] execVM "fixes\player_monitor.sqf";
  "heliCrash" addPublicVariableEventHandler {
        _list = nearestObjects [_this select 1, ["CraterLong"], 100];
        {deleteVehicle _x;} foreach _list;
    };
};
 
Basically this line needs to go anywhere after _city is defined
AirraidPlayerMsg = _city; publicVariable "AirraidPlayerMsg";
 
First off thanks for the script i have had it running well on our Panthera server for some time now:)

I am trying to get the radio messages working but nothing is coming up for me,pretty sure i have done as you have explained correctly and i do have a radio in my inventory so not exactly sure why i am not getting the messages. I have static air raids running with coordinates set in my serverairraid.sqf file.

Could you take a look at my files and see if i have made a mistake please, thanks once again?:D

http://pastebin.com/rFuJ3aSC
http://pastebin.com/Vc7MRg7g
http://pastebin.com/Nsx1JUBJ
 
@modeiros_nathan_09 - you have a syntax error. Make sure you only have one cfgSounds.

@Bassline - in your airraid script, you need to change the name of the variable in the line you added, because you have no _city, instead you have _place.
So:
AirraidPlayerMsg = _place; publicVariable "AirraidPlayerMsg";
Just replace _city with _place like I have done here. Should work.
 
mmmyum: great addon! have it on my server running dayz 1.7.6.1 working without problems!

anyway, there is one thing i dont like: the sound of sirens is fine, but the problem is you can hear the siren only in a fairly small angle. if you are heading directly to the sirens source its fine, but if you are heading more than 45 degress to the left left or right you wont hear the siren at all! i think sirens like this should be heard in a certain range (radius around the sound source) no matter the heading of the player. even if the player is heading away from the siren (sound source in the back of the player), the siren should be heard!
can this changed somehow? i have looked around but was not able to find a solution. but if i remember correctly, the bells of the church can be heard in a wide area, so i guess this should be possible! may be by changing the sound source from heli to a building like the church? no idea ....

another one: seeing bombs falling down would be nice too! have not yet tried to implement this, but will look into it. may be you have an idea how this can be done already ...

once again, great addon!
 
@fgw -
Where you added cfgSounds in your mission.pbo - change the 'db' part to a volume of your liking - I think -0.6 is the default, change it to 0.1 or something and see if that's better. Also change the _sounddist.
To be honest, there is probably a better way to do the sound, at the very least creating siren objects in multiple places would probably help, or perhaps a different sound command could be used to adjust the fading, which is what is making it sound faint at certain angles. I just don't have time to look at this script very much at the moment, as I've got other things in the works.
As for droppping bombs, this is totally easily doable. Simply need to insert a creatVehicle command with the bomb model class name you want to use, create it like 200m above the spot it should land at and setVelocity negative in the z axis so it falls. Might not even need to createVehicle for the explosion as I'm not sure but it might explode on impact.
Give it a shot and post your work:), would be awesome to see that in action.
 
@fgw -
Where you added cfgSounds in your mission.pbo - change the 'db' part to a volume of your liking - I think -0.6 is the default, change it to 0.1 or something and see if that's better. Also change the _sounddist.
To be honest, there is probably a better way to do the sound, at the very least creating siren objects in multiple places would probably help, or perhaps a different sound command could be used to adjust the fading, which is what is making it sound faint at certain angles. I just don't have time to look at this script very much at the moment, as I've got other things in the works.

dont ask why, but when i checked this on my server right now, siren sounds are fine now. audible from all directions as it should be. dont know what i had messed up here the days before ...

As for droppping bombs, this is totally easily doable. Simply need to insert a creatVehicle command with the bomb model class name you want to use, create it like 200m above the spot it should land at and setVelocity negative in the z axis so it falls. Might not even need to createVehicle for the explosion as I'm not sure but it might explode on impact.
Give it a shot and post your work:), would be awesome to see that in action.

will give this a try. just need to figure out which model can be used here in standard dayz? dont worry, if i get this going i will post it!

thanks for your quick response!
 
@modeiros_nathan_09 - you have a syntax error. Make sure you only have one cfgSounds.

@Bassline - in your airraid script, you need to change the name of the variable in the line you added, because you have no _city, instead you have _place.
So:
AirraidPlayerMsg = _place; publicVariable "AirraidPlayerMsg";
Just replace _city with _place like I have done here. Should work.


I tried this line: AirraidPlayerMsg = _city; publicVariable "AirraidPlayerMsg"; server_airRaid.sqf the meeting but not as I do it.
The error that appears to me is this: ErrorMessage: File mpmissions \ __cur_mp.chernarus \ description.ext, line 170:. CfgSounds: Member already defined ....
I use the file from the first link "ANIM-AI-HELIBOMBER AirRaid Random!"
 
That error means you have two CfgSounds in your description.ext. You have to merge them. There can only be one....
 
Back
Top