Jump to content
thdman1511

How to use UnitCapture in Arma 3.

Recommended Posts

I have read some of the posts and I am still having trouble getting BIS_fnc_UnitCapture working in Arma 3. I was able to get it to work in the Alpha but since then I have not been able to get it to work. So I am wondering whether someone could advise me how to get it working. Will it work in the intro or does it only work in Mission mode as a cutscene.

I have watched all the youtube videos on unitcapture and unitplay, however there is no real update to it. the videos say that theres a function module that need to placed on the map, but unfortunately there is no functions module for unitcapture listed, The reason I want to use it, is so that I can get more precise action within my intros which I am trying to develop. I have tried to search unitcapture and unitplay on wiki but to no avail. so any assistance would be appreciated.

Share this post


Link to post
Share on other sites

Have a look at the functions viewer, note at the top of each function that indicates use, you don't need the functions module any longer - that was only for A2.

Scenes Functions

UnitCapture "Records movement data of input unit over a specified period of time. If the 4th parameter set to true, will record weapons fire data as well."

UnitCaptureFiring "Records weapon fire data of input unit over a specified period of time.";

UnitCaptureSimple "(Simplified) Records only movement and dir data of input unit. If the 4th parameter set to true, will record weapons fire data as well."

UnitPlay "Plays back input movement data on input unit. The data can be pre-recorded using the UnitCapture script."

UnitPlaySimple "(Simplified) Plays back input movement and dir data on input unit. The data can be pre-recorded using the UnitCaptureSimple script."

UnitPlayFiring "Plays back input weapon fire data on input unit. The data can be pre-recorded using the UnitCapture or UnitCaptureFiring script."

Share this post


Link to post
Share on other sites

As far as the setup is concerned, UnitCapture, Unitplay and UnitFiring work the same way as they did in A2. The technique works on all vehicles, with some limitations.

Create a textfile in your mission folder and call it movementtest.sqf (or whatever you like). Paste this inside:

_movementdata = <mdata> ;
//_firingdata = <fdata> ; 

_sequence = [VehicleName, _movementdata] spawn BIS_fnc_UnitPlay;
//[VehicleName, _firingdata] spawn BIS_fnc_UnitPlayFiring;
waitUntil {scriptDone _sequence};
hint "Playback finished";

Obviously change VehicleName to the name of the vehicle you want to use it on.

To set up the recording, I always use a radio trigger. Create one in the editor and put this in it's onactivation field:

rec = [vehicle player,200,20] spawn BIS_fnc_UnitCapture;

This command will record the movement of the player's vehicle for 200 seconds with a framerate of 20fps. I am assuming you want to control the vehicle yourself while recording.

If you also want to record firing information for that vehicle, remove the //'s from the script and add TRUE to the command in the radio trigger:

rec = [vehicle player,200,20,true] spawn BIS_fnc_UnitCapture;

Now you just have to start recording and press escape twice when you are done, then press F1 to copy the movement data to your clipboard and paste it in the place of <mdata> in the script. If you recorded firing data, go back to the game and press F2 to copy the firing data, then paste that in the place of <fdata>. Save the file.

A heads up for BIS_fnc_UnitPlayFiring: This will only play back correctly for UNGUIDED weapons. Anything that was locked or aimed will just go either straight forward or wherever the turret is aiming at the given time.

Ok then, go back in the editor, put an AI in the driver's seat of the vehicle you just controlled and execVM the script. It will only work if there's a AI unit in the driver's seat - that's not a bug but a feature, if the driver dies mid-path, the function will not continue.

nul = [] execVM "MovementTest.sqf"

My guess is that it's primary purpose is to be used on air vehicles. I have recently used it on a truck and the vehicle will move without any animations for the wheels. Maybe the animation can be added, but I don't know for sure. Also, I find the truck bouncing up and down rapidly sometimes while it's playing back the recorded data.

You can also use the function on foot soldiers, but you have to use an animation for the unit (walking,running,sprinting etc). I have recently used that for a path that the AI could never handle on it's own and I could only get it to work in a very clumsy looking manner. Not sure how it is for tanks, maybe the tracks move but it's very possible that they don't.

It will work in the mission, intro, outro, whatever. Oh and you don't need the functions module anymore in A3.

EDIT: Mattar_Tharaki beat me to it

Edited by Mad_Cheese
  • Like 2

Share this post


Link to post
Share on other sites

thanks for that, informations. however when I use Unit Capture with a vehicle, all my controls are lock out, and I cannot move the vehicle. I tried in on a soldier, then armoured vehicle and on a blackfoot. I have no control what so ever. So I will try again. and see what happens. and once again thanks.

---------- Post added at 21:28 ---------- Previous post was at 21:16 ----------

UnitCapture works now, thanks for everyones help.

Edited by thdman1511
Incorrect informations remove.

Share this post


Link to post
Share on other sites

EDIT: Nevermind, I got the wrong command for engine on, I saw "engineOn on" but it's supposed to be "engineOn true" which works great. This is a lot simpler than I expected, I always wanted to get into it but the ArmA 2 tutorial I read made it seem super complicated. This works great and is actually pretty easy to do! Thanks for the how-to!

Edited by MordeaniisChaos

Share this post


Link to post
Share on other sites

Any reason, why it says - script movementtest.sqf not found?

I put ul = [] execVM "MovementTest.sqf" as a radio bravo trigger

---------- Post added at 11:21 ---------- Previous post was at 11:03 ----------

yes. The files were saved as sqf.txt but the txt was hidden extension.

Share this post


Link to post
Share on other sites

Any hints on recording the guns on the ghost Hawk guys? I want to record the ghost Hawk flight & then at the LZ I want the guns firing. Just can't suss it out.

Many thanks for your help folks

Share this post


Link to post
Share on other sites

Can someone please tell me what I'm doing wrong? UnitCapture works but when I then try playing the script as a gunner in a ghost Hawk, the bird just sits there. I've activated the trigger but nothing. Driving me mad now

Share this post


Link to post
Share on other sites

Using the example thats on this thread i thought i'd like to record 3 guns. They record ok but wont play back with the trigger. This is how i set my sqf out. Is this right?

_movementdata1 = <mdata> ;

_firingdata1 = <fdata> ;

_movementdata2 = <mdata> ;

_firingdata2 = <fdata> ;

_movementdata3 = <mdata> ;

_firingdata3 = <fdata> ;

_sequence = [G1, _movementdata1] spawn BIS_fnc_UnitPlay;

[G1, _firingdata1] spawn BIS_fnc_UnitPlayFiring;

_sequence = [G2, _movementdata2] spawn BIS_fnc_UnitPlay;

[G2, _firingdata2] spawn BIS_fnc_UnitPlayFiring;

_sequence = [G3, _movementdata3] spawn BIS_fnc_UnitPlay;

[G3, _firingdata3] spawn BIS_fnc_UnitPlayFiring;

Cheers

Share this post


Link to post
Share on other sites

I am going to look into the issue with the vehicles wheels.. I feel the problem is due to the hand brake being on. The physics engine behind the vehicle is quite complex and I'm sure they wouldn't cut corners with only allowing vehicle animations once the vehicle accelerates.

With that being said.. I am not a programmer or anything close. Maybe this will involve editing a vehicles configuration by editing their physics parameters. It does seem like a lot of work to make the wheels work. It's a shame the capture function doesn't record the rest of the data considering the fire functions work to a point.

The AI cannot understand corners for me and will do a 5 point turn to navigate around it haha. To any geniuses out there. HELP US SIMPLETONS

Edited by RGBeats

Share this post


Link to post
Share on other sites

Something I asked a while back and never got an answer on. Is it possible to stop UnitPlay mid way through running?

So for example if I've recorded the movements of a helicopter and it gets hit by an AA rocket id like the script to stop. Given its really intended for intro's by default it keeps on following the pre-recorded movement even though the helicopter is destroyed.

Share this post


Link to post
Share on other sites

Any suggestions as to why my weapons data won't play guys? It's recorded & pasted into the sqf path just like the flight path is & is called in the init file but during playback my weapons or flares won't play back. Thanks for any help

Share this post


Link to post
Share on other sites

I just made a video tutorial to show how to do UnitCapture/Play, according to this thread. Also explaining why the UnitPlay does not work and I dont believe, it could be other reason.

Share this post


Link to post
Share on other sites

Hey everyone.

I've followed this post closely. I've gone from someone who had no idea at all how to use the editor to someone who almost made a working replay! By almost, I mean I get no blade animation or sound out of the Hummingbird during replay. It just lifts off silently and with still blades and goes about its way. Good for stealth I suppose, not ideal for videos. I did this all while fairly sleep deprived, but I thought I nailed all the steps. Any idea where I went wrong? I posted a comment on Thebega's Youtube video as well, considering how I was mainly using that for the step by step.

Thanks!

Bill

Share this post


Link to post
Share on other sites
Hey everyone.

I've followed this post closely. I've gone from someone who had no idea at all how to use the editor to someone who almost made a working replay! By almost, I mean I get no blade animation or sound out of the Hummingbird during replay. It just lifts off silently and with still blades and goes about its way. Good for stealth I suppose, not ideal for videos. I did this all while fairly sleep deprived, but I thought I nailed all the steps. Any idea where I went wrong? I posted a comment on Thebega's Youtube video as well, considering how I was mainly using that for the step by step.

Thanks!

Bill

That's an easy fix, you just need to use "engineon" in the helicopters init. It's not actually flying, it's just moving along the pre recorded path. Turning the engine on just makes it look more real :)

this action ["engineOn", vehicle this]

Edited by pomigit

Share this post


Link to post
Share on other sites
That's an easy fix, you just need to use "engineon" in the helicopters init. It's not actually flying, it's just moving along the pre recorded path. Turning the engine on just makes it look more real :)

this action ["engineOn", vehicle this]

Awesome man! Thanks a lot.

Share this post


Link to post
Share on other sites

I can't get my chopper to fire more than once, why is this?

Fire1=[[19.03,"missiles_DAR"],[19.07,"missiles_DAR"],[19.10,"missiles_DAR"],[19.613,"missiles_DAR"],[20.157,"missiles_DAR"],[20.241,"missiles_DAR"]];

Share this post


Link to post
Share on other sites

No need to hard script command missles firing. Unitcapture/play is best used recording your actions while flying the helo, firing the missiles, then simply play it back

Share this post


Link to post
Share on other sites

Regarding the moving wheels on ground vehicles - as far as I'm aware - it can't be done, yet - though I may be mistaken :D

Share this post


Link to post
Share on other sites
No need to hard script command missles firing. Unitcapture/play is best used recording your actions while flying the helo, firing the missiles, then simply play it back

What he posted is actually captured firing data. Looks like it's from the Littlebird. I've tried to do a similar thing a few months ago while messing around in the editor and failed - my Littlebird wouldn't play the firing sequence. Maybe a bug, I didn't investigate any further.

Capturing ground vehicles is possible but the playback looks pretty weird because wheels and stuff won't be animated. However, there is a user made function for capturing infantry at least: http://forums.bistudio.com/showthread.php?185358-Functions-UnitCapture-UnitPlay-for-Infantry-Units-in-ArmA-3

Share this post


Link to post
Share on other sites

I've seen in videos choppers actually firing more than once, wondering if they use diferent techniques or is it just the littlebird? :(

Share this post


Link to post
Share on other sites

Thanks for this post--hope someone's still following.  I'm having strange behavior when I try to capture helicopter or plane movement.  At the end of the capture when I press F1 instead of copying the path data I was getting the command menu.  I mapped the command menu to another key, but when the "Press F1 to copy path data" prompt comes up pressing F1 does nothing.    It seems I can only copy path data when I crash the vehicle and die.   Pressing ESC 2x doesn't seem to help either.   Thanks!

Share this post


Link to post
Share on other sites

Thanks for this post--hope someone's still following.  I'm having strange behavior when I try to capture helicopter or plane movement.  At the end of the capture when I press F1 instead of copying the path data I was getting the command menu.  I mapped the command menu to another key, but when the "Press F1 to copy path data" prompt comes up pressing F1 does nothing.    It seems I can only copy path data when I crash the vehicle and die.   Pressing ESC 2x doesn't seem to help either.   Thanks!

 

I've just been having the same problem as you and the way I got around it was to destroy my plane. I don't know why it wasn't working properly but I do know that it was only after I'd been flying more than a few minutes, otherwise it worked as intended. So just use "(vehicle player) setDamage 1" in a radio trigger or press esc and put that in the debug console to get the data, to avoid having to crash into the ground to end it.

 

Anyone know why pressing esc x 2 stops working?

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

×