Q: Airstrike script problem

VTE - The most detailed and comprehensive Vietnam modification for OFP

Moderators: Lone Wolf, Snake Man

Post Reply
Zarele
Newbie
Posts: 2
Joined: 2005-10-07 21:23:28

Q: Airstrike script problem

Post by Zarele » 2005-10-07 16:33:35

Hey guys,

First off all great addon!! Keep it, hope to see some really nice shit in the future.

Second, I have a question, more of a problem.
I' am working on a coopmission for VTE (duh) and I wanted to give a real vietnam experience so i wanted to ad airstrikes and arty. The arty is no problem but the airstrike is. I looked at difrent scripts, and i found the one that skumbal and LCD created the most usefull.

;--------------------------------------------------------------------------------------------------------------------------------------------------------------------
;Airstrike 1.2 - an OFP script by Skumball
;(thanks to Viriato for making the bombs fall better :)
;(thanks to LCD for incorporating the script into the radio)
;requires OFP v1.85
;
;Modified by LCD to call the Grid Location of the target
;
;This script will execute a bombing run wherever the player clicks on the map. The mission requires:
;3 Markers: "spawn", "safe" and "target", all set to 'empty'.
;A trigger: Radius - 0, Activation: Radio Alpha set to Repeatedly, On Activation: onMapSingleClick {[_pos] exec "airstrike.sqs"}; strikePilot sideChat "Give me a target"
;It also needs a soldier called "strikePilot".
;
;A pilot waits at "safe". When Radio (0,0,1) is issued and the map is clicked a plane is created at "spawn" and the pilot is moved into the plane.
;A script named "gridcoordinates_pipe.sqs" is used to generate the grid location and give it when the target is called
;The pilot flies to the location and 4 LGB's are created at a small random radius beneath the plane.
;The pilot then flies back to "spawn" where the plane is deleted and the pilot is moved back to the "safe" location.
;
;Try changing the value of _num, *0.2 and ~0.3 to achieve different results.
;
;Comments/Suggestions - simongoddard4@yahoo.co.uk
;--------------------------------------------------------------------------------------------------------------------------------------------------------------------

onMapSingleClick {}
1 setRadioMsg "Null"
2 setRadioMsg "Null"


_pos = _this select 0
[_pos, "Terget at grid location ", ". Over.", ["SideChat", player]] exec "gridcoordinates_pipe.sqs"
~5
"target" setMarkerPos _pos
"target" setMarkerType "destroy"

strikePlane = "A10LGB" camCreate (getMarkerPos "spawn")
strikePlane setPos [(getPos strikePlane select 0),(getPos strikePlane select 1),(getPos strikePlane select 2)+800]
strikePlane setDir 180

strikePilot assignAsDriver strikePlane
strikePilot moveInDriver strikePlane
strikePilot doMove _pos
strikePilot sideChat "On the way"

@ unitReady strikePilot
strikePilot sideChat "Target aquired"

_num = 4
_i = 0

#loop
_bomb = "laserGuidedBomb" camCreate [(getPos strikePlane select 0)+((random 10)-5),(getPos strikePlane select 1)+((random 10)-5),(getPos strikePlane select 2)-3]
_bomb setDir (getDir strikePlane)
_bomb setVelocity [(velocity strikePlane select 0)*0.2,(velocity strikePlane select 1)*0.2,(velocity strikePlane select 2)*0.2]
_i = _i + 1
~0.3
? _i < _num : goto "loop"

strikePilot doMove (getMarkerPos "spawn")
strikePilot sideChat "Heading back"

"target" setMarkerType "empty"

@ unitReady strikePilot
deleteVehicle strikePlane
strikePilot setVelocity [0,0,0]
strikePilot setPos (getMarkerPos "safe")
strikePilot sideChat "Ready"

1 setRadioMsg "Air Strike"
2 setRadioMsg "Air Strike Napalm"

exit


The script works great like it is so i thought that if i change the plane from "A10lgb" to "vte_f100" (one of vte planes) and the "lasergiudedbomb" to "VTE_BLUE8rail" (a napalm bom) nothing happens. The plane is created but no bom wil fal. They heva another script but this uses a napalm addon.

The questions are: Do you guys have a napalm effect or addon in vte? And what is it name?
If not What do you suggest I do to create an nice napalm airstrike?

Hope to hear soon from you gus and hope to see more bloddy vietnam addons!

Cheerz

Snake_Man

Re: Q: Airstrike script problem

Post by Snake_Man » 2005-10-07 17:39:53

You need to make few changes. The F100 has napalm but its called VTE_BLU_3Rail by its classname. This following is some airstrike script I had lying around, I have not recently tested this so it might not even work, but its a guideline.

This is a good topic btw, lets keep it active and develop a nice VTE airstrike script.

Let me know how this script works for you.

Code: Select all

_bomba = "VTE_BLU_3Rail";<br><br>if (!local Server) then { exit; };<br><br>1 setradiomsg "null";<br><br>_pos = _this select 0<br>[_pos, "TARGET AT GRID COORDINATES ", ". OVER.", ["SideChat", player]] exec "gridcoordinates_pipe.sqs";<br>"target" setMarkerPos _pos<br>"target" setMarkerType "destroy"<br><br>strikePlane = "VTE_F100AG" createvehicle (getMarkerPos "spawn")<br>strikePlane setPos [(getPos strikePlane select 0),(getPos strikePlane select 1),200]<br>strikePlane setDir 0<br>strikePlane setvelocity [0,200,0];<br>strikePlane flyinheight 50;<br><br>strikePilot setspeedmode "full";<br>strikePilot setcombatmode "blue";<br>strikePilot setformation "column";<br>strikePilot setbehaviour "careless";<br>strikePilot assignAsDriver strikePlane<br>strikePilot moveInDriver strikePlane<br>strikePilot doMove _pos;<br>~1<br><br>strikePilot sidechat "ON MY WAY. OVER."<br><br>@unitready strikePilot<br>strikePilot sidechat "NAPALM! NAPALM!"<br><br>strikePlane fire _bomba<br>~.001<br>strikePlane fire _bomba<br>~2<br><br>strikePlane flyinheight 150<br><br>strikePilot doMove (getMarkerPos "safe")<br>strikePilot sidechat "RETURNING TO AIRBASE."<br><br>"target" setMarkerType "empty"<br><br>@unitReady strikePilot<br>deleteVehicle strikePlane<br>if (!alive strikePilot) then { strikePilot setdammage 0; };<br>strikePilot setVelocity [0,0,0]<br>strikePilot setPos (getMarkerPos "spawn")<br>strikePilot sidechat "A-1 SKYRAIDER READY FOR RE-TASKING. OVER."<br><br>1 setradiomsg "Call - Airstrike";<br><br>exit<br>

User avatar
Polish_GI
2nd Lt
Posts: 99
Joined: 2005-09-18 22:16:59

Re: Q: Airstrike script problem

Post by Polish_GI » 2005-10-08 02:50:54

I would like to see a library (if you will) of scripts for the Vietnam era. I have a few, but it would be nice to have a central location for all of them (e.g. flare, trip flare, rappelling, airstrike, napalm, smoking, artillery etc etc).

Zarele
Newbie
Posts: 2
Joined: 2005-10-07 21:23:28

Re: Q: Airstrike script problem

Post by Zarele » 2005-10-08 10:48:11

well your script works almost :) the plans drops the bom when it already past the target, and i can only run it once.

*edit*

I solved the problem with the run time= it should be getmarkerpos "safe" instead of getmarkerpos "spawn"
Last edited by Zarele on 1970-01-01 00:00:00, edited 1 time in total.

charon
Recruit
Posts: 25
Joined: 2005-09-20 15:59:19

Re: Q: Airstrike script problem

Post by charon » 2005-10-11 01:50:10

Zarele,
f course the bombs will drop when the plane is past the target, due to the command lines:

strikePilot doMove _pos
...
@ unitReady strikePilot

This will halt the script until the plane reaches the waypoint
_pos and then carries on with the dropping.

I personally never use "@ unitReady" in my air-scripts,
as i have had lots of problems with choppers never being
"ready" even after they have passed the waypoint.
The preferable method is to use the distance-command.
I suggest you use a loop (you might have to setpos an invisible H to the marker and use its name after the distance-command for it to function properly):

...
strikePilot doMove _pos
strikePilot sideChat "On the way"

#Approach

? strikePilot distance _pos < 200 : goto "DropTheBomb"

~.001
goto "Approach"

#DroptheBomb

strikePilot sideChat "BOMBS ARE GONE!"

...

If you are into more complex math you can even make an
equation that determines the drop-distance from the altitude
and speed of the plane.

Hope that helps your plane to drop the bombs right on the target.


BTW,
for point-accurate Napalm or Bomb drops i have developed a custom script that overrides the stupid pilot AI.
If anyone needs something like that in his missions let me know.

Charon

Snake_Man

Re: Q: Airstrike script problem

Post by Snake_Man » 2005-10-11 02:01:33

Charon, yes please post your script here. I'm very interested of such script which calculates the drop-point so the bombs fall into the target.

charon
Recruit
Posts: 25
Joined: 2005-09-20 15:59:19

Re: Q: Airstrike script

Post by charon » 2005-10-11 18:15:49

SnakeMan,
can you post the gridcoordinates_pipe.sqs script here?
Can't find it in the net.
I don't have it and it would be good to use grid coordinates.
I will post a full airstrike script here later.
Charon

Snake_Man

Re: Q: Airstrike script problem

Post by Snake_Man » 2005-10-11 18:24:18

Here it is, from my PMC NAM 1965 campaign dirs.

Code: Select all

;calculates the ingame grid coordinates (e.g. Be39) from a position array [x,y,z]<br>;[<positionarray>, <frontmatter>, <backmatter>, <comchannel>] exec "gridcoordinates.sqs" <br>;With comchannel you can choose the method of output:<br>;<comchannel> = ["Hint"]                          --> Hint<br>;                              ["SideChat", <unit>]    --> Sidechat by <unit><br>;Example:<br>;[GetPos player, "My position is grid ", ". Over.", ["SideChat", player]] exec "gridcoordinates.sqs"<br><br>_pos = _this select 0<br>_xpos = _pos select 0<br>_ypos = _pos select 1<br>_frontmatter = _this select 1<br>_backmatter = _this select 2<br>_comchannel = _this select 3<br><br>?((_xpos <0>= 12800) OR (_ypos <0>= 12800) ): _string = "XxXx"; Goto "SendMessage"<br><br>_xcoarserest = (_xpos Mod 1280)<br>_xslotcoarse = (_xpos - _xcoarserest)/1280                               <br>_xslotfine =(_xcoarserest - (_xcoarserest Mod 128))/128        <br><br>_yslot = 99 - (_ypos - (_ypos Mod 128))/128<br>                            <br>_ystring = Format["%1",_yslot]<br>?_yslot < 10: _ystring = "0" + _ystring <br><br>_upper = ["A","B","C","D","E","F","G","H","I","J"]<br>_lower = ["a","b","c","d","e","f","g","h","i","j"]<br>_xstring = (_upper select _xslotcoarse) + (_lower select _xslotfine)<br><br>_string = (_xstring + _ystring)<br><br>#SendMessage<br>      _output = _frontmatter + _string + _backmatter<br>      Goto (_comchannel select 0)<br>      Goto "End"<br><br>#SideChat<br>      (_comchannel select 1) SideChat _output<br>      Goto "End"<br><br>#Hint<br>      Hint _output<br>      Goto "End"<br><br>#End<br>      Exit
But that would also work only partially since all (my) 25km islands use the 6 digit mapgrid system where this script reports completely wrong map grids.

User avatar
Polish_GI
2nd Lt
Posts: 99
Joined: 2005-09-18 22:16:59

Re: Q: Airstrike script problem

Post by Polish_GI » 2005-10-11 22:30:16

How hard would it be to include the following:

Rocket attack from a Sandy
Bomb attack from any aircraft
Napalm attack from any attack
Strafing script from a Huey Door Gunner
Rocket/MGs from an AH-1 or Huey Hog?

Is this possible?

Thoughts?

charon
Recruit
Posts: 25
Joined: 2005-09-20 15:59:19

Re: Q: Airstrike script problem

Post by charon » 2005-10-11 22:59:56

Thanks Snakeman,
i think the script could be adapted to your maps,
needs a little effort.
To keep the VTEAirStrike script as universal as possible
what strike options can you think of?

I have used so far an Mk82 bombing run with a Thunderchief.
It would be good to call the script with options about what
type of airstrike is about to be required, like napalm,bombs or
missile attacks against armored targets.

I will probably be able to finish the demo mission tonite,
just looking for a space to upload it.

Charon

Snake_Man

Re: Q: Airstrike script problem

Post by Snake_Man » 2005-10-12 00:22:46

Now this topic really gets going, I love it! :D

The WGL guys made a invisible object, called CAS Target which could be map clicked into the target, then friendly aircrafts would attack it. However I never used this, I'm not sure if its for MP (non AI aircraft) use only. My stupid head thinks right now that all the units would attack this target... so it would be lame to see your machine gunner wildly start to shoot the airstrike position. However I do not know.

What I'm saying is, that if such invisible target would work fine, I'm happy to add it into VTE and plug it into some RTO guys action menu or something like in WGL.

So whats the use of this invisible target? Well place it on the map after "Call - Airstrike" from radio menu, then aircrafts would come and the OFP AI would really attack the target using the weapons of the aircraft, not just some script.sqs which would mechanically camCreate the bombs over target. But heh, of course if the script is very good and you really believe that its friendly pilot whos dropping the ordnance, then all the same for me :)

charon
Recruit
Posts: 25
Joined: 2005-09-20 15:59:19

Re: Q: Airstrike script problem.

Post by charon » 2005-10-12 00:27:19

Snakeman,
one aspect you are missing is that the invisible object
will be attacked by RPG soldiers of your side as well

Snake_Man

Re: Q: Airstrike script problem

Post by Snake_Man » 2005-10-12 00:27:22

To keep the VTEAirStrike script as universal as possible
what strike options can you think of?
One would be the requested ordnance like Napalm of just dumb bombs. Then one option would be random, I mean when you request airsupport, you have to wait and see if there is lone Huey with minigun coming up or four ship of B-52's leveling the whole battlefield :)

I mean at least with aircraft type and napalm/dumb bombs it would be very easy to randomize what kind of support we get.

Regarding my other post just above, if we have such invisible target, then we could have the AI make several attack runs, which again would be really cool.

charon
Recruit
Posts: 25
Joined: 2005-09-20 15:59:19

Re: Q: Airstrike script problem

Post by charon » 2005-10-12 00:35:19

I like the idea of the random option,
that's like in real life ; you will get what is available, hehe.
I have experimented with invisible targets a lot,
managed to stick it to a bridge, so some russian "Hinds" would
appear to be trying to destroy the bridge.
It's hard to "override" the OFP AI in terms of target selection and engaging. But some of Polish_GIs suggestions are doable.
BTW, with which tool do you guys pakc your mission.pbos?
I tried it with MakePBO1.1, but it does not show up under single-player mission?

charon
Recruit
Posts: 25
Joined: 2005-09-20 15:59:19

Re: Q: Airstrike script problem

Post by charon » 2005-10-12 00:41:57

http://s48.yousendit.com/d.aspx?id=151A ... GFQ3GLH6E4

That's the Link to the bomb strike demo mission.
You can call the airstrike with radio menu 2.

I will post a little explanation of the script here later.
Charon

Snake_Man

Re: Q: Airstrike script problem

Post by Snake_Man » 2005-10-12 00:50:11

It's hard to "override" the OFP AI in terms of target selection and engaging.
What about the invisible target in the first place, aren't that configured as such high value target that the AI will attack it with first priority (or something)?
with which tool do you guys pakc your mission.pbos?
I use PboX v1.0 by your favourite WrpTool Dev Team 8)

charon
Recruit
Posts: 25
Joined: 2005-09-20 15:59:19

Re: Q: Airstrike script problem

Post by charon » 2005-10-12 01:01:45

What about the invisible target in the first place, aren't that configured as such high value target that the AI will attack it with first priority (or something)?

I use PboX v1.0 by your favourite WrpTool Dev Team 8)

I will experiment again with that for some nice Huey gunner fly-by action and let you know what i have come up with.
The only problematic thing is if you put the inv target in the middle of a battlefield where both sides are fighting, so all your units equipped with LAWs/RPGs will start attacking the invisible target also, which distracts them from their real enemies.
But maybe there is a work around.

How did you manage to put the script earlier on after the
CODE: thing. Must be some HTML-command or?
I wanted to post a documentation for that airstrike script, but the format doesn't fit the message window partially.
Charon

Snake_Man

Re: Q: Airstrike script problem

Post by Snake_Man » 2005-10-12 01:22:11

I tried out your bomb demo mission, very nice action. Heh add overview and you could use that directly as some nice "quick action" mission! :)

Could your airstrike script (or any) be tweaked to add the difficult B-52 or MC-130 high altitude bombing?

I mean the B-52 (current config) drops MK82s at 12 in one time, the MC-130 again which uses the Daisy Cutter, will need to be like 500m altitude running at full speed to escape the blast radius (of course the daisy cutter is still under development and I'm quite sure the damMage levels must be tweaked as its so devastative now).

charon
Recruit
Posts: 25
Joined: 2005-09-20 15:59:19

Re: Q: Airstrike script problem

Post by charon » 2005-10-12 01:40:08

I tried out your bomb demo mission, very nice action. Heh add overview and you could use that directly as some nice "quick action" mission! :)

Could your airstrike script (or any) be tweaked to add the difficult B-52 or MC-130 high altitude bombing?

I mean the B-52 (current config) drops MK82s at 12 in one time, the MC-130 again which uses the Daisy Cutter, will need to be like 500m altitude running at full speed to escape the blast radius (of course the daisy cutter is still under development and I'm quite sure the damMage levels must be tweaked as its so devastative now).
Yeah the mission is kinda simple but fun, hehe.
No problem with high altitude bombing i would say,
i have made proprietary scripts that fly the planes at high altitude, thereby escaping the blast.
I was actually the guy that developed the very first OFP nuke back in 2000, so i could give you guys some help in tweaking the blast radius.
Will update here what i have found out about InvTargets and high altitude stuff.
Charon

charon
Recruit
Posts: 25
Joined: 2005-09-20 15:59:19

Re: Q: Airstrike script problem

Post by charon » 2005-10-12 01:59:14

Here is the VTEAirstrike script V0.9 :

Code: Select all

<br><br>; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<br>; +++++++++++         VTE Airstrike Script V0.9      +++++++++++++<br>; +++++++++++ Script that calculates the approximate +++++++++++++<br>; +++++++++++ distance from a target that is needed  +++++++++++++<br>; +++++++++++ to drop bombs accurately on the target +++++++++++++<br>; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<br>; ++++++++++++++++++++ written by Charon +++++++++++++++++++++++++<br>; ++++++++++++++++++++    10/11/2005     +++++++++++++++++++++++++<br>; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<br><br><br>; Script requirements:<br>; - A trigger called "Altimeter" with no special settings<br>; - An "empty" marker called "VTEAirTarget1"<br>; - An "empty" marker called "VTEAirSpawn1" created at a<br>;   position that works for all possible air strikes!<br>; - A GameLogic-Object called "VTEAirTar", must be : <br>;   side="Game Logic" class="Objects" unit="Game Logic" !!!! <br>;   otherwise distance-command won't work<br>; - A soldier that is the leader of a group named "VTEuspilgrp1"<br>;   the soldier should be deletevehicled<br>; - A trigger: Radius - 0, Activation: Radio Bravo set to Repeatedly, On Activation: onMapSingleClick<br>;   {[_pos] exec "VTEAirStrike.sqs"}; hint "Mark the target coordinates on the map."<br>;<br>; - You have to define the Radiocallsign for FieldHQ,<br>;   which is your HQ basically<br>;<br><br>_null = _this select 0<br>_mode = _this select 1<br><br>? _mode == "DEL" : goto "removeunits"<br><br>; +++ physical constants +++<br><br>_g = 9,80665 <br><br>; variables<br><br>_strikedowntime = 120<br>; determines the downtime before the next possible airstrike<br><br>_caller = player<br>; the unit calling the airstrike, could be a radio operator as well<br><br>_trig = altimeter<br>VTEDebug = false<br>; used to observe variables in-game, set true to debug<br>_warned = false<br><br><br>1 setradiomsg "null"<br><br>~2<br><br>#callstrike<br><br>; call the strike by radio<br><br>onMapSingleClick {}<br> _pos = _this select 0<br><br>_caller sidechat format ["HQ, THIS IS %1. REQUESTING AIRSTRIKE",group _caller]<br>~1<br><br>[_pos, "AGAINST ENEMY UNITS AT POSITION ", ". OVER.", ["SideChat", player]] exec "gridcoordinates_pipe.sqs"<br>"VTEAirTarget1" setMarkerPos _pos<br>"VTEAirTarget1" setMarkerType "destroy"<br>VTEAirTar setpos _pos<br>~5<br>FieldHQ sidechat "AIRSTRIKE REQUEST CONFIRMED, KEEP THE TARGET ZONE CLEAR. OUT."<br><br>~12<br>; give the plane time to approach<br><br>#start<br><br>_posx = _pos select 0<br>_posy = _pos select 1<br><br><br>"SoldierWPilot" createunit [(getMarkerPos "VTEAirSpawn1"), VTEuspilgrp1, "VTEAstrikePilot = this", 1, "CORPORAL"]<br>_plane = "VTE_Thud" createvehicle (getMarkerPos "VTEAirSpawn1")<br>~1<br>_plane setdir 90<br>_plane setPos [(getPos _plane select 0),(getPos _plane select 1),200]<br><br><br>VTEAstrikePilot assignasdriver _plane<br>VTEAstrikePilot moveindriver _plane<br><br>#lift1<br><br>_plane flyinheight 100<br><br>VTEAstrikePilot action ["ENGINEON"]<br>~1<br><br>VTEAstrikePilot setspeedmode "full"<br>VTEAstrikePilot setcombatmode "blue"<br>VTEAstrikePilot setformation "column"<br>VTEAstrikePilot setbehaviour "careless" <br><br>VTEAstrikePilot domove _pos<br><br>;[VTEAstrikePilot] join grpNull<br><br>_xvelocity = 140<br>_yvelocity = 140<br><br>; accelerate the plane to cruising speed<br><br>#boost<br>      _plane setvelocity [_xvelocity * sin 90,_yvelocity * cos 90,1]<br>      _plane setdir 90<br>      ~0.05<br>      ? speed _plane>120:goto "boostdone"<br>goto"boost"<br><br>#boostdone<br><br>VTEAstrikePilot domove _pos<br><br>; Now comes the math part<br><br>#Approach<br><br>_planepos = getpos _plane<br>_trig setpos _planepos<br>_absplanealt = abs (getpos _trig select 2)<br>_trig setpos _pos<br>_abstaralt = abs (getpos _trig select 2)<br>_altdiff = _absplanealt - _abstaralt<br>_planespeed = speed _plane<br>_planespeed = _planespeed / 3.6<br>_timeimpact = sqrt (2 * _altdiff / _g)<br>_dropdistance = _planespeed * _timeimpact<br>? _plane distance VTEAirTar < _dropdistance : goto "DropBombs"<br>? not _warned and _plane distance VTEAirTar < (2 * _dropdistance) : _warned = true ; VTEAstrikePilot sidechat "APPROACHING TARGET. TAKE COVER."<br>~.001<br><br>goto "Approach"<br><br>#DropBombs<br><br>VTEAstrikePilot setcombatmode "red"<br><br>VTEAstrikePilot sidechat "BOMBS ARE GONE!"<br><br>_plane fire ["VTE_Mk82_8Rail","VTE_Mk82_8Rail","VTE_Mk82_8Rail"]<br>~.05<br>_plane fire ["VTE_Mk82_8Rail","VTE_Mk82_8Rail","VTE_Mk82_8Rail"]<br>~.05<br>_plane fire ["VTE_Mk82_8Rail","VTE_Mk82_8Rail","VTE_Mk82_8Rail"]<br>~.05<br>_plane fire ["VTE_Mk82_8Rail","VTE_Mk82_8Rail","VTE_Mk82_8Rail"]<br>~.05<br>_plane fire ["VTE_Mk82_8Rail","VTE_Mk82_8Rail","VTE_Mk82_8Rail"]<br>~.05<br>_plane fire ["VTE_Mk82_8Rail","VTE_Mk82_8Rail","VTE_Mk82_8Rail"]<br>~.05<br>_plane fire ["VTE_Mk82_8Rail","VTE_Mk82_8Rail","VTE_Mk82_8Rail"]<br>~.05<br>_plane fire ["VTE_Mk82_8Rail","VTE_Mk82_8Rail","VTE_Mk82_8Rail"]<br>~.05<br>_plane fire ["VTE_Mk82_8Rail","VTE_Mk82_8Rail","VTE_Mk82_8Rail"]<br><br><br>VTEBombsgone = true<br>; global variable to be used by other scripts or triggers<br><br>[ObjNull,"DEL"] exec "VTEAirStrike.sqs"<br><br>~_strikedowntime<br><br>1 setradiomsg "Call - Airstrike"; <br><br>exit<br><br><br>#removeunits<br>~13<br>deletevehicle VTEAstrikePilot<br><br>deletevehicle _plane<br><br>exit<br><br>

Okay let's get this done together.
We will be using something that i call approximating math,
that will just do the job for us, but is not taking into consideration
all of the variables that occur during the physical process
of dropping a bomb from an aeroplane.
Things like Turbulences and wind resistance are not considered.

Knowing the altitude of the plane and it's airspeed is enough
to calculate the time that a bomb needs to fall to the ground.
with kinematic math:


Altitude of the plane: getpos _plane select 2

Airspeed : speed _plane

Earth acceleration : _g = 9,80665 m/s

_planealt = getpos _plane select 2
_planespeed = speed _plane

_timeimpact = sqr (2 * _planealt / _g)

_dropdistance = _planespeed * _timeimpact

Now this will only work on completely flat terrain!

To adapt it to hilly landscapes we have to
use absolute altitudes.
Unfortunately the OFP engine does not have a
direct way to find out the absolute altitude of
a vehicle.
A few years ago SelectThis developed a method to determine
absolute z values with triggers, which i used in my
early cruise-missile scripts.
We have to setpos a trigger to the coordinates of the
plane and use :

_absplanealt = abs (getpos _trig select 2)

After that we determine the absolute z of the target coordinates:

_abstaralt = abs (getpos _trig select 2)

The real height difference between the plane
and the target is ultimately expressed by this term:

_altdiff = _absplanealt - _abstaralt

and the modified dropdistance :

_timeimpact = sqrt (2 * _altdiff / _g)
_dropdistance = _planespeed * _timeimpact


Additionally there is to mention that there is
a delay occuring between the condition becoming true
and the AI actually firing the bomb that might create
inaccuracies.
We might have to adjust that with an offset.

I encourage anyone to test this in their mission and
post observations/errors here.

Have fun with it,
Charon

charon
Recruit
Posts: 25
Joined: 2005-09-20 15:59:19

Re: Q: Airstrike script problem

Post by charon » 2005-10-13 03:01:32

Now this topic really gets going, I love it! :D

The WGL guys made a invisible object, called CAS Target which could be map clicked into the target, then friendly aircrafts would attack it. However I never used this, I'm not sure if its for MP (non AI aircraft) use only. My stupid head thinks right now that all the units would attack this target... so it would be lame to see your machine gunner wildly start to shoot the airstrike position. However I do not know.

What I'm saying is, that if such invisible target would work fine, I'm happy to add it into VTE and plug it into some RTO guys action menu or something like in WGL.

So whats the use of this invisible target? Well place it on the map after "Call - Airstrike" from radio menu, then aircrafts would come and the OFP AI would really attack the target using the weapons of the aircraft, not just some script.sqs which would mechanically camCreate the bombs over target. But heh, of course if the script is very good and you really believe that its friendly pilot whos dropping the ordnance, then all the same for me :)

After hours of tweaking, i managed to modify the config
of my old invisible targets addon for bridge destructions in a way
that the target is only attacked by planes with missiles and bombs (!) . I had 5 machinegunners standing right next to it,5 LAW soldiers and one M60 tank and NONE (!) of 'em bothered firing at the invisible target.

I have also made one version where all soldiers start shooting
like crazy at the invisible target with their M16s/M60s, which could be good for cover-fire situations.

The only airstrike option that im not sure about is having a plane
attack an invisible target with AIM9s (Missiles) instead of rockets, as the cost for a missile was quite high at that time.
What do you think?

And can anyone explain me what Polish_GI means with " Rocket attack from a Sandy" ? Couldnt find out what a Sandy is.

User avatar
Polish_GI
2nd Lt
Posts: 99
Joined: 2005-09-18 22:16:59

Re: Q: Airstrike script problem

Post by Polish_GI » 2005-10-13 03:51:19

My apologies... I was referring to the Douglas A-1 Skyraider. I believe it was called a Sandy. Here are a few links:

http://www.wpafb.af.mil/museum/air_power/ap49.htm

http://www.wpafb.af.mil/museum/research ... 6/a6-3.htm

Snake_Man

Re: Q: Airstrike script problem

Post by Snake_Man » 2005-10-13 04:44:04

After hours of tweaking, i managed to modify the config of my old invisible targets addon for bridge destructions in a way that the target is only attacked by planes with missiles and bombs (!).
Wow thats excellent, could you please post or private message me with the config.cpp part for this invisible object?
I have also made one version where all soldiers start shooting like crazy at the invisible target with their M16s/M60s, which could be good for cover-fire situations.
Indeed, we could use such target too where insane amount of fire is put into one location. Do all the AI units then fire into the 0 elevation of that x,z position or how does it go?
The only airstrike option that im not sure about is having a plane attack an invisible target with AIM9s (Missiles)
I'm not sure how such thing would be usable... air to air missiles can be easily fired normally to enemy aircraft.

charon
Recruit
Posts: 25
Joined: 2005-09-20 15:59:19

Re: Q: Airstrike script problem

Post by charon » 2005-10-13 10:54:56

Wow thats excellent, could you please post or private message me with the config.cpp part for this invisible object?

Indeed, we could use such target too where insane amount of fire is put into one location. Do all the AI units then fire into the 0 elevation of that x,z position or how does it go?

I'm not sure how such thing would be usable... air to air missiles can be easily fired normally to enemy aircraft.
Sure, i will PM you the thing later.
Well the trick is that as long as the invisible target is mounted
by an enemy AI friendly infantry will consider engaging it.
The factors that finally makes them attack the target is a mixture of the target's armor value in relation to the cost of the friendly units ammunition. They will fire at a point called "Zamerny" in the model's memory LOD which can be where ever you put him, even far away from the actual geometry. I will have to work on this, so the target may never be actually destroyed.
Also one thing that needs tweaking is the actual distance of the target to the friendly units. If it's too far away then they won't fire on it atm. (That's only for the infantry version, the air-target version is always fired at)

Charon

Snoutmaster
Newbie
Posts: 2
Joined: 2005-11-18 03:01:42

Re: Q: Airstrike script problem

Post by Snoutmaster » 2005-11-17 23:09:22

Ive managed to change the plane in the LCD airstrike sript but I want to add the Chain of command Napalm to explode. I can get the coc_mk77napalm to drop alright but I can't seem to get Bombs to to arm and detonate they just fall on the ground and wobble around. How can I get the Napalm to detonate when they drop?

Snake_Man

Re: Q: Airstrike script problem

Post by Snake_Man » 2005-11-18 00:29:34

How can I get the Napalm to detonate when they drop?
I dont remember/know that, but soon we'll put out the airstrike script with demo mission by Charon. That with the invisible targets make real nice airstrike feature to VTE and you do not need any old scripts anymore. Just hang on little while longer and its solved.

User avatar
Polish_GI
2nd Lt
Posts: 99
Joined: 2005-09-18 22:16:59

Re: Q: Airstrike script problem

Post by Polish_GI » 2005-11-18 02:12:51

How can I get the Napalm to detonate when they drop?
I dont remember/know that, but soon we'll put out the airstrike script with demo mission by Charon. That with the invisible targets make real nice airstrike feature to VTE and you do not need any old scripts anymore. Just hang on little while longer and its solved.
Can't wait to see it!  Do we know if there will be different types of strikes (e.g. helo strafing, bombs, napalm etc)?  Any ability to swap in and out the different aircraft?

Eagerly awaiting...

Snoutmaster
Newbie
Posts: 2
Joined: 2005-11-18 03:01:42

Re: Q: Airstrike script problem

Post by Snoutmaster » 2005-11-18 04:01:42

OK Ive managed to work on this script by Skumball that changes the plane to the A1 raider and drops the Mk77 Napalm Bomb. It seems to work ok but when the bomb explodes and detonates its doesnt have that Napalm effect as if they had been fired manually. How can I get the Napalm scripts to work with this script so I get a real fire napalm effect.

Code: Select all

OK Ive managed to work on this script by Skumball that changes the plane to the A1 raider and drops the Mk77 Napalm Bomb. It seems to work ok but when the bomb explodes and detonates its doesnt have that Napalm effect as if they had been fired manually. How can I get the Napalm scripts to work with this script so I get a real fire napalm effect.

[code];Airstrike (map click) v1.2
;by Skumball 
;Thanks to Viriato for making the bombs fall correctly and LCD for incorporating the script into the radio
;Requires:
;OFP v1.85
;1 Pilot named "strikePilot"
;3 Markers ("spawn","safe","target" all set to 'empty')
;1 Trigger (Activation: Radio Alpha, Repeatedly. Text: Air Strike. On Activation: onMapSingleClick {[_pos] exec "airstrike.sqs"}; strikePilot sideChat "Give me a target")
;Have a look at the sample mission to see how it works
;Change the value of _num, *0.2 and ~0.2 for different results

onMapSingleClick {}
1 setRadioMsg "Null"

_pos = _this select 0

"target" setMarkerPos _pos
"target" setMarkerType "destroy"

strikePlane = "VTE_RaiderCAS" createvehicle (getMarkerPos "spawn")
strikePlane setPos [(getPos strikePlane select 0),(getPos strikePlane select 1),(getPos strikePlane select 2)+800]
strikePlane setDir 180

strikePilot assignAsDriver strikePlane
strikePilot moveInDriver strikePlane
strikePilot doMove _pos
strikePilot sideChat "On the way"

@ unitReady strikePilot
strikePilot sideChat "Target aquired"

_num = 4
_i = 0

#loop
_bomb = "VTE_MK77" camCreate [(getPos strikePlane select 0)+((random 10)-5),(getPos strikePlane select 1)+((random 10)-5),(getPos strikePlane select 2)-3]
_bomb setDir (getDir strikePlane)
_bomb setVelocity [(velocity strikePlane select 0)*0.2,(velocity strikePlane select 1)*0.2,(velocity strikePlane select 2)*0.2]
_i = _i + 1
~0.2
? _i < _num : goto "loop"

strikePilot doMove (getMarkerPos "spawn")
strikePilot sideChat "Heading back"

"target" setMarkerType "empty"

@ unitReady strikePilot
deleteVehicle strikePlane
strikePilot setVelocity [0,0,0]
strikePilot setPos (getMarkerPos "safe")
strikePilot sideChat "Ready"

1 setRadioMsg "Air Strike"

exit

Post Reply

Return to “Vietnam: The Experience (OFP)”

Who is online

Users browsing this forum: No registered users and 15 guests