Jump to content
Sign in to follow this  
Raziaar

Helicopter flight/loading problem

Recommended Posts

Hello!

I am trying to make a trigger so that the helicopter of my designation flies to the players position via a radio command, which is easy enough and he does exactly that.

But once he gets there, I'm trying to find a way that I can get him to activate the *land "LAND"* option or anything similar. How would I go about doing this? I can only get it to do stuff right when the trigger goes off, not when the helicopter gets to his targeted position.

Also, I can't find any scripting commands to have the helicopter do other things other than move to a location? For instance, I can't have him do a LOAD or UNLOAD like I can making the waypoints in the mission editor itself?

I apologize for the noobish question. Just trying to make it dynamic and I am finding myself unable to do so. I want the helicopter to go to the players position(which I can and know how to do), but then land to pick them up, and then fly back to another position that I designate. All that without hardcoding waypoints on the map since I want it to be dynamic.

Share this post


Link to post
Share on other sites

Place an invisible helipad at the place your waning him to land....that should do the trick...be sure to place your waypoint over the helipad.

Share this post


Link to post
Share on other sites

That's not exactly what I want. I don't want any one specific place or places for him to land. I want him to be able to make a combat pickup, so that I can order him to fly anywhere that the player is and land once he reaches that destination. Therefore I can't have any static waypoints in game since his movement and landing location will be entirely dependent on where the player currently is on the map... which may be way far away, or may be near the helicopter.

I solved it! Of course I need to finalize it and clean it up to make it more efficient, but for now I solved it.

First I have the helicopter which has an activation of: inFlight = 0

Then I have a trigger set to a radio command, which has the activation of: heli move position player; inFlight = 1

Lastly, I have another trigger that has a condition: if inFlight == 1 AND heli unitReady

with activation heli land "LAND"

The helicopter will fly to me wherever I am, and pick a suitable landing spot. If there's a helipad around, he'll fly out of his way to that, which is not something I like, but I guess its part of his best landing position routine. I wish I could make him land exactly where the player coordinates were, but I don't know how to do that. I suppose I could find a way to generate an invisible landing pad wherever the player position is when he activates the trigger, and somehow delete it after the player is picked up. Don't know much about invisible helipads yet though.

Anyways, I'm open to suggestions on how I can remove the inFlight variable from the mix and still have it work.

ANOTHER EDIT: Got it all perfected and worked out all the kinks. I've decided having the helicopter land where he chooses to in the vicinity of where the player requested is more realistic as it is up to the pilots discretion. My player can be anywhere on the map, even on top of a mountain, and call in the chopper. The chopper will take off from base and fly en route to the player, of which the player can re-update the landing coordinates if he has moved by doing the radio command again(which can easily be disabled). The chopper will land/hover with the rotors still going, and once the player is inside he'll take off and fly back to base(which is designated by an invisible helipad). Upon reaching base, he'll land while shutting off his engine and the player is then safely at base, ready to go back out again if needed.

If he hops back in the chopper, nothing happens. It'll require the player to be out somewhere again and use the radio command for the chopper to come to his rescue once more.

I simplified it into 3 triggers.

Helicopter Initialize: inFlight = 0; safeLand = 0;

*First Trigger*

Bound to Radio Command

On Activation: heli move position player; inFlight = 1

*Second Trigger*

Condition: inFlight == 1 AND unitReady heli

On Activation: if (safeLand == 0) then{heli land "GET IN"}; if (safeLand == 1) then{heli land "LAND"; inFlight = 0; safeLand = 0}

*Third Trigger*

Condition: player in heli AND inFlight == 1

On Activation: heli move position safeZone; safeLand = 1

That's all there was to it to solve my problem. Woo! Pretty good I think considering I only started OFP scripting today. I think maybe to spice things up a little bit I'll have an attack chopper accompany the transport or some other fun thing.

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  

×