Jump to content
Sign in to follow this  
zonekiller

My onmapclick AirStrike Script "looks good"

Recommended Posts

This Script Makes a plane that will fly to where you click on the map and it will drop bombs then return to the place it started and it gets removed from the mission, you can call new planes every 15 seconds.

works with SP & MP

Sample mission "this is still a little messy but fun"

if you are on a gun press F to use the AA Bullets

"pbo"

http://www.zonekiller.ath.cx/missions/arma/airstrike_test.sara.pbo

"rar script folder"

http://www.zonekiller.ath.cx/missions/arma/airstrike_test.sara.rar

FIXED UPDATED SCRIPTS WITHOUT TARGET ASSIST BELOW

These have a different code than listed below : Read the help.txt

Test Mission Rar

Test Mission Pbo

and the Onsinglemapclick Support Pack and my Randomenemy

and Grouplink2 scripts in one Mission

http://www.zonekiller.ath.cx/randomenemy.Sara.pbo

What you need:

in the init.sqs put ----- assist = 0  

5 x triggers

1st   Set it to blufor present make it repeat

in the name call it Airport

the activation put ----- working = 1

in the Deactivation put ----- working = 0; hint "Air-Strike on its way \nETA 30 Seconds."

2Nd Set it to Radio Alpha make it repeat

in the text put ------ null

the activation put ----- 1 setRadioMsg "Click on map"; [this] exec "AirStrike.sqs";

3rd Set it to Radio Delta make it repeat

in the text put ----- Target Assist On

the activation put ----- assist = 1; hint "Target Assist is On"

4th Set it to Radio Echo make it repeat

in the text put ----- Target Assist Off

the activation put ----- assist = 0; hint "Target Assist is Off"

5th Set it to Radio JULIET make it repeat

in the text put null

the activation put ----- menu = 0

thats it just goto your map and click on "select a target" click on  target assist on or

off depending what you want then click on the map , as soon as the radio says "select a

target" again you can call in another airstrike

The Target assist will check for any men or vehicles within 200 mtrs of where you clicked

and update the target and marker when the airstrike is 1300 mtrs away.

If your trying to destroy buildings turn off Target assist

The Script

Call It Airstrike.sqs

----------------------------------------------------------

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

;Script By Michael ---  www.zonekiller.ath.cx --- zonekiller@iinet.net.au

~0.5

;?!(local Server): exit

?(assist == 0) : hint "Target Assist is Off"

?(assist == 1) : hint "Target Assist is On"

;allows cancel

working = 0

menu = 1

;makes target

Dropzone = "Logic" createvehicle getpos airport

@(alive Dropzone) or (menu == 0)

onMapSingleClick "dropzone setPos _pos"

~0.5

_markername = name player

~0.5

_markername = _markername + "'s DropZone"

_Dropzone = Dropzone

~0.5

_Dropzone setpos _pos

@_Dropzone distance airport > 50

;create marker

~0.2

_marker = createMarkerLocal [_markername, position _Dropzone];

_marker setMarkerShapeLocal "ICON";

_marker setMarkerTypeLocal "Destroy";

_marker setMarkerSizeLocal [.8,.8];

_marker setMarkerTextLocal _marker;

1 setRadioMsg "Please wait"

~1

@(working == 0) or (menu == 0)

~5

;1 setRadioMsg "Select Target"

2 setRadioMsg "NULL";  

3 setRadioMsg "NULL";

4 setRadioMsg "Target Assist On";

5 setRadioMsg "Target Assist Off";

6 setRadioMsg "NULL";

7 setRadioMsg "NULL";

8 setRadioMsg "NULL";  

9 setRadioMsg "NULL"

10 setRadioMsg "Cancel Orders";

?(menu == 0) : _marker setMarkerType "empty"; goto "cancelled"

~0.5

?(menu == 0) : goto "cancelled"

_planepos = getpos airport

_squadvcl = []

_squadsld = []

_unitClass = "AV8B2"

_unitCount = 1

_unitType = "vcl"

?(menu == 0) : goto "cancelled"

_group = createGroup west

_group createUnit ["SoldierWPilot", _planepos, [], 0, "FORM"]  

_newsld = (Units _group) select 0

_squadsld = _squadsld + [_newsld]

[_newsld] join grpNull

~0.1

_itemcount = _itemcount + 1

_vcl = _unitClass createVehicle _planepos

_sldClass = _vclCrew select 0

_newsld moveindriver _vcl

_leader = _newsld

~1

_vehicle = vehicle _leader

;x = [_vehicle] execVM "markersplanes.sqf"

deleteMarkerLocal _Marker

;change marker name

_pilotname = " Pilot is "

_pilotname = _pilotname + name _leader

_markername = _markername + _pilotname

_marker = createMarkerLocal [_markername, position _Dropzone];

_marker setMarkerShapeLocal "ICON";

_marker setMarkerTypeLocal "Destroy";

_marker setMarkerSizeLocal [.8,.8];

_marker setMarkerTextLocal _marker;

;sets pilot skill

_leader setskill 0.10

;Target Assist on or off

?(assist == 0) : _ta = 0

?(assist == 1) : _ta = 1

1 setRadioMsg "Select Target"

~0.5

;starts the plane in the air - no runway needed -

_vehicle setPos [(getPos _vehicle select 0),(getPos _vehicle select 1),(getPos _vehicle select 2) + 1000]

@(alive _dropzone) or (menu == 0) or !(alive _leader)  

~2

;move to target

_leader doMove getpos _Dropzone

@(_vehicle distance _dropzone < 1300) or !(alive _vehicle) or (menu == 0) or !(alive _leader)

_vehicle setspeedmode "limited"

_vehicle setBehaviour "CARELESS"

hint "Range 1300"

_vehicle flyinheight 50

?(_ta == 0) : _objects = [_dropzone]

?(_ta == 1) : _objects = nearestObjects [_dropzone,["jeep","car","tank","truck","ship

","men"],200]

~1

_Target = _objects select 0

~0.1

_dropzone setpos getpos _Target

~0.1

_marker setmarkerpos getpos _Dropzone

~0.1

_leader doMove getpos _Dropzone

@(_vehicle distance _dropzone < 350) or !(alive _vehicle) or (menu == 0) or !(alive _leader)

?!(alive _vehicle) or (menu == 0) or !(alive _leader) : goto "cancelled"

?!(menu == 0) && (alive _leader) : hint "Target Acquired."

_vehicle flyinheight 50

;wait till in position

@(_vehicle distance _dropzone < 170) or (unitReady _vehicle) or !(alive _vehicle) or (menu == 0) or !(alive _leader)

?!(alive _vehicle) or (menu == 0) or !(alive _leader) : goto "cancelled"

?(menu == 0) : goto "cancelled"

_num = 4

_i = 0

~0.3

;Drops bombs

#bombs

?!(alive _vehicle) : goto "cancelled"

_bomb = "Bo_GBU12_LGB" Createvehicle [(getPos _vehicle select 0),(getPos _vehicle select 1),(getPos _vehicle select 2)-3]

_bomb setDir (getDir _vehicle)

_bomb setVelocity [(velocity _vehicle select 0)*0.2,(velocity _vehicle select 1)*0.2,(velocity _vehicle select 2)*0.2]

_i = _i + 1

~0.15

? _i < _num : goto "bombs"

hint "Bombs Away.\nHeading Home."

#cancelled

?(menu == 0) : 1 setRadioMsg "Select Target"

~1

_vehicle setspeedmode "full"

_vehicle setBehaviour "CARELESS"

;move back to the place of start

_leader doMove getpos airport

?(menu == 0) : hint "Orders Canceled.\nHeading Home."

?!(alive _leader) : "MayDay MayDay Im Going Down."

;cleans up the mission

;_marker setMarkerType "empty"

deleteVehicle _Dropzone

deleteMarkerLocal _Marker

;when back at the planes starting pos it will delete the plane and pilot

@(_vehicle distance airport < 1000) or (unitReady _leader) or !(alive _vehicle) or (menu == 0) or !(alive _leader)

#end

~0.2

deleteVehicle _vehicle

~0.2

deleteVehicle _leader

exit

----------------------------------------------------

Have Fun

Michael

Share this post


Link to post
Share on other sites

Hi..

not to spoil your fun. but i think Mr murray made a Air stike script a while ago..

Share this post


Link to post
Share on other sites
Quote[/b] ]not to spoil your fun. but i think Mr murray made a Air stike script a while ago..

Isn't that a bit off topic? What does it matter is someone has made a similar script. If Zonekiller writes a script for his own requirements, where is the harm in sharing it.

Share this post


Link to post
Share on other sites

im sure many people have , but in not sure if many are like this one tho. it has differences.

Thanks UNN I agree

Share this post


Link to post
Share on other sites

Did i say someting wrong?

i didnt mean to be negative or anything like that,,,

i was just pointing out that Mr murray has already made a Air strike script.. how can i know if Zonekiller knows about Mr murrays script!

yes there is no harm in sharing scripts,, I think we do it to little infact.. it helps the comunity making better "missions and scripts"

and UNN yea your right,, this might have become a bit Offtopic.

anyway Zonekiller i'll test your script later and have some fun with it pistols.gif

Share this post


Link to post
Share on other sites

good work dude smile_o.gif

this script works very well and ive already used it in my own missions with great results.

Zonekiller is the an easy way to increase the amount of time between airstrikes to 60 seconds instead of 15? huh.gif

Share this post


Link to post
Share on other sites

Good to see new guys posting their work thumbs-up.gif

FYI: It helps us to place code tags around your script when posting for easier readability. To do this, you put [ code] and [ /code] (without that extra space I put in there) on each end.

Example:

[ code]My script[ /code] will look like:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">MyScript

You can shortcut this, by clicking the Code button before pasting the script and then pressing it again after pasting your script.

Share this post


Link to post
Share on other sites

I've tested it, and it's really neat! Good job!

A few questions:

1. How can I increase the timeout so that the airstrike is only available say.. every 120 seconds? What script is this controlled in?

2. Is there a way to make it so that this ONLY works for a specific player or class in the game? (hugely important to me) - that way EVERYONE can't just keep calling airstrikes, etc etc?

Share this post


Link to post
Share on other sites

In the Radio Alpha Trigger you could put in the activation  This && player == Leader player that way only the leader player can use the radio

to make a time limit you might try calling the airstrike script from another script

ie

In the Radio Alpha Trigger you change the [] exec "airstrike.sqs to [] exec "airstrikeStart.sqs"

make a new script call it airstrikeStart.sqs

[] exec "AirStrike.sqs"

~10

showRadio false

~60

showRadio True

hint "Air Strike Squad Now Ready"

Exit

somthing like that

Michael

Share this post


Link to post
Share on other sites
In the Radio Alpha Trigger you could put in the activation  This && player == Leader player that way only the leader player can use the radio

The problem is that in my respawn mission, sometimes ArmA freaks, and another player is dubbed "leader" per-se'.. I'd like it to be more the "role" attached to a specific playable unit.

Share this post


Link to post
Share on other sites

Hey Zonekiller, biggrin_o.gif

Thank's for the Script it's really a greate feature. thumbs-up.gif

Hi..

not to spoil your fun. but i think Mr murray made a Air stike script a while ago..

Well as far is i know the Airstrike script of Mr Murray did not work in MP.

Share this post


Link to post
Share on other sites

In the Radio Alpha Trigger you could put in the activation This && player == typeOf "type of solider"

it may work

Share this post


Link to post
Share on other sites

ZoneKiller,

I like your script, have been playing with it a lot - but I'm having a couple troubles with it...

I'm trying to use it simply as a tool for the west - but If I try to REMOVE the EAST stuff (marker/su) or just move the EAST trigger to a small size and "out of the way", it seems to "break" the WEST bombing calls.. true?

Also, it seems to "mess up" if someone flies over or get's near the WEST trigger since you put variables into it... advise?

If I'm being goofy, any way you can strip out some of the stuff in your demo down to a "west only" type air-strike calling script?

Thanks!

EDIT: To keep people from doing a billion airstrikes at once OR the guy in charge of airstrikes "abusing" the mission by using it too much, and such - I played with adding a ~120 in the script which causes the "please wait" to last longer, which seemed good for my multiplayer mission testing.

Share this post


Link to post
Share on other sites

I love this script, it works FINE for BLUFOR, but in my mission I REALLY need it for Independant, is there any way to get this for Independant? I changed the trigger to "Independant" rather than "BLUFOR" but it gave me a load of errors?

Any help would be greatly appreciated

Share this post


Link to post
Share on other sites

is there any way you can convert this so it can be used with artillary also?

Share this post


Link to post
Share on other sites

thanks for your helpful reply ZoneKiller, you really made my day biggrin_o.gif

satexas69 i think you only need to copy the triggers for west and the airport marker and the airstrike script to your own missions. everything you need are mentioned in the readme or comments in the script i think.

Share this post


Link to post
Share on other sites
satexas69 i think you only need to copy the triggers......

Yes, I did some basic modifying, and it seems to work better.

There's an inherit problem in MP mode when a player calls more than one airstrike at a time (meaning, 2 are queued up and flying, but haven't bombed YET) - so I'd really advise everyone to make sure you do ONE at a time.. let it finish before calling the next one.

Share this post


Link to post
Share on other sites

This script no longer works in Multiplayer..

Anyone know why?

Share this post


Link to post
Share on other sites

what the hell zonekiller why has every unit/waypoint/object - EVERYTHING - been cloned after using your script???

I merged your mission with mine to use your script and took out the crap unrelated to airstrikes that u put in there and now its all gone tits up.

WHY HAS EVERYTHING CLONED ITSELF?

i'm using murrays airstrike script now and it wont works cos the harriers it spawns get cloned and crash mid air.

what the fuck has your script done to my mission. tell me how the hell this has happend.

Share this post


Link to post
Share on other sites
what the hell zonekiller why has every unit/waypoint/object - EVERYTHING - been cloned after using your script???

I merged your mission with mine to use your script and took out the crap unrelated to airstrikes that u put in there and now its all gone tits up.

WHY HAS EVERYTHING CLONED ITSELF?

i'm using murrays airstrike script now and it wont works cos the harriers it spawns get cloned and crash mid air.

what the fuck has your script done to my mission. tell me how the hell this has happend.

How did you do that? I want to clone myself! xmas_o.gifxmas_o.gif

Share this post


Link to post
Share on other sites

need a bit of help with this did everything you said but for some reason the part where i have to set a target doesnt work for me could you please maybe go into more detail of how you actually set this up would be great

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  

×