Jump to content
Sign in to follow this  
polygonpusher

Sending Helicopter group to specific helipads

Recommended Posts

Evening all...

When a group of helicopters are instructed to land, they often jostle about for a landing position and end up running into each other - or not landing at all.

To solve this I'm trying to send each helicopter in the group to its very own specific helipad.

Unfortunately the scheme below still does not work, they continue to land wherever they see fit - or attempt to land at the same place at the same time.

(See link below for editor and scripting diagram)

http://www.mediafire.com/i/?o7fmxz17urczkfu

Does anyone have any suggestions? I'd be grateful to hear them!

Thank you so much.

Happy Editing!

Share this post


Link to post
Share on other sites

Well, I could do that, and it work work but I really wanted to keep them in a cohesive group.

Is there no other way?

Share this post


Link to post
Share on other sites

Just wrote a small script. My GFX card is fried, so I haven't tested it. It's just off the top of my head.

No idea if it'll work.

It basically makes the three choppers fly to each their landing spot, and when a chopper is ready it's ordered to land.

Btw, the land command doesn't take a helipad to land on as parameter, but rather how to land.

The parameter can be "LAND", "GET IN", "GET OUT" or "NONE".

I use "LAND" as it will make the pilot turn off the engine.

AI units lands on the closest helipad object within 500 meters, so I figured, by making them first move to the one they should land on, they must choose that specific one for their landing.

Don't know whether or not this is sufficient, but let me know.

H1 doMove (getPos L1);
H2 doMove (getPos L2);
H3 doMove (getPos L3);

sleep 1;

_choppersToWaitFor = 3;
while {_waitForChoppers > 0}
{
if (unitReady H1) then
{
	H1 land "LAND";
	_choppersToWaitFor = _choppersToWaitFor - 1;
};
if (unitReady H2) then
{
	H2 land "LAND";
	_choppersToWaitFor = _choppersToWaitFor - 1;
};
if (unitReady H3) then
{
	H3 land "LAND";
	_choppersToWaitFor = _choppersToWaitFor - 1;
};

sleep 0.1; //Don't freeze the game
};

hint "All choppers are now landing";

Edited by MulleDK19

Share this post


Link to post
Share on other sites

"...the land command doesn't take a helipad to land on as parameter, but rather how to land."

HA! I thought So! That was a point of contention I'd had with others for some time.

I'd always thought this idea of the land command using a helipad as a misunderstanding that had been perpetrated throughout the modding community.

I'm glad someone finally agrees.

Thank you for the advice and help. I'll dig into your script later today.

Happy modding!

Share this post


Link to post
Share on other sites

*Sorry I was running out the door at the time of my last post - I hope that you can replace your video card soon. It's a real bummer when things break down.

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  

×