Jump to content

Recommended Posts

Hello,

I've been working on a mission, and I had no errors for now, but now I have an issue with the Unload transport waypoint.

Well I have a scripted helicopter route that: Takes off and land, drop off a squad, then go to another LZ, picks up another squad and flies away. Well, everything worked fine until I got to picking up another squad... I've linked the GET IN waypoint with the LOAD waypoint of the Helo and all this, but not working... so I jumped in the pilot's view and then I saw the issue. When dropping off the first squad, (all the squad was out the Helo) the waypoint stays at "HOLD", and it doesn't moves to the next waypoint. 

Can anybody help me to find the mistake here? I thought that maybe I have to assign the pilot and copilot as driver and commander, or the squad as cargo maybe?

 

 

EDIT: the problem here, was that I had to assignAsCargo the squads you need to drop. so the code would be:

{_x assignAsCargo H1} forEach units inf1;
{_x moveincargo H1} forEach units inf1;

Share this post


Link to post
Share on other sites

I know this, the waypoint for the helicopter is on TRANSPORT UNLOAD but when the squad is out of the helicopter it stays at HOLD.

Share this post


Link to post
Share on other sites

Ahh sorry, is the unload waypoint synchronised with another waypoint, which might be causing the helo to wait there?

Share this post


Link to post
Share on other sites

It is synchronized with the "GET OUT" waypoint of the squad...but the squad get out of the helo successfully. :mellow:

Share this post


Link to post
Share on other sites

With my two arma bearing PCs being occupied by little minecrafters, iirc you should only need the transport unload waypoint on the helo. Try it without syncing it to any other waypoint

Share this post


Link to post
Share on other sites

hi,

 

You must unassignVehicle or leaveVehicle your first group or the chopper will wait.

 

According to my experience, it is way more reliable to use script than waypoints with chopper in ArmA.

 

cya.

 

Nikiler.

  • Like 2

Share this post


Link to post
Share on other sites

I think it's solved, but now the issue is that the squad gets out of the helo when it had not taken off yet(first squad).

Share this post


Link to post
Share on other sites

I'd rather script it too. As nikiller said, if you wanted to you could use something like this:

{unassignVehicle _x} forEach units _grpName;

Chuck that in the waypoint's activation field and fiddle around with things until you're happy. Maybe try using a helipad or invisible helipad near your intended LZ

  • Like 1

Share this post


Link to post
Share on other sites

But, scripted in which sense? all is working well, the only problem now is that when the helicopter have not took off yet, they get out(sometimes)

Share this post


Link to post
Share on other sites

Ok, so if you just want to use waypoints and not worry about any script commands, this will work; Place an invisible helipad (Insert Unit -> Empty -> Objects(Signs) -> Helipad (Invisible)) where you want the helicopter to land. Then, as well as any other waypoints it needs, give the helicopter a "Transport Unload" waypoint near the helipad. This will have it land at the helipad's position, unload the group that's inCargo, then it'll fly off once it finishes unloading. No "Get Out" waypoint for the troops or any waypoint synching.

 

But, to use a script command, instead of a "Transport Unload" waypoint, put a move waypoint near the helipad, and in it's onActivation field put this:

 

{unassignVehicle _x} forEach units grp1;

 

Where grp1 is the name you assign to the group. If you use this method, you might want to put the waypoint in a position a bit before the helipad, as the helo wont execute the command until the waypoint is reached and ends up making it harder for it to land efficiently (for AI).

  • Like 1

Share this post


Link to post
Share on other sites

Thanks a lot for telling me this, didn't know, it's sure I'll use this further.

But explanation:

My mission is me piloting a helo and tasking around the map, the other helicopter, the IA one, is a scripted helicopter. So, IA don't move the helicopter it moves by scripts for this I have to use the TRANSPORT UNLOAD and GET OUT waypoint for squad, but I got all working now. Before, the squads were leaving the helicopter before it have the time to take off (If I make any writing mistake, please correct me :D) but now, I have a module set for the squad's IA to disable movement, and when the helicopters are close to the LZ another module enables again the IA's movements.

Last question (I hope :P) The IA helicopter being scripted, the IA pilot doesn't need to do ANYTHING, but if now between one scripted path, and another one I want to make the IA pilot to wait (It takes the control of the helo a few seconds), How I can do that? Because in these few seconds he have time to take off and fly some meters... Turning off the IA's movements is useful?

Share this post


Link to post
Share on other sites

Setting the helicopters flyInHeight to 0 might do it. You'd just need to remember to change it again if you had the AI flying instead of the scripted route.

I understand now what you're doing with the AI helo. I've done the same with scripted paths but i usually run my own script to force everyone out a lot quicker than the standard "Get Out" (like having blokes jump off the seats of a hovering littlebird together).

  • Like 1

Share this post


Link to post
Share on other sites

Thanks, I'm going to try this. Now, the first objective of dropping the first squads is working well, but now the second of picking up it was not working very well, so I scripted the evacuation: the helicopters wait some seconds and all the units on the ground have a "MOVE" waypoint with On Act:

unit action ["getInCargo", Helicopter];

And with this, it's working well but sometimes when the helicopters are still landing (~5m and ~10km/h) they get in doing a super big jump, but this I can solve it putting a condition in the waypoint:

this AND (speed helicopter < 2)

Will this work? And is there a condition to check if helicopter is below X meters?

Share this post


Link to post
Share on other sites

Put this anywhere when you want the guys to load into the helo (depending on when you want the loading to occur):

{_x assignAsCargo _heloName} forEach units _grpName;

{[_x] orderGetIn true} forEach units _grpName;

That'll assign them all to the helo and order them to board. orderGetIn uses an array, and do doing it this way it means that each group member will individually recieve the order (1 get in...2 get in...3 get in), which for AI groups doesn't matter. But if it were a player group it would be better to put each unit into the array, with the simplest way being [unit1,unit2,unit3] as this would send the order once to everyone (1, 2, 3 get in...)

Also, using assignAs and orderGetIn will make the helicopter land so, again depending on what you're doing, this may/may not make things simpler.

Edit: height check for the helicopter would like like:

((getPos _helicopter) select 2) < 5

This would return true once it's below 5m. There's a few different types of getPos/setPos commands too for different applications.

  • Like 1

Share this post


Link to post
Share on other sites

Instead of cluttering the forum with another post, I want to ask something related :).

_pos1 = getMarkerPos "Land_Airbase";
_grp = group gunpilot;
_wp = _grp addWaypoint [_pos1, 0];
[_grp, 0] setWaypointType "GETOUT";

Why doesn't the helicopter land on this marker? It turns in that direction and just hovers, but doesn't land..

 

It DOES lands there when I give it a regular "get out" waypoint in the exact same spot as the marker, in the editor, at the same time.. Please help.

Share this post


Link to post
Share on other sites

Instead of cluttering the forum with another post, I want to ask something related :).

[_grp, 0] setWaypointType "GETOUT";

Why doesn't the helicopter land on this marker? It turns in that direction and just hovers, but doesn't land..

 

Instead of the above, use:

 

_wp setWaypointType "GETOUT";

 

Using a helipad near to where you want the helo to land will ensure it lands where it's meant to. There's an invisible one too if it's not meant to be visible.

  • Like 2

Share this post


Link to post
Share on other sites

Hello again, well, looking and looking I found why I had the error before (the error of the units moving out of the helicopters and the waypoints not working...):

From a comment of hardrock here https://community.bistudio.com/wiki/moveInCargo:

 

Notes from before the conversion If you place a soldier in a vehicle with the moveInCargo command, he wont "know" he's in the vehicle, and thus he won't disembark properly when the vehicle reaches a Transport Unload waypoint. Therefore you have to use the assignAsCargo command, in order for the AI to catch on. Something like this: moveInCargo helo1 this assignAsCargo helo.

 

So, now I'm looking a way to first assign and then move in cargo. I'm going to write this on the init.sqf and I thought maybe something like this:

 

{_x assignAsCargo H1} forEach units inf1;

{_x moveincargo H1} forEach units inf1;

{_x assignAsCargo H2} forEach units inf2;
{_x moveincargo H2} forEach units inf2;  

 

I don't know too much about scripting, but could you tell me if it's wrong, and how to correct that please.

 

Also, Is Co-pilot a gunner? because the Co-pilot place is a turret...

Share this post


Link to post
Share on other sites

Instead of writing it in your init.sqf, create another file in your mission directory called tptInit.sqf (or whatever you want to call it, tptInit to me means transportInitialisation). In that file put:

_helo = _this select 0;

_grp = _this select 1;

{_x assignAsCargo _helo} forEach units _grp;

{_x moveInCargo _helo} forEach units _ grp;

Then in your init.sqf put:

nul = [H1,inf1] execVM "tptInit.sqf";

nul = [H2,inf2] execVM "tptInit.sqf";

That'll then send the helicopter names and group names through to the script as _this select 0 and 1. So you could then easily use that script in another mission for any number of groups/helicopters without having to write the code for each one.

Also, i think co-pilots are cargo seats with an index of 0. So instead of using _unit moveInCargo _helo you can assign specific seats, and if you want to have a co-pilot occupy that seat you would use:

_unit moveInCargo [_helo,0];

Hopefully everything i wrote is right. I'm on my phone and it's getting late so see how it goes :) (edit: found a mistake straight away...)

  • Like 1

Share this post


Link to post
Share on other sites

This worked perfectly, thanks a lot. 

 

I have the Evac.sqf script, and for now it looks like this:

U1 assignAsCargo H1;
[u1] orderGetIn true; 
(repeat this one, until U12 and H2 xDD)
 
So I'm going to try to do it like you've done.
_helo = _this select 0;
_unit = _this select 1;

_unit assignAsCargo _helo;
[_unit] orderGetIn true;

and in the trigger:

nul = [H1,U1] execVM "Evac.sqf";

but, I have to put this command 12 times? I don't do it like the other one because they are single units, not a group.

 

Share this post


Link to post
Share on other sites

Instead of the above, use:

 

_wp setWaypointType "GETOUT";

 

Using a helipad near to where you want the helo to land will ensure it lands where it's meant to. There's an invisible one too if it's not meant to be visible.

 

It worked!

 

I really can't say enough how helpfun and awesome people on this forum are, not to undermine your exceptional effort. Imagine if society was as trusting as this. Really great help, thanks!

Share this post


Link to post
Share on other sites

Ahh by the way, the copilot is a turret (at least for the MH-9, Ah-66 and Ah-6 cobra). Because I use "this moveInTurret [H1, [0]]; So I suppose it's a gunner seat?

Share this post


Link to post
Share on other sites

Ahh by the way, the copilot is a turret (at least for the MH-9, Ah-66 and Ah-6 cobra). Because I use "this moveInTurret [H1, [0]]; So I suppose it's a gunner seat?

 

Ugh, yeah, see I said I was tired  :wacko: I was doing something on VBS last week and using that and decided for myself last night that it wasn't part of ArmA...... but [H1,[0]]  will get the guy into the co-pilot seat.

 

As for the evac.sqf part, how many guys are you picking up and what helicopter/s are they using? Because I was about to answer it but if you've got a single group getting into multiple helos I'll write/explain it differently.

 

It worked!

 

I really can't say enough how helpfun and awesome people on this forum are, not to undermine your exceptional effort. Imagine if society was as trusting as this. Really great help, thanks!

 

Yeah I've learnt tonnes off this forum, it's a good resource.

  • Like 1

Share this post


Link to post
Share on other sites

There are two helicopters (H1 and H2) who are to evacuate up to 12 IA, (some of them may die, I have a move waypoint with the next condition:"((!alive U1) or (U1 in H1))"  and the same for the 11 other units) So I have a move waypoint for all the units next to the move waypoint of the helicopters, when a trigger detects if the helicopter is at the trigger and a speed lower than 5Km/h it activates the script. 

 

In the move waypoint condition, could I put, for example: "myvariable = true". In the init.sqf: myvariable = false. and in the end of the script (the evac.sqf script) myvariable = true, or something like this? Wait a second, I've learned some C# and I think I have to do a While loop? or a Loop? like: 

  //Edit 3 fixed what was wrong, but still doesn't helping me :/
_Unit = [U1, U2, U3, U4];
_Helo = [H1, H2];

while {((!alive _unit) or (_unit in _helo))} do
  {
    _unit assignAsCargo _Helo;
    [_unit] orderGetIn true;
  }

myvariable = true 

I'm trying so hard to script. xD Now that I'm thinking about it, it doesn't matter in witch helicopter the IA goes in, so is it possible to assignascargo for 1 of the helicopters randomly?

 

Thanks a lot again for helping me.

Share this post


Link to post
Share on other sites
Well, at the end I discovered I need an object, not an array. So I suppose I have to use this selects 0 and all that.
EDIT:
I'm trying a lot of things to get this working, and for now I've got this: 
_Unit = [U1, U2, U3, U4];
_Helo = [H1, H2];
_a = 0;

while {_a < 4} do
	{
		_Unit = _Unit select _a;
		_Helo = _Helo select 0;
			while {((!alive _unit) or (_unit in _helo))} do
			{
				_unit assignAsCargo _Helo;
				[_unit] orderGetIn true;
				hint "It's working!";
			};
		_a = _a + 1;
		sleep 5;
		hint "Let's go again!";
	};

The hints are there, to know that it's working lol.

So, It is possible to select an object of an Array with the variable _a, like I'm trying to do?

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

×