Jump to content
Sign in to follow this  
Delicious

Airstrikes, a ghetto solution

Recommended Posts

I saw a couple of posts about airstrikes so I decided I will share how I got them to work via radio (or any other trigger). The creation of this could be a bit more automatic via good scripting (instead of my Magpie stealing spree from all over the internet), and any suggestions on improving this are more than welcome.

Anyway, let's start with an example of an A10 dropping LGBs on an Afghan wedding.

1. Make sure you create a Game Logic Module "Functions", and that it is synchronized to you, the player!

2. Create some locations, in this case three, from the units menu (Game Logic->Locations-> Location). Name one 'spawnaten', name another 'aten1' and the final one 'aten2'. Place the 'spawnaten' location where you would like to spawn your A10, place the 'aten1' location above the target (in this case, our ill-fated wedding), and finally, place the 'aten2' location above the area where you would like to dismiss your aircraft.

3. In the Initialization field for the 'spawnaten' location type

this setPos [(getPos spawnaten select 0), (getPos spawnaten select 1), (getPos spawnaten select 2)+100]

This is necessary to make sure the plane has some altitude when it has spawned, in this case 100.

4. We now need to spawn the A10 and get it to fly to where we want to, points aten1 and then aten2. Make a 'spawnaten.sqs' script in your mission directory and fill it in with:

_tank = [position spawnaten, 0, "A10", side player] call BIS_fnc_spawnVehicle
_a10 = creategroup WEST;
_tank join grpNull
_tank join _a10
_wp = _a10 addWaypoint [position aten1, 0];
_wp setWaypointType "MOVE"; 
_wp setWaypointSpeed "FULL";
_wp = _a10 addWaypoint [position aten2, 0];
_wp setWaypointType "DISMISS";
_wp setWaypointSpeed "FULL";
[_a10,1] setWaypointStatements ["true", "bombsaway=1"];

This script tells the game to spawn an A10 and tells it to move to location 'aten1' and tells it to dismiss itself (via ejection) at location 'aten2'.

This script has an A10 spawning, flying above our target zone, and then being dismissed out of view. But of course, to win hearts and minds we cannot simply pass the target, we must drop bombs!

5. Create a trigger above the target area. Make it sufficiently big so you know our aircraft will pass through it. Set the activation to anybody present. In this Condition field type:

bombsaway==1

and in the On Act. field type

[] exec "bombs.sqs"; bombdir = 90;

This will execute a bombs.sqs script, and set the bomb direction to 90. Set this value to the direction the plane is flying towards. 0 is North, 90 is East, etc. Just preview the mission once you have your aircraft flying and with a little experimentation you will have a good direction for the bombs. As an example, if your aircraft is flying to the south over the target area, set the bomb direction to 180 [deg] so that the bombs dropping will not look stupid.

6. As you can see we are calling a script named bombs.sqs to do the dirty work. Here is an example of the bombs.sqs:

_direction getDir tank
_bomb1 = "Bo_GBU12_LGB" createVehicle (position boomarea1)
_bomb1 setPos [(getPos boomarea1 select 0), (getPos boomarea1 select 1), (getPos boomarea1 select 2) +100]
_bomb1 setDir bombdir
~1
_bomb2 = "Bo_GBU12_LGB" createVehicle (position boomarea2)
_bomb2 setPos [(getPos boomarea2 select 0) , (getPos boomarea2 select 1), (getPos boomarea2 select 2) +100]
_bomb2 setDir bombdir
~1
_bomb3 = "Bo_GBU12_LGB" createVehicle (position boomarea3)
_bomb3 setPos [(getPos boomarea3 select 0), (getPos boomarea3 select 1), (getPos boomarea3 select 2) +100]
_bomb3 setDir bombdir

This drops three separate bombs on three separate locations, and spawns them in at 100 altitude.

Another example:

_bomb1 = "Bo_GBU12_LGB" createVehicle (position boomarea)
_bomb1 setPos [(getPos boomarea select 0) +(random 100) - (random 100), (getPos boomarea select 1) +(random 100) - (random 100), (getPos boomarea select 2) +100]
_bomb1 setDir bombdir
~1
_bomb2 = "Bo_GBU12_LGB" createVehicle (position boomarea)
_bomb2 setPos [(getPos boomarea select 0) +(random 100) - (random 100), (getPos boomarea select 1) +(random 100) - (random 100), (getPos boomarea select 2) +100]
_bomb2 setDir bombdir
~1
_bomb3 = "Bo_GBU12_LGB" createVehicle (position boomarea)
_bomb3 setPos [(getPos boomarea select 0) +(random 100) - (random 100), (getPos boomarea select 1) +(random 100) - (random 100), (getPos boomarea select 2) +100]
_bomb3 setDir bombdir

In the first example, three bombs are dropped on three locations: 'boomarea1', 'boomarea2', and 'boomarea3'. In the second example, three bombs are dropped on one location: 'boomarea', but each bomb has a random spread. You can easily add more bombs to these scripts.

7. Depending on the script you are using you need to assign some extra locations to your maps, either 'boomarea' or 'boomarea1', 'boomarea2', and 'boomarea3'. Place the locations on or around our target (so around location 'aten1')

8. We're now ready to call in our airstrike. This can be done by creating a radio Alpha trigger for example. Create a trigger, set the activation to Radio Alpha, make sure Condition is set to "this", and set On Act. to:

[] exec "spawnaten.sqs"

9. Call in the airstrike via Radio Alpha channel on the map. "POPOV21, we're going to jail!"

This is far from perfect, but hey, at least it works. It's quite easily changable to different aircraft etc. I'm sure there are far better ways to do this, so please give any suggestions.

Bonus cmissile.sqs:

_bomb1 = "Chukar" createVehicle (position missilearea)
_bomb1 setPos [(getPos missilearea select 0), (getPos missilearea select 1), (getPos missilearea select 2) +250]

Set a location named "missilearea" on a house and place

[] exec cmissile.sqs

in a trigger On Act. field to drop cruise missiles from an alitude of 250 on it. Kaboom! But after the explosion, the Chukar missile is still there as a wreck. If anyone knows how to remove it, please tell me!

Edit: Before I forget, it is important to place civilians in the target area for maximum winning of hearts and minds!

Edited by Delicious
Forgot something

Share this post


Link to post
Share on other sites
But after the explosion, the Chukar missile is still there as a wreck. If anyone knows how to remove it, please tell me!

DeleteVehicle object?

Share this post


Link to post
Share on other sites

This is alot more complicated than the MLRS artillery strike which has about the same effect in game.

Share this post


Link to post
Share on other sites
This is alot more complicated than the MLRS artillery strike which has about the same effect in game.

I agree, but this has a pretty airplane flying past :)

Share this post


Link to post
Share on other sites

Can you make it an example mission ?

*edit*

Can you make it look like this

? Edited by Armin2

Share this post


Link to post
Share on other sites

OK sorry if this is the noobiest question ever but I really need something clarified... Heres my question:

I don't really understand the support in this game. How do you actually call support during random missions? eg. if i'm in the middle of a Superpowers game and I've built an airport etc and bought some planes, how do I actually call support to a particular location? Is this only possible in single player?? or user created missions? or what...?

I just want to be roaming around the map and come under heavy fire, and call for some support... What game mode do I need to play for this to be possible?

From reading forums etc it seems like you can only do it by programming in all this freakin code into the editor, which seems really lame to me...

Plz tell me what i'm missing!

Thanks

Edited by mogur00
typo

Share this post


Link to post
Share on other sites

Can you please make a template mission of this script with the bombs and cruisemissiles if it's not to much work atleast. And can you tell me how to start the airstrike when my "officer1"is killed so you won't be able to call it from radio it just executes when that officer1 is eliminated.

Allready thanks for you'r great work.

Share this post


Link to post
Share on other sites

Im in the learning phase of scripting so i was wondering if you help me by explaining the following.

_tank = [position spawnaten, 0, "A10", side player] call BIS_fnc_spawnVehicle

_tank is that the name of the newly created unit??

_a10 = creategroup WEST;

_tank join grpNull

_tank join _a10

What does these three lines do?

Also if i wanted to add some kind of dialog on activation between the one calling the airsupport and the plane can i put it in this script.

Something like.

FAC : This is x requesting airsupport.

Viper (plane): This is Viper One ready for work.

or something similar.

Edited by dkraver

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  

×