Jump to content
Sign in to follow this  
Toasticuss

Transport Unload Problems

Recommended Posts

Simple heli insertion

1. Place Helicopter on map, name it heli1

2. Place troops you want to insert and use the this moveincargo heli1; in each of their init lines.

3. Hit F2 (Group) and drag a line from each soldier to the group leader (i.e. you the player)

4. Place a Helipad marker (Invisible or visible) where you want the drop off point to be.

5. Place a waypoint from Heli1 to the helipad marker and change it from 'Move' to 'Transport Unload'.

6. Add a 'Move' waypoint for Heli1 to where you want the helicopter to go after unloading.

Try the mission in the editor, when the chopper lands it will automatically kick you out, you need to give the disembark order to your squad for them to get out. You can also give the disembark order before the chopper lands. Once they are all out the chopper will take off and fly to the next waypoint. The chopper never turns his engine off as well.

Maybe you should read the previous posts before posting.

Share this post


Link to post
Share on other sites
Simple heli insertion

1. Place Helicopter on map, name it heli1

2. Place troops you want to insert and use the this moveincargo heli1; in each of their init lines.

3. Hit F2 (Group) and drag a line from each soldier to the group leader (i.e. you the player)

4. Place a Helipad marker (Invisible or visible) where you want the drop off point to be.

5. Place a waypoint from Heli1 to the helipad marker and change it from 'Move' to 'Transport Unload'.

6. Add a 'Move' waypoint for Heli1 to where you want the helicopter to go after unloading.

Try the mission in the editor, when the chopper lands it will automatically kick you out, you need to give the disembark order to your squad for them to get out. You can also give the disembark order before the chopper lands. Once they are all out the chopper will take off and fly to the next waypoint. The chopper never turns his engine off as well.

Everyone in this thread knows how to make a helo insertion. What we are trying to do is circumvent the dumb things the AI does that will ruin them.

i.e. put about 4-5 enemy soldiers within firing distance of your LZ. Run the same insertion mission 10 times. Then tell me how many times the helo even landed let alone landed smoothly.

Back on topic, I think Mando's heliroute script is something to build on. Ive been spending days trying to understand it completely so I can modify it. It essentially takes complete control over your chopper on the approach to the LZ once the helo gets reduces its speed on a approach, and will make perfect pin point landings. I imagine it can be adjusted to set the height it hovers before unloading.

My goal for it is to try and force the core script to trigger once the helo is in range of the destination, and not in range + speed. As it stands it wont kick in unless you are moving slow enough.

Ive went over it numerous times and simply dont understand, what part of the script causes the landing script to kick in.

Edited by tsd16

Share this post


Link to post
Share on other sites

Check this out for helo insertions. I put it together out of the two scripts you posted earlier. and a little modification.

Basically, (ive tested it about 20 times). What it will do is give you a smooth exit, Also, the helo will land under fire. It should hover at whatever the flyinheight is set to.

how it works:

1. Set up a trigger to execute the script (i.e. BLUFOR, present).

2. Put your helo, give it a name, place a group give the group a name move in cargo helo bla bla bla you know all that.

3. give your helo a MOVE waypoint to the trigger, not transport unload.

4. give your move waypoint a timer (Ive been testing on 40 seconds) so it will wait awhile before moving to its next waypoint.

5. give your soldier group its waypoints (get out waypoint not required).

Its obviously not super accurate, so make sure the area within your trigger radius is suitable for landing.

What it does:

once you enter the trigger radius, it forces the helo to descend, then it sets the flyinheight to hover (you can set this to whatever you want). I set it to sleep for a bit here, so as it adjusts its height your troops dont start jumping out if as its adjusting its height and kill themselves (this can be tweaked to your liking).

After it sleeps your troops will pop out one by one (1 every second roughly). So far its been pretty smooth. Once the timer is up on the waypoint the helo will exfil to its next waypoint* (asterix on the exfil when under fire 1 time out of my tests the AI went haywire and didnt move after the waypoint timer was up, hey but at least it landed, it wont happen if you arent under fire).

Some notes:

I tried just setting flyinheight only as opposed to set velocity first. It worked to a point but the helo kept moving forward, which could cause it to run into things and result in bumpy akward landings. With set velocity first, it stops, then slowly descends. Then setting flyinheight will adjust the height to what you want when your troops exit, you sleep after that just to give it a little time to adjust before the while loop executes that triggers your troops to get out.

_group = _this select 0;
_vehicle = _this select 1;
_height = (position _vehicle) select 2;
_aunits = units _group;
_j = count _aunits;
_i = 0;

while { _height > 6 } do {
_vehicle setVelocity [0,0,-5];
_height = (position _vehicle) select 2;
};


_vehicle flyInHeight 3;
sleep 8;
while {_j>_i} do
{
 (_aunits select _i) action ["getOut",_vehicle];
 unassignVehicle (_aunits select _i);
 _i=_i+1;
 sleep 1;
};

_vehicle flyInHeight 100;

Edited by tsd16

Share this post


Link to post
Share on other sites

Okay, so, I haven't tested every possible permutation of this but I found something that so far has 100% of the time solved the problem that is described in the opening post:

I trying to keep things as dirt simple as possible: What I normally do is create a helicopter, I name it something [usually something really clever like helo1], I create my group/unit I want to hop out of the helo, and I create an H (Invisible) [from the objects menu] and name it [something clever like LZ1] which I put where I want the unit to get out. [notice I haven't named my unit anything. I do have the "this moveincargo helo1; {_x moveInCargo Helo1} forEach Units Group this;" in the group leader INIT of my infantry team, but for this purpose, I don't need to name them. And I don't use a particular eject command. I have tried doing that in the past but it didn't always avoid the "refuse to advance to next waypoint" problem on the helo unload problem described.]

Now, you guys all probably know the drill, you do your fly in waypoints for your helicopters and you create a waypoint "transport unload" near the H and put into the INIT for that (helicopter) waypoint, HELO1 LAND "LZ1" and place a "get out" waypoint nearby for your ground unit. You then continue on your helicopter and unit waypoints. This was described by someone above more eloquently than I just put it.

Now, just today I was fighting with a mission I was writing that had multiple AI helicopters with various AI squads around an island to simulate an invasion. The helicopters were all stopping and not landing. When I tried it with a single helo, no problem, but multiple helos up seemed to cause problems for some reason.

Okay, here's the crazy, maddening thing that I did to solve it.

Ready.

I put the "unload transport" just a little bit PAST the H (Invisible) landing marker along the flight line. I'd been flying the helicopters from the North, traveling south and I had somewhat instinctively put it located a bit above the H. When I moved all the "unload transport" waypoints with my "helo1 land "lz1";" in it, all just south of the H, along the line of flight all of the helicopters landed properly. As a test, I kept one of the "unload transport" waypoints north of the H and it was the only helo that didn't unload.

So, look, I can't promise that all the problems people are having will be solved by this, but I've gone back and looked through missions where I had helo insertion problems and all of them had unload waypoints shy of my landing object (the invisible H). I moved the waypoint past the marker and all the helicopters are landing now.

TL,DR Summary: Try placing the helicopter unload waypoint a few meters past your landing object (usually an H (Invisible) so that the helicopter's flight path crosses over it.

Share this post


Link to post
Share on other sites

Onchas, your really onto something there, did just as you said and it works really well. Helis' hit the mark everytime, thanks for the tip !

Share this post


Link to post
Share on other sites
Onchas, your really onto something there, did just as you said and it works really well. Helis' hit the mark everytime, thanks for the tip !

Just tried this on a mission where I was always having this stupid turn around backwards landing.. Worked flawlessly! Smooth straight landing.

Share this post


Link to post
Share on other sites
Onchas, your really onto something there, did just as you said and it works really well. Helis' hit the mark everytime, thanks for the tip !

I agree, if you do this with the C130 and an airfield you will see an even more exaggerated version of it, putting the waypoint a loooooong way off from the airfield will allow the landing to happen on the first pass instead of the plane missing and taking more than one pass at it if you place the waypoint on top of the airfield.

Placing the waypoints off must give the AI more time to react and get the decision done in time to hit the spot as opposed to having to decide right on top of it.

Share this post


Link to post
Share on other sites

Here is my heli support script:

-it spawns a heli with 3 units

-finds a safe landing spot by findsafespot

-makes the heli land, and unloads units, who then join to player

-heli then moves away

There are no waypoints used, so heli will try to land in hot LZs also. If heli is damaged but units are alive, they join player.

I used many already written heli scripts, and made my version, which seems to work okay.

Maybe I can give ideas to someone else as well.

//****** variables	
_vehc1 = "UH1Y";

_spawnMarker = "insertion"; //a marker willl be needed only for direction.
_spawnDistance = 600; 
_alt1 = 40; 
_dropPos = getPos player;

//****** spawnpos	
_rDir = [player,getMarkerPos _spawnMarker] call BIS_fnc_DirTo;  //direction to the specified marker. The heli will arrive from there.
_rDir2 = _rDir + 180;
if (_rDir2 > 360) then {_rDir2 = _rDir2 - 360};
_spawnPos = [(_DropPos select 0)+(sin _rDir)*_spawnDistance,(_DropPos select 1)+(cos _rDir)*_spawnDistance, _alt1];


//******* look for safe landing spot. First at 50m, then increase radius
_dist = 50;
_lz = [_dropPos,15,_dist,22,0,20*(pi/180),0,[],[]]call BIS_fnc_findSafePos;
while {_lz distance _dropPos > _dist} do 
{
sleep 0.5;
_dist = _dist + 50;
_lz = [_dropPos,15,_dist,22,0,20*(pi/180),0,[],[]]call BIS_fnc_findSafePos;
};


_lzSpot = "HeliHEmpty" createvehicle _lz; //create invisible helipad for accurate landing
_lzadj =  [_lz select 0, _lz select 1, _alt1]; //height adjusted spot for approaching

// ****** create plane
_HeliCrew = creategroup WICT_westHQ;
_HeliP = creategroup WICT_westHQ;
_Wg = creategroup WICT_westHQ;

_Huey1 = ([_spawnPos, _rDir2, _vehc1, _HeliCrew] call BIS_fnc_spawnVehicle) select 0;
_Huey1 setvehiclevarname "_Huey1";

// ****** Split the pilot from the gunners, to allow the gunners to fire on targets of opportunity
_tGuy = driver _Huey1;
[_tguy] join _HeliP;
_HeliP addVehicle _Huey1;
_HeliP setCombatMode "blue";
_HeliP setBehaviour "careless";
_HeliCrew setCombatMode "red";
_HeliCrew setBehaviour "combat";

//******* Create units to be dropped
_Unit1 = _Wg createUnit ["USMC_Soldier_AT", [_spawnPos select 0,_spawnPos select 1,0], [], 0,"FORM"];
_Unit2 = _Wg createUnit ["USMC_Soldier_Medic", [_spawnPos select 0,_spawnPos select 1,0], [], 0,"FORM"];
_Unit3 = _Wg createUnit ["USMC_Soldier_MG", [_spawnPos select 0,_spawnPos select 1,0], [], 0,"FORM"];
_nul = _Unit1 moveInCargo _Huey1;
_nul = _Unit2 moveInCargo _Huey1;
_nul = _Unit3 moveInCargo _Huey1;


// ****** Give orders and wait for heli to approach 
_tGuy doMove _lzadj;
_Huey1 flyInHeight _alt1;

_vv = 0;
while {(_vv == 0)} do
{
 sleep random 1;
 if ((_Huey1 distance _lzadj) < 250) then {_vv = 2};
 if !(isengineon _Huey1) then {_vv = 1};
 if ((!alive _tguy)) then {_vv = 1};
 if !(_tguy in _Huey1) then {_vv = 1};
 if (!alive _Huey1) then {_vv = 1};
};


//******Approach okay: Land!
if (_vv == 2) then 
{
_Huey1 flyInHeight 10;
_tGuy sideChat format ["Found LZ %1 meters from you",_dist];
_Huey1 land "GET OUT";			
};	

//******wait for landing
_vv = 0;
while {(_vv == 0)} do
{
 sleep random 1;
 if (((getPosATL _Huey1) select 2) < 2) then {_vv = 2}; 
 if !(isengineon _Huey1) then {_vv = 1};
 if ((!alive _tguy)) then {_vv = 1};
 if !(_tguy in _Huey1) then {_vv = 1};
 if (!alive _Huey1) then {_vv = 1};
};

//******Landing okay: wait for units to get out. When being shot at, pilot sometimes can't wait!
if (_vv == 2) then 
{
doStop _tGuy;
sleep 2;
};

//****** units should only get out, when below 2 meters! Heli can move strange when attacked, and we don't want units jumping out at 20 meters
waitUntil
{
(alive _Unit1 && (getPosATL _Unit1) select 2 < 2) || 
(alive _Unit2 && (getPosATL _Unit2) select 2 < 2) || 
(alive _Unit3 && (getPosATL _Unit3) select 2 < 2) || 
(!alive _Unit1 && !alive _Unit2 && !alive _Unit3)
};

{
_x action ["getOut", _Huey1];
}forEach units _Wg;

{
if (alive _x) then {[_x] joinSilent (group player); addSwitchableUnit _x;};
}forEach units _Wg;

deleteGroup _Wg;	
sleep 5;

//******everyone is safe, heli can return home
_home = getMarkerPos _spawnMarker;
_tGuy doMove _home;
_Huey1 flyInHeight _alt1;

// ******if heli is gone, delete it, and clean stuff
_vv = 0;
while {(_vv == 0)} do {
 sleep random 2;
 if ((_Huey1 distance player) > 500) then {_vv = 2};
 if ((_Huey1 distance _home) < 100) then {_vv = 2};
 if !(isengineon _Huey1) then {_vv = 1};
 if ((!alive _tguy)) then {_vv = 1};
 if !(_tguy in _Huey1) then {_vv = 1};
 if (!alive _Huey1) then {_vv = 1};
};

if (_vv == 2) then 
{
sleep 5;
deleteVehicle _Huey1;
deleteGroup _HeliCrew;
deleteGroup _HeliP;
};

deleteVehicle _lzSpot;	

Edited by zapat

Share this post


Link to post
Share on other sites
Let me try and clarify what your saying in a better manner

Create a helicopter with the name "heli"

Create an infantry group with this inside the group leaders / player init

g1= group this; {_x moveInCargo heli} forEach units group this

Create a MOVE waypoint with Speed and behavior

Then create another Transport Unload waypoint ontop of an invisible H with the waypoint init having

"heli LAND "get out";{unassignvehicle _x} foreach units g1;

Then make a final movepoint for it to leave?

Am I getting that right? Because I just tried that and its not doing a thing.

---------- Post added at 03:21 AM ---------- Previous post was at 03:20 AM ----------

Yeah I have watched that video a couple of times myself, the helicopter tends to land smoother with an invisible H pad.

This worked like a charm for me, did everything u wrote up there, then placed two opfor squads on the ground, chopper took alot of fire, but it still hit the group and unloaded the units. :)

only bad thing is that the choppr stops before the move waypoint and hovers for like 5 seconds, then it moves forward alittle bit, then starts the descend, and finaly it touches down.... but still its good for making missions if u want to make a heli land in a hotzone.

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  

×