Helicopter Scripting 101
Published : September 23, 2003
Feedback : Here
Reference Links : Original Tutorial

Island Thunder has given us some pretty cool options in the Ghost Recon game. First and foremost is helicopter insertions via the MH-60K. What you need to know is that the helo AI is practically retarded. Yes, the 160th SOAR is pretty well known for thier expertise in the SOF community. Well, the programmers didn't transfer that to the AI. You can have a green Russian soldier pick you off with the most inaccurate weapon from 5 miles away, yet the helos are stupid. So what do we do? Treat them like thier retarded.

The Movement Plan

Pretty much, they should fly in a straight line. Open up any mission that was in Island Thunder that did have these insertions, and you will see, they fly straight. Not too bad, as really they shouldn't do much, as it's just inserting you. However, if you want to add some creativity to their flight, then that's the hangup. Scripting an insertion in Igor goes something like this:

Insertion Helo Plan:
Speed (10m/s+ usually works best)
Path (always apply the altitude or it will roll on the ground)
Unload Vehicle
Wait (3 to 5 seconds is okay)

And so on. Generally this is a typical insertion path for a helo. This is how the initial mission in Island Thunder, and subsequent missions works. It's easy, and doesn't require you all the time to use the "ExecutePlanVehicle" script in Igor. This is what the helo does anyways, so it will automatically follow it.

Loading Em Up

Naturally the other cool part is that you can be transported in the aircraft. Doing this requires this in the script block:

VehicleLoadPlatoon (select any Platoon - up to six personnel of course - including yours)
PlatoonAIOff (Player Platoon, etc.)

"PlatoonAIOff" is required, or else the platoon won't enter or exit the helo, as the program makes them get out (as well as you if not using cinematics). Once loaded/unloaded, the vehicle takes off and continues mission. Note that you can still fire from a helicopter. It is possible, but with the AI off, you can't reload. So make sure when designing a mission, or that you're a good shot yourself (or have a large ammo capacity, leave it on single shot, etc.). Once on the ground however you can change magazines, or for that matter, select another weapon. Note that if you try to select a weapon while flying, once you hit the ground, it will do that, so remember to select (or not select) as it may leave you short. Everything is pretty much turned off, except your trigger finger of course.

A View To Kill

Forget about launching rockets too. Common sense issue really. Note that the Blackhawk has six passenger spaces. The actual one can carry a total of eleven, but this is Ghost Recon, not the real world. What this means is that you can add other members of a Platoon up in your chopper. Just remember though. If you have to extract two personnel, you have to leave two spots open, i.e. you can bring a total of four or less personnel, which may be a detriment, but still, requires you to make do with what you have. Such is life eh?

One note about loading your Platoon up in the helo after your mission. Death of a teammember is not something good, but sometimes you don't want to be reminded. I guess the mission designers took the Blackhawk Down axiom "No one is left behind", because your dead teammates will be taken along, as per this picture:

They'll be stuck in their death pose, and will be in some position, and just generally not work. It also looks pretty odd for that matter too. But that's just something to note. Hopefully they'll figure some way of getting rid of that. However, have to deal with it.

Note that they have to land generally level in order to extract. Thus make sure that it lands almost perfect. It can be cocked a little to the left or right and you will still loadup. Taking off may be a problem, as it might not. Get my drift? They're retarded. Also, when assigning paths, it's generally good to allow them to dissapear as if you let them fly around, then they will fly in a circle around the map, to your consternation, as they probably would foil any carefully planned mission. Also ensure you test this so it's what you want, as it will take some time just figuring it out. And take note that one small detail can mess up the whole thing. One mission I've designed had me going back and forth, until I figured out the initial speed must be 10m/s, or else I wouldn't exit the helo. Go figure.

One other thing to note is that timing is critical (to the second) on when you allow your teammates (or other actors) to think again. Generally this can be achieved through a simple timer ("Platoon uses it's head", etc.) or TimeElapsed is also a good one. Just include the "PlatoonAIOn" in your block, and you'll be good to go. Though for realism sake you can set it a couple seconds after your helo takes off, your team can freely move about.

Extract helicopters is simply another helicopter set up to be that, just an Extract bird. Nothing wrong with that, just more or less prior planning.

Additionally, the "VehicleLoad Platoon" transports you to the inside of the helo wherever you are. You could be 20 miles away, and still load up fine. Generally for scripted extractions like this, it's good to set a Timer to when this happens, to produce a "realistic" effect, or "ProximityPlatoon" with "VehicleLoadPlatoon" so when you get such and such distance, you will be loaded, and you will be extracted. Just remember to add "PlatoonAIOff" or they will be standing up, scanning the area just as if they weren't inside the helo.

This obviously can be done for other units as well. Say you want to have some other teams as part of a larger operation within the scope of the mission. Same process, just place the soldiers near the helo (really doesn't matter, it's just convenient), and do the same, and it will work. One thing to also do for start positions is to use a Special Effect (Misc/Special Effect). This requires you to set the Z (vertical) axis to where the helo will appear, and start from. So for an example, scripting will go like this:

Transport Insertion Helo to Start Pos (TeleportObject)
Load Player Platoon into Insertion Helo (VehicleLoadPlatoon)
Turn Off AI for Player Platoon (PlatoonAIOff)

Just remember to completely ensure everything is correct, and just for general purpose, place it high in the sky. This allows it to fly and land. Pretty simple once you get the hang of it. Note that "TeleportAirVehicle" so far hasn't worked out for me yet. I have only used it a few times, and no success, so I won't touch that. However, there isn't any reason why you can't include other helos(Harntrox Desert Assault, Free Libya! are two good examples).

"Advanced Scripting/Planning"

So you want to do something more than just have it drop you off and fly away? It's doable, just requires some patience in this regard. Again, treat it as retarded. This requires some attention to detail, as far as where it stops and where you want it to land, such as "Have helo insert team to Area X, then fly to Spot A, where once mission is complete, fly to Spot B for extract". Multiple Plans and patience, as you have to ensure that it doesn't fly into something like a mountain, and get stuck in it, where you can't extract. On some maps it's a no brainer, but some of the Desert Seige ones will have you biting nails. That's why I don't worry about clipping mine :) But again, attention to detail is important, as well as constant back and forth through Igor to the game, then back, and back, until it's what you wanted. Just make sure you can live with it, as one small addition, will mess it up to where you pretty much have to start over again.

Another technique is to have it hover in the air. That's easy. Have it fly a route, then put "Wait" at the end (I had it go for 600 seconds/10 minutes, then once I accomplished a test objective, it landed, which in itself required some time). Good for airborne sniping missions or whatever else strikes your fancy. Then when some event happens, accomplish Objective A, something is there, etc. Set up another plan to have it land. Now for you to exit, you have to make it take off. Unfortunately the designers didn't think that this could happen, but it did. Make sure you note the area where the helo stopped, then place where you want it at, and viola, it will land, drop you off, and fly away. Just remember though: The AI is retarded

Comments? e-mail me!

Compiled by: Ruin

© GhostRecon.net