Jump to content
Sign in to follow this  
klavan

Chopper area suppression script

Recommended Posts

What I need is a script that works with onmapsingleclick command: imagine you're a soldier that need a couple of helos placed in your support to make a single passage with FFARs over a given area (let's say 100x30 meters). I'm currently trying to create it, but I''ve discovered that it's not a simple task...

Maybe a script already exist for this pourpose....

Thanks in advance for any help.

Share this post


Link to post
Share on other sites

I bet it's possible. And IMO it really would be great if someone can make a certain script like that. Would definately be useful in certain missions. You can probably ask general barron if he would know how to do this since he made a neat script where AI inf can do indirect fire with grenades.

Share this post


Link to post
Share on other sites

I made a script that uses Lester's Invisible Addons to allow a chopper, plane, tank, or whatever you want to fire on an area.

You can find it here. This version places the Invis Target near objects (units and choppers) but I have a version at home that works with onsingleMapclick. It may not work as is for your request (make a single passage with FFARs over a given area let's say 100x30 meters), but could be modified to get the desired effect.

I can post that version over the weekend if you are not opposed to using a small (~3 kb) addon that is included with my script demo.

Wadmann

Share this post


Link to post
Share on other sites

MMMMHHHH.....

Actually my script runs like Wadmann's one with the onmapsingleclick. It features the Inv Traget addon as well, and all seems ok.

The problem is to force the chopper(s) to continue to fire while mantaining the same velocity and nose angle to create a corridor of fire. If the target is destroyed the units disengage immediately and the same result is obtained changing setcaptive status and moving the target elsewhere.

Maybe the solution is to use disableai command, but this may lead to a radical re-thinking about the script structure.

However this is the version I'm actually testing

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

bersaglio setcaptive true

player sidechat "Mosquito, this is Shepherd One. We need area fire. Over."

?!canmove atk1 && !canmove atk2 : goto "Badend"

_pos = _this select 0

#Continue

onMapSingleClick {}

;_fake = "LesIAETA" CreateUnit [_pos, fake]

"target" setMarkerType "destroy"

"target" setMarkerPos _pos

bersaglio setPos [(_pos select 0),(_pos select 1),0]

atk1 RemoveMagazine "MachineGun30"

atk2 RemoveMagazine "MachineGun30"

atk1 RemoveMagazine "HellfireLauncher"

atk2 RemoveMagazine "HellfireLauncher"

leader hotel doMove _pos

atk2 dofollow leader hotel

atk1 dotarget bersaglio

atk2 dotarget bersaglio

atk1 setcombatmode "red"

atk2 setcombatmode "red"

atk1 dofire bersaglio

atk2 dofire bersaglio

hotel setformation "stag column"

~4

?chiamata : goto "Salta"

chiamata=true

;leader hotel sideradio "Sup2"

leader hotel sidechat "Sheperd One, this is Mosquito. Incoming and thirst for blood! Over." && goto "Inizia"

#salta

;leader hotel sideradio "Sup3"

leader hotel sidechat "Roger, Shepherd One. Incoming. Over."

#Inizia

@(leader hotel distance bersaglio) <= 800

atk1 addeventhandler ["fired",{[atk1] exec "Spostamento.sqs"}]

atk2 addeventhandler ["fired",{[atk2] exec "Spostamento.sqs"}]

@!(alive bersaglio)

~6

#Next

atk1 setfuel 1

atk2 setfuel 1

;leader hotel sideradio "Sup4"

leader hotel sidechat "Mosquito to Shepherd One. We're leaving the area. Over."

"target" setMarkerType "empty"

atk2 dofollow leader hotel

leader hotel domove getmarkerpos "partenza"

hotel setformation "wedge"

~60

atk1 AddMagazine "MachineGun30"

atk2 AddMagazine "MachineGun30"

atk1 AddMagazine "HellfireLauncher"

atk2 AddMagazine "HellfireLauncher"

4 setradiomsg "Air Support (Area)"

exit

#Badend

~4

"target" setMarkerType "empty"

;papabear sideradio "Sup5"

papabear sidechat "TF21 to Sheperd One. We lost radio contact with Mosquito. Consider it gone. Over."

deletevehicle support1

deletevehicle support2

exit

Note that this is a veryvery rough version.

Follow the addeventhandler-related script:

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

_unit = _this select 0

_unit fire ["ZuniLauncher38", "ZuniLauncher38", "ZuniLauncher38", "ZuniLauncher38", "ZuniLauncher38"]

bersaglio setdammage 0

~3

_unit fire ["ZuniLauncher38", "ZuniLauncher38", "ZuniLauncher38", "ZuniLauncher38", "ZuniLauncher38"]

bersaglio setdammage 0

~3

_unit fire ["ZuniLauncher38", "ZuniLauncher38", "ZuniLauncher38", "ZuniLauncher38", "ZuniLauncher38"]

bersaglio setdammage 0

~3

_unit fire ["ZuniLauncher38", "ZuniLauncher38", "ZuniLauncher38", "ZuniLauncher38", "ZuniLauncher38"]

bersaglio setdammage 0

bersaglio setcaptive true

_unit dotarget objnull

bersaglio setpos [((getpos bersaglio select 0) +200),((getpos bersaglio select 1) -200),0]

exit

As i said before, both the scripts are rough. I've tried various combinations of commands, but nothing.

maybe this can help in create something new and interesting.

Thanks for your help.

Share this post


Link to post
Share on other sites

Well I can see that you have mastered scripting far more so than I may ever hope to attain!

But since we are thinking along the same lines, my thought was to place the invis target when the chopper arrives at a certain spot, chopper fires away for ~2-3 seconds, invis target is deleted on deactivation and a new invis target is created 10m or so further downrange, repeat the process as long as needed.

I basically did this in one of my missions where a Cobra flies in over an airfield blasting empty parked aircraft along the runway. As soon as the first aircraft was damaged to a certain level, the invis target was deleted and a new one was placed at the next parked aircraft. With a little adjustment, the effect was that the Cobra essentially strafed the line of aircraft.The Cobra did fire its cannon, but you could then do what you did with your script and remove the ordinance that you do not want expended on the targets.

You may be on the right track with the disableAI command (targeting?), but to keep the chopper headed and moving in the correct direction would be a major pain in the a** using the setvelocity command (I think).

Sorry I could not be of more help to you as I underestimated your own scripting knowledge (and displayed my own shortcomings  wink_o.gif )!

Wadmann

Share this post


Link to post
Share on other sites
The Cobra did fire its cannon, but you could then do what you did with your script and remove the ordinance that you do not want expended on the targets.

I suspect there's one major problem: the cannon can move independently respect the aircraft for targeting pourpose, while the FFARs pylons not. I've already try to move the target a little (10 to 30 meters) when the chopper fire a rocket but the chopper stops to fire and start to manouver for a new attack from a different direction.

Quote[/b] ]

You may be on the right track with the disableAI command (targeting?), but to keep the chopper headed and moving in the correct direction would be a major pain in the a** using the setvelocity command (I think).

I've experienced a little with this command, but it should be a big problem. The problem is you can't enable the ai once disabled! So, probably, the solution is to directly create the chopper in game every time the player need and then delete it...

I'll try....

Share this post


Link to post
Share on other sites

If you have downloaded BAS's Tonal Island, the single player campaign included, has a cutscene at the start where a Mi8 (I think) does some thing pretty similar to what you looking for, while persuing some native malcontent on a motorbike.

Maybe you could dePBO the campaign and have a look at how they did it?

Share this post


Link to post
Share on other sites

@Chops

Already done some days ago. In fact that suite of scripts give the idea to put similar stuffs in a mission....but ingame the script that should rule the area fire coverage seems not to run, as the chopper fly here and there around the clicked position without taking any action against enemy unless it's a vehicle.

I've cheked it but i didn't find nothing that could help me. In addiction, the scripts that runs CAS and area defence are very similar to each other and in both the chopper are ordered only to fly toward various positions without specific fire orders.

Instead, the the one that rules the precision attack placed a group of target around the clicked area, but the result is much different from my whishes.

However thanks to Wadmann suggestions I'm obtaining some improvements in my script: shifting the target away the moment the chopper fire seem to give some results, but all is still very unstable and i'm currently testing and modifing it to obtain an acceptable result.

Hope to be understood as my english is unstable, too!!

wink_o.gif

Thanks for your help.

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  

×