Home   Help Search Login Register  

Author Topic: Need help with an airstrike script  (Read 2121 times)

0 Members and 1 Guest are viewing this topic.

Offline Jester_UK

  • Members
  • *
Need help with an airstrike script
« on: 23 Mar 2007, 17:49:09 »
I need a script to spawn a Harrier on a radio call trigger, have it join the player's group and attack the target the player is marking with a laser designator.

(I've heard the only way to get an aircraft to respond to a laser designator is to have it in the same group as the unit with the designator. But in the mission I have planned the need for the airstrike will most likely happen near the end and as such I don't want the Harrier floating around for 30-60 minutes)

If possible I'd like it to work in either SP or MP.

I've tried everything I can think of but I'm getting nowhere (unfortunately after three days of constant frustration I went and scrapped everything I'd done..... which was pretty silly of me to say the least!)

Does anyone have a script like this, or know how to set it up?

Offline sharkattack

  • Former Staff
  • ****
Re: Need help with an airstrike script
« Reply #1 on: 23 Mar 2007, 20:06:49 »
maybe this will help
http://www.ofpec.com/forum/index.php?topic=28804.0
creates harrier  .... maybe have him join youre group on spawn instead of dummy
ignore the bombrun sqs   ... try having him spawn into youre group
"HOLY SARDINE" - see Shark-Attack meet his match

Offline Jester_UK

  • Members
  • *
Re: Need help with an airstrike script
« Reply #2 on: 23 Mar 2007, 20:35:43 »
Thanks Shark.

I'd actually tried modifying your mission before as a base to start from but had no luck with it. Reading through the thread you linked to though, I've just come across something I think I missed previously regarding the pilot.

I'll give it another go and let you know what happens.


EDIT:

Tried it again. No luck. No matter what I try as soon as I alter the script, although no errors are reported, the Harrier just crashes into the sea. At best I get the pilot screaming "where are you?" and slowly swimming towards my position! Looks like the pilot is not getting into the Harrier. No idea why.

I could really use some help with this one guys.
« Last Edit: 24 Mar 2007, 14:01:29 by Jester_UK »

Offline sharkattack

  • Former Staff
  • ****
Re: Need help with an airstrike script
« Reply #3 on: 25 Mar 2007, 16:20:34 »
post  the modified script  or better  a small demo ... 
you have named pilots and harrier ?
"HOLY SARDINE" - see Shark-Attack meet his match

Offline Jester_UK

  • Members
  • *
Re: Need help with an airstrike script
« Reply #4 on: 25 Mar 2007, 20:55:06 »
I'm pretty sure it's something stupid. I'll freely admit I'm a complete newbie at scripting.

Regarding naming the pilot and Harrier, I basically copied most of it from your original script, except I added a couple of extra commands and changed the group name to "Alpha." So there could well be a stupid mistake here, but I can't find any reference in the Wiki as to how to set it up differently.

In the mission itself, the player is named s1 and I added Alpha= groupthis in the player's init line.

The script as it stands is as follows:

Code: [Select]
veh = createVehicle ["AV8B", position startpoint, [], 0, "FLY"];

"SoldierWPilot" createUnit [position veh, group Alpha,"this moveindriver veh; veh setdir 80; veh flyInHeight 100; doMove getPos s1;"];

~240
deleteVehicle veh;
exit

Since I can't even get this part right, I can't get any further with it.


Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Need help with an airstrike script
« Reply #5 on: 25 Mar 2007, 22:23:18 »
Code: [Select]
; doMove getPos s1;
Seems you are missing the unit you want to move to s1.

Offline Jester_UK

  • Members
  • *
Re: Need help with an airstrike script
« Reply #6 on: 26 Mar 2007, 00:13:06 »
Thanks Mandoble.

I tried adding veh in front of the commands you noticed (bearing in mind I'm new at this, it seemed logical to try that since that's what's infront of all other commands in the array).

Still no good. Harrier just flies into the ground. I moved the startpoint around the map till it crashed almost at my feet. No pilot in Harrier. I then searched the island from my location to the spawnpoint. No sign of a pilot's body. I assume that for some reason the pilot's not spawning at all.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Need help with an airstrike script
« Reply #7 on: 26 Mar 2007, 00:33:44 »
Code: [Select]
westgrp = createGroup west
bomber1 = createVehicle ["AV8B", getPos bomberstart, [], 0, "FLY"]
"SoldierWCrew" createUnit [getPos crewstart, westgrp,"this setBehaviour ""CARELESS"";bomberman1 = this;this setDir 270;this MoveInDriver bomber1", 0.6, "private"]
~1
bomber1 setDir 270
_dir = getDir bomber1
bomber1 doMove [(getPos bomber1 select 0)+Sin(_dir)*7000,(getPos bomber1 select 1)+cos(_dir)*7000, 100]

bomberstart and crewstart are gamelogics placed on the map. The doMove just send the harrier 7000m ahead of its starting position.

You may see that in action here, in the intro's Airborne standoff attack demo.

Offline Andurus

  • Members
  • *
Re: Need help with an airstrike script
« Reply #8 on: 26 Mar 2007, 00:45:31 »
Hi, First post here.

Using shark attacks mission as the basis I simply deleted the civilian 'red' all the way to the NE, then renamed the player 'red'. Then removed the first line in the harrier.sqs that states 'red setdamage 1'. So now you won't die when calling in the airstrike.
The harriers then join once they have spawned.

Hope this has helped
« Last Edit: 26 Mar 2007, 20:58:39 by Andurus »

Offline sharkattack

  • Former Staff
  • ****
Re: Need help with an airstrike script
« Reply #9 on: 26 Mar 2007, 17:13:58 »
red in the corner is the unit the harrier joins on spawning   ..
he  is located there  just to provide a waypoint for harrier .. he can be moved ..
setting his dammage to 1  simply removes him from the map  but leaves the waypoint
for the created  harrier
"HOLY SARDINE" - see Shark-Attack meet his match