Jump to content
Sign in to follow this  
TacoTuesday

Having Trouble getting a helicopter to Transport Unload

Recommended Posts

The situation: Upon BLUFOR being detected by OPFOR entering in a trigger, a bunch of OPFOR will load into an empty helicopter using the GET IN waypoint, take off, and fly to an invisible helipad via the TRANSPORT UNLOAD waypoint.

The helipad has in its inti line:

heli1 land "land"

the pilot has:

this assignAsDriver heli1

The squads (2 four man fireteams):

this assignAsCargo heli1

The helicopter will not land at the helipad to unload the troops. I have tried the same setup without the "assignAs" stuff which leads me to believe something is up in that area that is not letting it do what I want.

I have to specify the pilot and cargo because I want the helicopter to go do something else after it unloads, so I need a specific unit flying it. I have yet to test removing the assignascargo command to see if that works since I just thought about that as I was typing this post.

Does anyone have any ideas what could be going on here? Any advice would be appreciated.

Share this post


Link to post
Share on other sites

Do players get to see this happening?

Otherwise.

Use moveincargo, moveindriver, then assignAsdriver...

Edited by marker

Share this post


Link to post
Share on other sites

Got a team of guys starting in a MH-9, not too fussed about the automated departing bit cause it's for a co-op mission and they can figure it out. But for some reason when I use the unload waypoint it just hovers about 50 meters up. How do I get it to land, and when the team leaves a certain radius take off on it's next waypoint?

Share this post


Link to post
Share on other sites
Do players get to see this happening?

Otherwise.

Use moveincargo, moveindriver, then assignAsdriver...

Yes, players see it happening.

Transport unload is the waypoint you need...

Yes it is, but something with it is not working in this instance.

---------- Post added at 15:31 ---------- Previous post was at 14:37 ----------

Update: I attempted to give each group a GET OUT waypoint synced to the TRANSPORT UNLOAD waypoint for the pilot

Had the team leaders run toward the waypoint instead of getting in the helicopter and the helicopter still just hovering.

At this point I am really unsure of what is causing the issue.

Share this post


Link to post
Share on other sites

As far as I know there's a bug right mow where choppers wont land if enemy units are close to helipad. I have seen this happen with a blufor chopper so maybe its possible with opfor too?

Share this post


Link to post
Share on other sites
As far as I know there's a bug right mow where choppers wont land if enemy units are close to helipad. I have seen this happen with a blufor chopper so maybe its possible with opfor too?

There is nobody near the helipad.

---------- Post added at 16:13 ---------- Previous post was at 16:05 ----------

I am thinking now that because the waypoint is linked to the pilot and not the helicopter itself, perhaps the pilot does not see himself as a transport and therefore cannot complete the command? Does that sound right?

Share this post


Link to post
Share on other sites

Sounds about right.

Try using the helicopter with the pilot already in it and name the driver of the helicopter and the helicopter itself maybe? This way you can reference either the vehicle itself or it's pilot.

Share this post


Link to post
Share on other sites

UPDATE: Yes! It is due to the pilot! I gave him a "GET OUT" waypoint and he landed the helicopter and got out. I guess now I could have him GET OUT then GET IN right away. It makes the engine take a bit of a hiccup but it should be passable. But I feel like there should be a better way that doesn't have him leaving the helicopter.

Share this post


Link to post
Share on other sites

ive done it already here when u use a move for helicopter and create a helipad use

car land "landpad"; {unassignvehicle _x; dogetout _x} foreach units (name of groupleader);

The other part forces out the group well group leader and the group follow the leader so name group leader summit like james.

Edited by curtcooll

Share this post


Link to post
Share on other sites

I have a piece of code that lands the heli and turns the engine off at a specific marker.

Would that help, if so I'll post it when home.

Share this post


Link to post
Share on other sites
ive done it already here when u use a move for helicopter and create a helipad use

car land "landpad"; {unassignvehicle _x; dogetout _x} foreach units (name of groupleader);

The other part forces out the group well group leader and the group follow the leader so name group leader summit like james.

This doesn't seem to work for me, but I don't believe I totally understand what you are saying.

What waypoints should I be using to get the helicopter to the pad? Move just makes him do a flyover. The only thing that has gotten the pilot to land the helicopter is a GET OUT waypoint. When he does land, the people in the cargo area do not get out despite there being a waypoint for them to do so.

---------- Post added at 17:06 ---------- Previous post was at 17:02 ----------

I have a piece of code that lands the heli and turns the engine off at a specific marker.

Would that help, if so I'll post it when home.

I appreciate it but I don't think so. It seems to be the issue is that the commands need to be based off the pilot, but since the pilot does not have any transport capacity, the usual methods of unloading do not seem to work despite the fact he is in a helicopter.

I am thinking that perhaps something could be done with the waypoint or perhaps a trigger to force people to get out when helicopter lands from the GET OUT command, but I would not readily know how to do that.

Share this post


Link to post
Share on other sites

curtcool is right, you must use "unassignvehicle" on the squad members to allow them to disembark. They disembark with a "GET OUT" waypoint synced with the helicopter having a "TRANSPORT UNLOAD" waypoint. You should leave thep ilot in the helicopter until you get the rest of it working. Then you can move him out separately.

You MUST synchronize the squad's GET OUT with the helo's TRANSPORT UNLOAD, and you must unassign the cargo members. Also, the "land" command you posted in the very first post should get the chopper to land where you want. You might need to set the helicopter to "Never engage" or "Hold fire" or disable his targeting AI by some means.

EDIT: finally, the helicopter's pilot must be "assigned" as the helicopter driver for the waypoint synchronizations to have the proper effect. This is done with "assignAsDriver" command I believe.

EDIT 2: lastly, the "allowGetIn" command will tell an array of units that they must disembark from whatever vehicle they are in, which could be used with a trigger to accomplish your last idea.

Edited by dwringer

Share this post


Link to post
Share on other sites
curtcool is right, you must use "unassignvehicle" on the squad members to allow them to disembark. They disembark with a "GET OUT" waypoint synced with the helicopter having a "TRANSPORT UNLOAD" waypoint. You should leave thep ilot in the helicopter until you get the rest of it working. Then you can move him out separately.

You MUST synchronize the squad's GET OUT with the helo's TRANSPORT UNLOAD, and you must unassign the cargo members. Also, the "land" command you posted in the very first post should get the chopper to land where you want. You might need to set the helicopter to "Never engage" or "Hold fire" or disable his targeting AI by some means.

EDIT: finally, the helicopter's pilot must be "assigned" as the helicopter driver for the waypoint synchronizations to have the proper effect. This is done with "assignAsDriver" command I believe.

EDIT 2: lastly, the "allowGetIn" command will tell an array of units that they must disembark from whatever vehicle they are in, which could be used with a trigger to accomplish your last idea.

Idk I just can't get it to work. The helicopter is just hovering over the pad.

I have the driver assigned with that code.

---------- Post added at 17:31 ---------- Previous post was at 17:25 ----------

Where does that line even go? On the helicopter itself, the waypoint? the pad?

This is why I dropped Computer Science.

---------- Post added at 17:37 ---------- Previous post was at 17:31 ----------

Ok, yeah, I am thoroughly confused and frustrated at this point and have no idea what I am doing to make this work.

Share this post


Link to post
Share on other sites

Really the best suggestion I have is to try your above code and change "doGetOut" to a use of the "allowGetIn" command.

I believe something like :

(units group squadLeader) allowGetIn false;

that forces them to disembark. doGetOut has never worked for me either, IDK. I remember having a lot of issues with this stuff at one point too, it comes more naturally with time is all.

Share this post


Link to post
Share on other sites

OK I give up.

If someone can slap together a demo mission for this great, otherwise I am going to scrap this whole thing. I have been working on this for too long without any progress.

Thanks for the help though, guys.

Share this post


Link to post
Share on other sites

The code below sends my heli on a route to Landing zone 1. It is flown by an AI pilot, with AI Co-Pilot. The players jump on the skidboards, an addaction actually allows them to choose between 3 different landing zones.

You can see on the last waypoint, that I am using a invisible heli pad object rather than a marker to set the waypoint, hence the use of [position, LZ1]; Accompanied below by an unload transport command which kicks everyone out at the LZ..

_unit = _this select 0;
_group = group _unit;

_waypoint0 = _group addwaypoint[getmarkerpos"WP1",0];
_waypoint0 setwaypointtype"Move"; 
_waypoint0 setWaypointSpeed "full";

_waypoint1 = _group addwaypoint[getmarkerpos"WP2",0];
_waypoint1 setwaypointtype"Move";
_waypoint1 setWaypointSpeed "full";

_waypoint2 = _group addwaypoint[getmarkerpos"WP3",0];
_waypoint2 setwaypointtype"Move"; 
_waypoint2 setWaypointSpeed "full";


_waypoint3 = _group addwaypoint[getmarkerpos"WP4",0];
_waypoint3 setwaypointtype"Move"; 
_waypoint3 setWaypointSpeed "full";

_waypoint4 = _group addwaypoint[getmarkerpos"WP5",0];
_waypoint4 setwaypointtype"Move"; 
_waypoint4 setWaypointSpeed "full"; 

_waypoint5 = _group addwaypoint[getmarkerpos"WP6",0];
_waypoint5 setwaypointtype"Move"; 
_waypoint5 setWaypointSpeed "full";


_waypoint6 = _group addwaypoint[getmarkerpos"WP7",0];
_waypoint6 setwaypointtype"Move";
_waypoint6 setWaypointSpeed "full";


_waypoint7 = _group addwaypoint[ position LZ1,10];
_waypoint7 setwaypointtype"TR UNLOAD";

bird1 move (position H1);

sleep 3;

while { ( (alive bird1) && !(unitReady bird1) ) } do
{
      sleep 1;
};

if (alive bird1) then
{
      bird1 land "H1";
};

The final part of the code, send bird1 back to the main base to land and switch off engines at H1..

Hope it helps.

Share this post


Link to post
Share on other sites

Here is what everything looks like, maybe this will help:

http://i.imgur.com/JbG6ZKE.jpg

http://i.imgur.com/n75rbSk.jpg

http://i.imgur.com/HYQASI2.jpg

http://i.imgur.com/H92oSdY.jpg

What happens is that everyone runs to the helicopters as intended

helicopters fly to waypoints as intended

heli 1 (the only one I have been testing with at the airfield) will not land at the helipad unless I order the pilot to GET OUT, and even then people in cargo will not get out even if they have a waypoint to do so

What I want:

For heli1 to fly to waypoint, land, and have cargo exit the vehicle

Share this post


Link to post
Share on other sites

It can be infuriating, been there done that!

Ok, first of all.

Create a heli named bird1 on your map, make it non-playable... This sets pilots etc as AI.

Use the following code in it's init line..

_lz1 = this addaction [("<t color=""#FF3300"">" + ("Landing Zone 1") +"</t>"), "scripts\lz1.sqf", [],12, False, True];

That will add an adddaction, that will allow the player to choose what landing zone, in this case we will just give him one choice, LZ1.

Next, on your map within the editor, create an invisible heli landing pad (in editor, non-playable, then Empty, object signs, invis heli pad). Name it LZ1 and place it at your landing zone..

Next create another invis heli pad at your home base and name it H1.

Using the code here, which is also the same coda as above,

_unit = _this select 0;
_group = group _unit;

_waypoint0 = _group addwaypoint[getmarkerpos"WP1",0];
_waypoint0 setwaypointtype"Move"; 
_waypoint0 setWaypointSpeed "full";

_waypoint1 = _group addwaypoint[getmarkerpos"WP2",0];
_waypoint1 setwaypointtype"Move";
_waypoint1 setWaypointSpeed "full";

_waypoint2 = _group addwaypoint[getmarkerpos"WP3",0];
_waypoint2 setwaypointtype"Move"; 
_waypoint2 setWaypointSpeed "full";


_waypoint3 = _group addwaypoint[getmarkerpos"WP4",0];
_waypoint3 setwaypointtype"Move"; 
_waypoint3 setWaypointSpeed "full";

_waypoint4 = _group addwaypoint[getmarkerpos"WP5",0];
_waypoint4 setwaypointtype"Move"; 
_waypoint4 setWaypointSpeed "full"; 

_waypoint5 = _group addwaypoint[getmarkerpos"WP6",0];
_waypoint5 setwaypointtype"Move"; 
_waypoint5 setWaypointSpeed "full";


_waypoint6 = _group addwaypoint[getmarkerpos"WP7",0];
_waypoint6 setwaypointtype"Move";
_waypoint6 setWaypointSpeed "full";


_waypoint7 = _group addwaypoint[ position LZ1,10];
_waypoint7 setwaypointtype"TR UNLOAD";

bird1 move (position H1);

sleep 3;

while { ( (alive bird1) && !(unitReady bird1) ) } do
{
      sleep 1;
};

if (alive bird1) then
{
      bird1 land "H1";
};

You can see I have 7 markers which I use to create as waypoints within the script. The final marker, in this case WP7 is right next to the heli pad (LZ1).

The heli will then land at LZ1, unload troops and fly back to base and turn engines off..

All you have to do, is create any number of markers to fly from your take off area, to your LZ1, and name them the same as above, or change the name of them within the script...

So save this script, name it lz1.sqf and place it inside a folder named scripts within your mission folder...

Jump in, scroll wheel and select your landing zone..

That will do it mate!

Share this post


Link to post
Share on other sites
It can be infuriating, been there done that!

Ok, first of all.

Create a heli named bird1 on your map, make it non-playable... This sets pilots etc as AI.

Use the following code in it's init line..

_lz1 = this addaction [("<t color=""#FF3300"">" + ("Landing Zone 1") +"</t>"), "scripts\lz1.sqf", [],12, False, True];

That will add an adddaction, that will allow the player to choose what landing zone, in this case we will just give him one choice, LZ1.

Next, on your map within the editor, create an invisible heli landing pad (in editor, non-playable, then Empty, object signs, invis heli pad). Name it LZ1 and place it at your landing zone..

Next create another invis heli pad at your home base and name it H1.

Using the code here, which is also the same coda as above,

_unit = _this select 0;
_group = group _unit;

_waypoint0 = _group addwaypoint[getmarkerpos"WP1",0];
_waypoint0 setwaypointtype"Move"; 
_waypoint0 setWaypointSpeed "full";

_waypoint1 = _group addwaypoint[getmarkerpos"WP2",0];
_waypoint1 setwaypointtype"Move";
_waypoint1 setWaypointSpeed "full";

_waypoint2 = _group addwaypoint[getmarkerpos"WP3",0];
_waypoint2 setwaypointtype"Move"; 
_waypoint2 setWaypointSpeed "full";


_waypoint3 = _group addwaypoint[getmarkerpos"WP4",0];
_waypoint3 setwaypointtype"Move"; 
_waypoint3 setWaypointSpeed "full";

_waypoint4 = _group addwaypoint[getmarkerpos"WP5",0];
_waypoint4 setwaypointtype"Move"; 
_waypoint4 setWaypointSpeed "full"; 

_waypoint5 = _group addwaypoint[getmarkerpos"WP6",0];
_waypoint5 setwaypointtype"Move"; 
_waypoint5 setWaypointSpeed "full";


_waypoint6 = _group addwaypoint[getmarkerpos"WP7",0];
_waypoint6 setwaypointtype"Move";
_waypoint6 setWaypointSpeed "full";


_waypoint7 = _group addwaypoint[ position LZ1,10];
_waypoint7 setwaypointtype"TR UNLOAD";

bird1 move (position H1);

sleep 3;

while { ( (alive bird1) && !(unitReady bird1) ) } do
{
      sleep 1;
};

if (alive bird1) then
{
      bird1 land "H1";
};

You can see I have 7 markers which I use to create as waypoints within the script. The final marker, in this case WP7 is right next to the heli pad (LZ1).

The heli will then land at LZ1, unload troops and fly back to base and turn engines off..

All you have to do, is create any number of markers to fly from your take off area, to your LZ1, and name them the same as above, or change the name of them within the script...

So save this script, name it lz1.sqf and place it inside a folder named scripts within your mission folder...

Jump in, scroll wheel and select your landing zone..

That will do it mate!

That is a nice script and all but its really not what I was looking for.

I was moving AI into an empty helicopter, which they would then fly to a single LZ to unload, then have the helicopter fly away.

I wanted it that way because I wanted BLUFOR to have a chance to eliminate the helicopter crew before they got into the helicopter.

Share this post


Link to post
Share on other sites

taco just add me to steam curtcooll i can tell u exactly what u need to do i started scripting yesterday coz arma 3 rocks just add me and ill walk u or talk you through it.

---------- Post added at 18:57 ---------- Previous post was at 18:54 ----------

This doesn't seem to work for me, but I don't believe I totally understand what you are saying.

ok what u do is use move with

car land "landpad"; {unassignvehicle _x; dogetout _x} foreach units (name of groupleader);

if u see car land landpad when using move lands to nearest helipad you have made and then ejects the group leader which u need to name. using unload cargo does nothing i tried for hours trying to get it to unload then when i just used move created a invisble helipad and named helipad landpad and then used above int code for the way-point move.

Share this post


Link to post
Share on other sites

This is my Transport unload script. I put it in the waypoint I want to unload at and set the waypoint to transport unload.

// Script to eject a group from transport
// Place this in the init of the waypoint _x=[Group1,Vehicle1] execVM "scripts\eject.sqf";
// Where Group1 and Vehicle1 are the names of the group and the vehicle.
// hint "inscript";

if (isServer) then {

_group =  _this select 0;
_vehicle = _this select 1;

// Wait while chopper lands
sleep 20;

// Force chopper to land
_vehicle setfuel 0;

// Hoof out all passengers
{	unassignvehicle _x;
_x action ["EJECT", _vehicle];
sleep 0.5
} foreach units _group;

// Let them move away from the chopper to avoid being hit by it
sleep 3;

// Chopper Good to go.
_vehicle setfuel 1;
};

The problem is I have to set a 20 second delay in order to give the AI chopper time to land. What I'd really like is a check on the chopper height so that when it's less than 1m it ejects my group. I want this so I can eject a group of divers over water. I know it getPos command, but I can't get it to work.

Help appreciated.

--- UPDATE ----

Could also use a check for speed so it's not travelling too fast to kill my group.

Edited by Beerkan

Share this post


Link to post
Share on other sites

right ill have a go for u now mate ill set up summit and then let you know my results buddie.

---------- Post added at 20:50 ---------- Previous post was at 20:32 ----------

having posted that i just tested it and wicked mate i got it to work, what you wanna do is make a invisble heli pad in water where you want heli to drop of your guys, dont worry the heli wont go under water it will just sit on top of the water as if floating drop of your team and fly away.

so make a heli pad named water

heli land "water"; {unassignvehicle _x; dogetout _x} foreach units (cart);  Put this in the on activation of heli move waypoint that your dropping guys of to.

Then just set the speed to normal and then make another way point where you want helicopter to move to bobs your uncle. so altogether 2 waypoints one that drops of your guys and another that heads back to base.

---------- Post added at 21:25 ---------- Previous post was at 20:50 ----------

im yet to find a way for the heli to kick all units out without a landing pad.

---------- Post added at 22:05 ---------- Previous post was at 21:25 ----------

ok done it let me know what one u wanna do i made one with script that makes heli wait 10 secs and then kick you out instead of having to land without helipad.

Share this post


Link to post
Share on other sites

Hey curtcooll thanks for the reply. My helo goes for a swim with your activation trigger on the waypoint. My eject script works fine. I just don't like I having to guess the delay in the script. I always need to change it each time I change the dropoff point, as it's dependant on the AI's ability to land and the speed at which they do.

Share this post


Link to post
Share on other sites
Hey curtcooll thanks for the reply. My helo goes for a swim with your activation trigger on the waypoint. My eject script works fine. I just don't like I having to guess the delay in the script. I always need to change it each time I change the dropoff point, as it's dependant on the AI's ability to land and the speed at which they do.

its not a trigger u use a move waypoint paste that code i gave you and make a helipad invisble in water where you want guys dropped of and bobs your uncle. im working on script for you atm that will alow drop of and fly of just using waypoint. so heli waits 10 secs or whateva you want then drops guys and flies without any damage.

---------- Post added at 00:18 ---------- Previous post was at 23:15 ----------

right mate sorted i got well exactly what i think you want heli runs at fast speed then fly's above water just about few inches of water at which point it slows down then hovers a little and they jump out and then heli flys of to base. add me curtcooll to steam and ill load the map for you to test out if its what you want.

Edited by curtcooll

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  

×