Jump to content
Sign in to follow this  
Gil Galvanti

Making AI Land on LHD

Recommended Posts

Hey, I've searched for quite a while and can't find anything on this...

What is the best way to script a helicopter landing on the LHD?

The AI seems afraid of the LHD, it's very annoying considering most of my mission takes place on it, and the AI randomly decides they don't want to follow your commands (as simple as walk to a location on the LHD), or get any closer to the LHD than they are. For all that ArmA 2 does right, they really need to work on pathfinding, and have needed to since ArmA 1, so I'm not sure why it doesn't seem to have improved.

Anyways, I'm a decent scripter, but I'm lost on how to make an AI chopper land on the LHD.

Share this post


Link to post
Share on other sites

I hesitate answering this, because I'm such a noob...but, what about setpos an invisible "H" at the desired spot on the deck,along with the correct height, so that the script is pointing to that specific spot. Give that a shot if you already haven't and pls report back whether it worked or not. I'm very interested in finding out.

Good Luck

Share this post


Link to post
Share on other sites

You mean like a marker on the flight deck? Or is there something that has 3 dimensions (not sure what you mean by "invisible H" ;)) that I'm not thinking of? I'm trying a marker now, but that's the annoying part-the chopper doesn't want to go to the exact marker, it wants to go about 20 or 30 meters short of it, which is a big difference when you're trying to land on something 10 meters wide. It works if I put the marker 20 or 30 meters farther, but the problem is that then it won't work for coming from another direction, and I just had to put a trigger over the area and use "chopper flyInHeight 0" to make it land when it activated the trigger. I'd like to find a better, more dynamic and efficient solution than this though ;).

---------- Post added at 03:53 AM ---------- Previous post was at 03:16 AM ----------

Gah, this is so frustrating, I can't even get it to work under controlled circumstances because the dang helicopter decides it wants to go exactly to the marker one time, and then the next run of the mission (with absolutely no changes) it decides it wants to go 10 meters short. Freaking ridiculous and frustrating.

Share this post


Link to post
Share on other sites

search for "Mando_Heliroute"

It is for Arma 1 for I think it still works in Arma 2

Share this post


Link to post
Share on other sites

AI cannot land on the carrier deck unless you force it too. I've only succeeded with heavy (and rather clumsy) scripting. This is how I did it.

1) Give the helicopter an inflight route so that it approaches the LHD from the bow (the fore deck is much longer than it's aft counterpart).

2) When the helo approaches it's speed mode must be set to LIMITED and it's flyInheight to aprox. 20 meters. I then gave it a move command sending it to a gamelogic placed near the stern of the ship. The marker must be placed very far back, because helo's don't travel all the way to target before they consider a waypoint or move command to be completed.

3) When the move command is completed the helicopter will stop and hover somewhere over the fore deck. The exact position may vary a little. Hence the use of the longer landing deck.

4) I now give the helicopter a flyInheight 0 and it will lower itself on the deck. Not very gently though. Sometimes it smashes into the runway too hard. So I give it an allowDamage false during the critical manuever.

Voila! Your helicopter has landed on the front deck. I implemented the technique in an early version of the mission Dungeon & Dragon. The mission is unfinished and WIP, but the landing part should be working in the linked download. Bear in mind though: It's not a pretty script. If you wan't a clean and simple code you will have to look elsewhere.

Share this post


Link to post
Share on other sites

Ahh, but this thread is different from all the others. Because this one has a solution to the problem. Albeit a clumsy one :)

EDIT: Maybe they should be merged into one.

Share this post


Link to post
Share on other sites

@nominesine: Thanks, I was in the process of doing something like that, which was half working, but the problem was that I wanted it to land on the helopad, and it would sometimes miss by a few meters (which could make a big difference on the side of the LHD).

@mankyle: Thank you! That is exactly what I want :).

Share this post


Link to post
Share on other sites

Don't thank me

Thank the allmighty Mandoble, whose untold scripting power has provided this community with oncountable hours of diversion

+1 to Mandoble :yay:

Share this post


Link to post
Share on other sites
Don't thank me

Thank the allmighty Mandoble, whose untold scripting power has provided this community with oncountable hours of diversion

+1 to Mandoble :yay:

Many Thanks I have been looking for a way to land Helo's on the LHD. Hopefully Mandoble will convert his other amazing scripts to ARMA2.

Share this post


Link to post
Share on other sites
Many Thanks I have been looking for a way to land Helo's on the LHD. Hopefully Mandoble will convert his other amazing scripts to ARMA2.

Does this script (the Mandoble heli precise landing one) work with Arma2 at the moment? If so, can someone explain how to implement it in an Arma2 mission? (I mean, I know that the files need to be in the mission's folder and all, but when I set it up as expected, it didn't work.)

Edited by Lucky44

Share this post


Link to post
Share on other sites

right before the heli lands a message pops up on my screen saying script mando_heliroute_arm.sqf not found, and then the helicopter just hovers like it always does.

---------- Post added at 03:28 AM ---------- Previous post was at 03:23 AM ----------

i may just be doing it wrong though...this is what i have in the waypoint condition column

xxx = [hawk01,[getpos dest1],30,true]execvm"mando_heliroute_arma.sqf"

Edited by islesfan186

Share this post


Link to post
Share on other sites

Probably im doing something wrong, It didn't work for me, any ideas?

Thanks....

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  

×