Jump to content
Wiki

Force landing gear unitplay

Recommended Posts

 

Alright, so I guess what I was doing wrong was executing the SQF from the init file, but your saying I need to execute it on a Game Logic module in game. So if I understand what your saying correctly, I should place my object, put who/what I want in it, make it flying, set a trigger directly in front of it, and have said trigger linked to the game logic module, and when triggered, it will set the unit to play back the unitPlay file. Am I getting this right?

 

You've got the gist, essentially, just think of the Game Logic as your Blackfish; the real Blackfish will just be attached to the Game Logic, and moving with it, as it's attached. One of the main reasons I advocate this approach is because it allows you to fine-tune your scene, adjusting the attach array (the [0,0,0] bit). It means you can raise or lower the height of the moving vehicle, or slide it along its X and Y axis, so you can achieve the exact shot / cutscene you're looking for. Ideal for screenshots too!

Share this post


Link to post
Share on other sites

Hi kydoimos,

 

I followed your advice you posted in this thread and got the game logic following the unitPath with the Blackfish attached. I can get the landing gear working, but only if I have the player set as the pilot. Do you know if it's possible to have the landing gear lower with the player riding as a passenger in the back?

 

I could always turn my Blackfish insertion into a cutscene where I switch the player in as the pilot and then back to a passenger once the cutscene concludes, but ideally I'd like to have the scene play outside of a cutscene.

 

Thanks mate.

Share this post


Link to post
Share on other sites

Was helping a friend with this the other night and came up with a stupid idea... which worked!

 

"Spawn a second Blackfish on the ground, disableSimulation and attach it to the first Blackfish"   :D

Share this post


Link to post
Share on other sites

Was helping a friend with this the other night and came up with a stupid idea... which worked!

 

"Spawn a second Blackfish on the ground, disableSimulation and attach it to the first Blackfish"   :D

 

Haha, I love it! All else fails I'm going for this. Thanks mate.

Share this post


Link to post
Share on other sites

Just a heads up, as I had the same problem now and remembered this thread...

 

... I've simply placed a "Land" waypoint on the position where my helicopter was going down via recorded movement- this results in the AI to lower the landing gear when getting close to the ground. Basically saves me the workaround with additional game logics and scripts and stuff. Works perfect and the helicopter stays until I give new orders.

 

It's actually so simple, no idea why nobody thought about this yet.

Share this post


Link to post
Share on other sites
On 6/19/2016 at 1:16 PM, lexx said:

And when triggered, it will set the *game logic module* to use / follow the data in the UnitPlay file. Your *unit* must be *attached* to the game logic module. It's a nice workaround, actually.

How can I activate game logic by trigger?

 

When I try to do it, it activates immediately at the mission start and ignores the trigger... :/

Share this post


Link to post
Share on other sites
14 minutes ago, KenniT said:

How can I activate game logic by trigger?

 

When I try to do it, it activates immediately at the mission start and ignores the trigger... :/

I use this to drop units from the Y-32 and it works fine, no gamelogic needed:

[_veh] spawn {
	_veh = _this select 0;
	while {sleep 1; alive _veh} do {
		if ((getPos _veh select 2 < 3) && (count crew _veh > 2)) then {
			_veh animateDoor ["door_1_source",1];
          	_veh action ["LandGear", _veh];
		} else {
			_veh animateDoor ["door_1_source",0];
          	_veh action ["LandGear", _veh];
		}
	}
};

Basically, _veh action ["LandGear", _veh]; works as it should, at least for helicopters/VTOLs.

Share this post


Link to post
Share on other sites

To anybody who will need same script as this

_crew1 = [];
_airframe1 = [];

if (isServer) then {

_airframe1 = [getMarkerPos "evachelispawn", 200, "B_Heli_Transport_01_F", WEST] call BIS_fnc_spawnVehicle;
_heli = _airframe1 select 0;
_heli setVehicleVarname "evacheli";
evacheli = _heli;
publicvariable "evacheli";
};
sleep 5;
rec = [] spawn Mypath;
sleep 72;
evacheli action ["LandGear", evacheli];

It spawns UH-80 Ghost Hawk at "evachelispawn" marker position, it will have its nose pointing bearing 200.

With some help I managed to make the heli called evacheli.

After it's spawned it will wait 5 second until it will play unitplay

And after a few tries in review mode in editor I managed to time it right so that it will retract its gear until it gets into air.

Share this post


Link to post
Share on other sites

Since I can't post new threads I have to resort to necromancy for help. I apologize in advance.

 

I was having the same issue and I have not been able to come up with a solution. I'm attempting this with a C130. If I start it on the ground and then attach it to a game logic, the landing gear issue is solved but then I can't get the lights and engines on. If I unitPlay the C130 itself, obviously, I can get the engines and lights to work but no landing gear. I tried putting the player in the driver's seat, extending the landing gear, and then moving them back to cargo but that didn't work either. The interesting part is that when the C130 is on the ground, the engineOn true works and the lights are on but as soon as I attach it to the game logic, they shut off.

 

Any ideas?

Share this post


Link to post
Share on other sites
On 19-6-2016 at 1:44 PM, Kydoimos said:

You've got the gist, essentially, just think of the Game Logic as your Blackfish; the real Blackfish will just be attached to the Game Logic, and moving with it, as it's attached. One of the main reasons I advocate this approach is because it allows you to fine-tune your scene, adjusting the attach array (the [0,0,0] bit). It means you can raise or lower the height of the moving vehicle, or slide it along its X and Y axis, so you can achieve the exact shot / cutscene you're looking for. Ideal for screenshots too!

 

So that is basically how you would get a shooting target to move to?

I've seen people attaching a shooting target to an AI who was walking behind the wall.

Making it look like the static shooting target would move by himself.

So what you say is I could do this to with a game logic?

 

On 25-9-2016 at 11:12 AM, lexx said:

Just a heads up, as I had the same problem now and remembered this thread...

 

... I've simply placed a "Land" waypoint on the position where my helicopter was going down via recorded movement- this results in the AI to lower the landing gear when getting close to the ground. Basically saves me the workaround with additional game logics and scripts and stuff. Works perfect and the helicopter stays until I give new orders.

 

It's actually so simple, no idea why nobody thought about this yet.

 

Yes and no, for helis you are right.

However i'm trying to get the AI to land on the ship using unitcapture but no matter what I do he won't put hes landing gear out.

Tried the ... in all diferent ways but without any succes.

Heliname action ["LandGear", Heliname];

I even tried using it on 3 helis and to my suprise only 1 heli (even a mohawk) lowered hes gear only once!!! (while I spammed the command I got it to work once by using the pilot name first and the heli name as last)

But as said that only worked 1 time! the rest he didn't do anything at all.

The fun part about it is that the command does work whenever the player is inside the plane.

But when it is an AI controlled vehicle you out of luck...

 

Never played around with game logics so will have a look at that later, hope it works.

 

Share this post


Link to post
Share on other sites

landing gear up:

player action ['LandGearUp', vehicle player];

landing gear down:

player action ['LandGear', vehicle player];

 

Share this post


Link to post
Share on other sites
On 1/4/2020 at 3:13 AM, zectbumo said:

landing gear up:


player action ['LandGearUp', vehicle player];

landing gear down:


player action ['LandGear', vehicle player];

 

 

That doesn't work, the player isn't flying the helicopter in a unit capture/unit play situation. 

 

I found something that does work.

 

Place a trigger on your LZ.

 

For a helicopter named "heli1" put this into the trigger activation field.

 

heli1 action ["LandGear", heli1]; 

Share this post


Link to post
Share on other sites

I tried disabling the pilot's AI and that didn't work either.

 

So, folks, the one workaround that worked with 100% success is:
Removing the pilot from the vehicle and adding a 'landgear' trigger when they get close.

Hooray.

Share this post


Link to post
Share on other sites

Hello I know its been a while but here is what worked for me in Arma 3:) They mentioned in the docs that you have to put 

yourplane action ["LandGear", yourplane]

into a "onEachFrame" loop. That overwrites the AI's behavior. Here's the code:

onEachFrame {   yourplane action ["LandGear", yourplane]; };

 I created a trigger on the LZ and slapped this oneliner into the "On Activation" box.

 

Here is how they put it on https://community.bistudio.com/wiki/Arma_3:_Actions

 

Quote

LandGear

Description: Lowers the landing gear of an aircraft. In the case of AI-controlled aircraft, it has to be used in an each-frame loop to override the AI behavior (otherwise they'll raise the landing gear when they take off).

Syntax: unit action ["LandGear", targetVehicle]

Where unit is any unit (no action animation is performed) and targetVehicle is a vehicle that can perform an autopilot landing.

 

  • Like 1

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

×