Karlos 0 Posted October 17, 2002 Guys, Could someone tell me if the following is possible. I want to be able to call in an airstrike from a radio command, however I want the planes to only appear on the map when the radio call goes out, and I only want them to destroy targets I designate (with the laser designator) Please tell me if this is possible, and where to start on doing this (Been out of the OFP arena for sometime now and things have changed A LOT! Karlos Share this post Link to post Share on other sites
InqWiper 0 Posted October 17, 2002 I think LGBs wount bomb anything but the laser dot. Here is an example on how to make them appear when U call them in: Place the plane as far north as you can (it has to be set to "flying"). I think giving it a waypoint to open fire and engage at will just infront of it will help later when its supposed to attack the laser target but Im not sure. The plane is supposed to be pointed to the north so it exits the map area as soon as the mission starts. Make a trigger activated by radio and in the On Activation field you type: MyPlane setpos [getpos player select 0,0] This will make the plane start from the bottom of the map and fly past your position hopefully spotting the laser target. Im not 100% sure of anything but I think this should work (havent tested it). Share this post Link to post Share on other sites
Karlos 0 Posted October 18, 2002 Thanks for your reply InqWiper, Unfortunately I have enemy aircraft on the map too, and the first thing they do when patrolling is shoot down the aircraft I want to call in as airsupport. Also, depending on when I decide to call the airsupport in, the aircraft could run out of fuel!!! When I was last mission building I'm sure someone created a spawn vehicle script, but I can't find anything on it with a search.... :/ Please help! Karlos Share this post Link to post Share on other sites
Karlos 0 Posted February 20, 2003 C'mon you guys... Someone must know the answer to this! Share this post Link to post Share on other sites
Guest Posted February 20, 2003 Try looking up camcreate Share this post Link to post Share on other sites
InqWiper 0 Posted February 20, 2003 try removing its cannon and see what happens. this removeweapon "MachineGun30A10" Share this post Link to post Share on other sites
Karlos 0 Posted February 20, 2003 Thanks again Inq, However it seems LGB is fine. The main problem I'm having is with the spawning of the plane on radio command. What's the camcreate command all about? Karlos Share this post Link to post Share on other sites
InqWiper 0 Posted February 20, 2003 Dont use camcreate to create units. It didnt work the way I sayd with setpos? Place a plane in the editor in the north and make sure its flying and facing north. Then make a trigger activated by radio and put this in the On Activation field: Plane setpos [getpos player select 0,0];Plane domove getpos player This should work because I just tried itand it worked without any problem, the plane passed over my position about 15 seconds afterI used the radio. Share this post Link to post Share on other sites
dinger 1 Posted February 20, 2003 No creating plane necessary. Decide on a single airstrike vector (say: 360, due N). Put the plane (name it myplane) on an edge of the map so that it is facing that vector, but heading away from the map. (so, in our example, the aircraft would be facing N (set to special/flying), along the N edge of the map. Give it a waypoint along that vector, about 500m away, so the plane does not have to turn to hit it. (so we'd have at the very north edge of the map a waypoint 0). In the condition field of the waypoint, put "AirstrikeCalled" In the on activation, put </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE"> MyPlane setbehaviour "CARELESS"; inboundvector = getdir myplane; inboundrange = 4000; InitialPoint = [(getpos player select 0) + (inboundrange * (sin (inboundvector+180)), (getpos player select 1) + (inboundrange * (cos (inboundvector+180)), getpos myplane select 2]; myplane setpos initialpoint; myplane domove getpos player; myplaned sidechat "SIDECAR 10, THIS IS BENGAL 33, LASER ON, OVER" <span id='postcolor'> Share this post Link to post Share on other sites
InqWiper 0 Posted February 20, 2003 I thought my way was simple enough. Share this post Link to post Share on other sites
Karlos 0 Posted February 20, 2003 Inq, Your way works fine. Sorry. However, the plane won't bomb targets that I designate with the laser designator. the plane is a standard A10LGB and the player I'm using is a Spec Ops with Laser Desig. I paint the target well in advance of the plane arriving, yet it just flys over first pass, then turns around and starts opening up with it's guns... totally ignores the designator... does this bloody thing actually work!?!?! Share this post Link to post Share on other sites
dinger 1 Posted February 20, 2003 Hmmm I should add that the radio command needs to set AirstrikeCalled = true Your way will work fine InqWiper, but: With the AI, flight model and the waypoint systems as they are, if the aircraft makes a turn away from the waypoint, it will end up flying in circles, trying to hit that domove waypoint. enemy airborne threats can cause this problem. Â If you start from the edge of the map, (y=0) you can if the problem is other air traffic, you need to set the behaviour to "Careless" to minimize the chance of an unintended consequence. Â If you still get problems, reduce the engagement distance. In the end, getting fixed- and rotary-wing aircraft to work right in OFP is a black art. What's happening is that the A10 is not seeing the Laser Designator dot in time. Â If it does see it, it prioritizes it above all other things. Â At least that's how it should work. first, try the trick of removing the cannon30 rounds (or the whole cannon) from the plane. If you still have trouble, make a trigger, radius 2000m, called "laserdetect", set to Anyone/present/repeatedly. In Condition put: this && "LaserTarget" CountType ThisList > 0 In On ACtivation: LaserOn = True; {Format ["LaserTarget%1 = _x", "LaserTarget" CountType [_x]]} ForEach ThisList In On Deactivation: LaserOn = False When Airstrike is called, setpos laserdetect getpos player and fire up a little script when the airstrike is called [mya10] exec "pavepenny.sqs" pavepenny.sqs _a10 = _This select 0 #revealloop ~.1 ?LaserOn:_a10 Reveal LaserTarget1:goto "revealloop" @LaserOn goto "revealloop" easy, huh? Share this post Link to post Share on other sites
Karlos 0 Posted February 21, 2003 Er yeah... easy... Heh, thanks Dinger will try that tommorow as it's gone midnight here in the UK and I'll end up waking up my wife and son with the explosions! Karlos PS - must invest in some headphones... Share this post Link to post Share on other sites
Karlos 0 Posted February 22, 2003 OK Dinger, Two things I'm stuck on.... when I put it in the activation field of the trigger, this doesn't work setpos laserdetect getpos player I get a "Unknown operator laserdetect" error. Also looking at the script where you have reference to _a10. Do I need to replace this with the name of the unit? Thanks, Karlos Share this post Link to post Share on other sites
Lt_Damage 0 Posted February 23, 2003 Hmm, managing aircraft in OFP is always tricky. For making sure the A10 reaches it's target without engaging, and also saving the A10 from existing before its needed (saves scripting refueling), you are best to create it when it's called by radio. I am at work so this will be a script based on theory: </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _A10 = "A10" createVehicle getmarkerpos "StartPoint"<span id='postcolor'> Creates the A10 at marker "StartPoint" </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">_A10 setpos [getpos _A10 select 0, getpos _A10 select 1, (getpos _A10 select 2) +400]<span id='postcolor'> this sets the newly created A10 400m up in the air, probably starts to freefall right about now Now you need to create a pilot : </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _pilot = "SoldierWCrew" createUnit [getMarkerPos "barracks", groupAlpha,"_pilot MoveinDriver _A10;_pilot action ["engine ON", _A10]", 0.5, "MAJOR"]<span id='postcolor'> You'll need a marker called "barracks" Edit: I forgot you might want to get the pilot to turn the engine on once he is in the A10, have modified the init. Now for telling the pilot what to do once he finds himself in the world and in an A10: Create a unit, pilot, whatever, give him a waypoint to your bombing destination, basically give him the info you want the A10 pilot to do. Now in the init put: groupAlpha = group this;deleteVehicle this Now this will mean he won't physically exist when the mission starts but his waypoint info and grouping will still remaining, so when the pilot is created into groupAlpha the pilot will follow the waypoint. Now the problems I forsee for this are going to be in the naming of the A10 and the pilot, whether a script can be made so that the A10 is given a proper name after it's created so that in the pilot's INIT it can MoveInDriver NAME, that part is the flaky part. I'm sure someone can give tips on that. Share this post Link to post Share on other sites