Jump to content
Sign in to follow this  
Big Dawg KS

[OA] UnitCapture & UnitPlay Functions

Recommended Posts

What do you mean with file ?

A .txt or .sqf ?

Ultimately an .sqf. Really it can be whatever, you just have to be able to acess it when you want to call (spawn) the play function. For example:

playLanding.sqf

_landingData = [i]<huge amount of data you recorded>[/i];

{_X moveInCargo heli1} forEach units myGrp1;
heli1 setVariable ["LandingDone",false];
[heli1,_landingData,[heli1,"LandingDone"]] spawn BIS_fnc_UnitPlay;

waitUntil{heli1 getVariable "LandingDone"};

{doGetOut _X} forEach units myGrp1;

Share this post


Link to post
Share on other sites
Ultimately an .sqf. Really it can be whatever, you just have to be able to acess it when you want to call (spawn) the play function. For example:

playLanding.sqf

_landingData = [i]<huge amount of data you recorded>[/i];

{_X moveInCargo heli1} forEach units myGrp1;
heli1 setVariable ["LandingDone",false];
[heli1,_landingData,[heli1,"LandingDone"]] spawn BIS_fnc_UnitPlay;

waitUntil{heli1 getVariable "LandingDone"};

{doGetOut _X} forEach units myGrp1;

Thanks, but UnitPlay dont works for me either...

Share this post


Link to post
Share on other sites

Damn, I was so hyped when I heard bout this... And now - big F nothing... Still can't use UnitPlay... Searched through whole campaign folder... Nothing new. Nothing that would help (or I missed something).

BIS - plz help?

Share this post


Link to post
Share on other sites

Less drama, here's a working example.

0-0-2 starts a 60 second recording session with weapon fire, 0-0-3 plays my last import which is a random apache run, or whatever data you set in the path.sqf.

init.sqf is used for preprocessing.

If you record any data with 0-0-2, in path.sqf you can replace the data currently set to _unitPlayback2 with your own movement data, and you can replace firing data in _fireData with your own recording.

File is here.

Share this post


Link to post
Share on other sites

Thank you very much... Will try ASAP.

Share this post


Link to post
Share on other sites

Would be cool if someone can tell me why "UnitPlay" dont works here:

_landingData = [[0,[>to many stuff<]]];

{_x assignAsCargo heli1} forEach units myGrp1;
{_X moveInCargo heli1} forEach units myGrp1;
heli1 setVariable ["LandingDone",false];
[heli1,_landingData,[heli1,"LandingDone"]] spawn BIS_fnc_UnitPlay;

waitUntil{heli1 getVariable "LandingDone"};
{doGetOut _X} forEach units myGrp1;
sleep 5;
heli1 lock true;
heli1 flyinheight 200;
heli1 domove (getmarkerpos "wp0");
sleep 5;
heli1 domove (position wp1);

Share this post


Link to post
Share on other sites
Would be cool if someone can tell me why "UnitPlay" dont works here:

_landingData = [[0,[>to many stuff<]]];

{_x assignAsCargo heli1} forEach units myGrp1;
{_X moveInCargo heli1} forEach units myGrp1;
heli1 setVariable ["LandingDone",false];
[heli1,_landingData,[heli1,"LandingDone"]] spawn BIS_fnc_UnitPlay;

waitUntil{heli1 getVariable "LandingDone"};
{doGetOut _X} forEach units myGrp1;
sleep 5;
heli1 lock true;
heli1 flyinheight 200;
heli1 domove (getmarkerpos "wp0");
sleep 5;
heli1 domove (position wp1);

I don't script much, so I might be completely missing it. But in:

{_x assignAsCargo heli1} forEach units myGrp1;
{_X moveInCargo heli1} forEach units myGrp1;

I see you use a lowercase _x, but then everywhere else after you use a capital _X.

Was that intentional?

Share this post


Link to post
Share on other sites

Alright, got it to work. Thanks Big Dawg! Airshow tonight :D haha

Share this post


Link to post
Share on other sites

Here's a neat tip:

You can create really nice aircraft formations by capturing one unit, playing it back and capturing a second while following the 1st one in formation.

Just make sure you get the timing right when you start the playback on the 2nd aircraft. Too soon and they could collide.

Share this post


Link to post
Share on other sites

Ok, i got i working to ! :)

But in MP the helicopter stutters on his way badly...not during my testing in the Editor.

Any ideas ?

Share this post


Link to post
Share on other sites

Well, you could try reducing the number of frames/sec you capture/play it at, but it probably was designed to be used mainly in SP.

Share this post


Link to post
Share on other sites

Plz post your scripts (excluding recorded data) here, so people could have examples how to use it.

eg. I still can't get past setting working variable for the end of play.

Share this post


Link to post
Share on other sites
Well, you could try reducing the number of frames/sec you capture/play it at, but it probably was designed to be used mainly in SP.

No i dont think so.

You can play the campaigne in MP too...and there are also these captures Helo insertions...and they work without stuttering.

Share this post


Link to post
Share on other sites

Hmm, good point. Take a look at the campaign missions then and see how they call the functions and what kind capture/play speed they use.

Share this post


Link to post
Share on other sites

I think it has something to do with OPT:StartTime

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

And i was not able to capture fireed weapons of aircrafts, the impact is not shown but OPT:Firing is true !

Any ideas ?

Share this post


Link to post
Share on other sites

When you are done capturing with firing enabled, you have two options.

F1 copies the movement data

F2 copies fired data

But that's all I know. I haven't tried the firing yet.

Share this post


Link to post
Share on other sites

I cant wait to see some videos with this being used, im sure someone can put there skills to the test ^^

Share this post


Link to post
Share on other sites
I think it has something to do with OPT:StartTime

And i was not able to capture fireed weapons of aircrafts, the impact is not shown but OPT:Firing is true !

Any ideas ?

As Big Dawk KS said, when you're done recording with fire data, F1 will copy movement data without firing data, F2 will copy fire data without movement data.

To play back what you just did, you launch movement data with UnitPlay, and firing data with UnitPlayFiring. Take a look at the example I posted on page 3 to see what I mean.

Share this post


Link to post
Share on other sites

Havent got the UnitPlay function working yet. Could that example be reposted as it has run out of downloads

Share this post


Link to post
Share on other sites

I'm gonna guess this is how BIS did the insertion at the beginning of Coltan Blues? It always seemed far too smooth and fast to be completely AI controlled. I could never replicate it without these commands.

Share this post


Link to post
Share on other sites

The BIS_fnc_UnitCapture/UnitPlay seem to be not working at all. The game freezed.

Share this post


Link to post
Share on other sites
The BIS_fnc_UnitCapture/UnitPlay seem to be not working at all. The game freezed.

Works perfectly fine here. Checked your .rpt file?

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  

×