Jump to content
Wiki

Force landing gear unitplay

Recommended Posts

I try to make an insertion with the Huron with UnitCapture / UnitPlay.

When I capture, I get the ramp opened and open the landing gear.

But when I replay it, the landing gear doesn't come out.

Is there any way to force it?

Same question with planes (but I believe it's the same problem).

Any help welcome, thanks.

Edited by Wiki

Share this post


Link to post
Share on other sites

Up please.

Share this post


Link to post
Share on other sites

planeOne action ["LandGear", planeOne];

test that and see if it helps (planeOne is whatever you named the huron).

Share this post


Link to post
Share on other sites

doesn't work unfortunately.

I wonder how BIS did for the AAF presentation: there is a plane landing and taking off, by script, and its gear is always on.

Share this post


Link to post
Share on other sites

The biki says "Only works on player controlled aircraft" but the "LandGear" action has definitely worked for me in the past, using unitPlay on a Mohawk. I just tested that mission and it still works fine, but testing in the editor with a normal AI-controlled helicopter produces inconsistent results. It doesn't seem to work on AI-controlled planes at all. Frankly I think several changes to AI behaviour around the time of the Heli DLC release have caused thinks like this to break. Another example is that AI units will no longer board a helicopter if the vehicle is being setPos'd in a loop, which used to work after a recorded unitPlay path to keep a chopper on the ground while units boarded it.

Edited by 2nd Ranger

Share this post


Link to post
Share on other sites

Hmmm.. Ok, so how can I do it?

When and where should I use the code in the unitplay script?

In the init? in another script? in the "path.sqf" file?

Share this post


Link to post
Share on other sites

I just use it in the path file, but it doesn't really matter so long as you execute it when you need it during the recorded path. In that particular mission I (rather lazily) did it like this:

[] spawn {
	sleep 30;
	Heliname action ["LandGear", Heliname];	
};

I just timed how long the recording had been running at the moment I needed the gear to drop. A better way would be to detect when the chopper is near the ground, or how close it is to the LZ position.

  • Like 1

Share this post


Link to post
Share on other sites

Can you upload your mission so that I can have a look at it please?

Share this post


Link to post
Share on other sites

So, made a retry, still doesn't work at all.

Share this post


Link to post
Share on other sites

Up please

Share this post


Link to post
Share on other sites

In A2/OA the Heliname action ["LandGear", Heliname]; command only worked after issuing a land command.

Heliname land "land";

action ["LandGear", Heliname];

However that would cause other issues, aircraft auto landing kicks in so they will ignore flyinheight and possibly waypoints.

Share this post


Link to post
Share on other sites

Doesn't seem to work with unitcapture/unitplay

Share this post


Link to post
Share on other sites

I don't know about unit capture but I did a little test.

player action ["LandGear", Heliname];// works but only for empty chopper,maybe player vehicle as well, has no effect when AI is pilot

Heliname land "land";// also lowers the gear but only while in landing mode.

Share this post


Link to post
Share on other sites

Yeah, I know.

In fact, I wanna try this:

use unitcapture while flying a chopper to have it land exactly the way I want. I use the gear during it.

But when I use unitcapture, well, the gear doesn't show up, even with the command, and the chopper crashes.

Share this post


Link to post
Share on other sites

Up please

It seems possible, like BIS did in the AAF showcase:

The plane lands and takes Off with gear on, and I believe it's unitcapture/unitplay too.

Share this post


Link to post
Share on other sites

Try dePbo-ing the file and see if it truly is, it'll be in ARMA3\Addons\missions_???_f, I can't remember when faction showcases were released, could be missions_f, won't be missions_beta_f or missions_bootcamp_f (the names may be a bit made up, but it'll be missions_???_f (might be wrong about the f, could be talking out of my arse)).

Share this post


Link to post
Share on other sites

They just use the LandGear action in that mission. But have you checked it recently to make sure it still works like that? Maybe they broke it.

Share this post


Link to post
Share on other sites

Ok, I'll check that up.

Share this post


Link to post
Share on other sites

So, I tried, but couldn't find how they did it.

Share this post


Link to post
Share on other sites

@Wiki - hi mate! After encountering the same issue, I've found a nice workaround! :D Basically, play the unitCapture on a gameLogic - attach the helicopter to this gameLogic - then execute the unitPlay on the gameLogic, not the helicopter. You may need to adjust the attachment array, but this works out well, because you can fine tune everything to your heart's content! Hope it works for you, matey! Oh, before I forget - the _unit action ["LandGear", _unit]; will now work on the attached chopper!

  • Like 2

Share this post


Link to post
Share on other sites

Ok, thanks.

But, don't understand the unitcapture / unitplay in game logic.

can you send me a sample or explain me how to get this work please?

thanks!

Share this post


Link to post
Share on other sites

@Wiki - hi mate! After encountering the same issue, I've found a nice workaround! :D Basically, play the unitCapture on a gameLogic - attach the helicopter to this gameLogic - then execute the unitPlay on the gameLogic, not the helicopter. You may need to adjust the attachment array, but this works out well, because you can fine tune everything to your heart's content! Hope it works for you, matey! Oh, before I forget - the _unit action ["LandGear", _unit]; will now work on the attached chopper!

I am having the exact same issue on the new V-44 Blackfish, unfortunately the AI is horrible about landing this beast, so unitPlay is my only option, but it lands on its belly, and then shuts off the engines, and flys away again magically. mind pasting the code, minus the actual pathdata here? 

Share this post


Link to post
Share on other sites

@Wiki / @Reble_45 - hi chaps! Right, okay, I'm at work and away from my PC, but here's the rundown (it's been so long since I've done this I had to re-read my own comments in the thread! lol):

 

So, first off, you'll need to get the recorded data. Add a trigger which will activate with your desired vehicle's presence and in the activation box, add:

[Vehicle_Variable_Name, 150, 50] spawn BIS_fnc_UnitCapture;

The parameters for the above function, in case you're interested, are:

Unit - Unit to capture movement data from
Duration - Duration to capture for
OPT:FPS - OPTIONAL: Frames recorded Per Second (default 20). Limit is 1 - 100
OPT:Firing - OPTIONAL: If true, will record the input unit's weapon fire data as well
OPT:StartTime - OPTIONAL: Starting time offset for the frame time

 

Now, when you're done recording, hit 'ESC' and follow the hint command (can't remember what it says off the top of my head!) to copy the recorded data to your clipboard. 

 

Now create an SQF file with something like the following:

 

_aircraft = Vehicle_Variable_Name;

 

_movementData = (copy the recorded data here and don't forget to end the text wall of data with your trusty semi-colon!)

[_aircraft, _movementData] spawn BIS_fnc_unitCapture;

 

Parameters are:

 

0: OBJECT - unit to play movement data on
1: ARRAY - movement data recorder by BIS_fnc_unitCapture
2: ARRAY (Optional) - variable to set once playback has finished. The array is in the following format:
0: NAMESPACE, GROUP or OBJECT
1: STRING - variable name
3: BOOL - true to allow playaback on destroyed objects (normally the playback will stop once the object is destroyed)
4: NOTHING - obsolete param, preserved because of backward compatibility
5: NOTHING - obsolete param, preserved because of backward compatibility
6: NUMBER - seconds to skip at the start of playback

 

Okay, so, providing all that works (and there's a good chance I've made a slip up, I'm literally half asleep! :P), you are now in a position to switch your object with a game logic.

 

Quite simply, switch the name of the vehicle you want to use for the unitPlay sequence with the name of a Game Logic object (you can find it in the editor). Rename your vehicle something like 'Aircraft_Attached. Next:

 

 

Aircraft_Attached attachTo [Vehicle_Variable_Name, [0,0,0]];

 

Then execute your SQF file; the playback data you recorded will be playing on the Game Logic (if you did indeed switch the names around!). If you've correctly attached your vehicle (Aircraft_Attached) it will follow the path of the Game Logic. Also, you can play with the array in the code box above to adjust its position to suit your liking.

 

If you then execute the LandingGear command (which we looked at near the beginning of this thread) the AI should react accordingly and behave. I think I used this in the final episode of Resist, Judgement Night. You may want to pick apart the PBO and find the script for Romeo's extraction scene.

 

Hope that helps - sorry if it's a bit garbled, best I can do right now! :D

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

and when triggered, it will set the unit to play back the unitPlay file. Am I getting this right?

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.

  • 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

×