Jump to content
Sign in to follow this  
Big Dawg KS

[OA] UnitCapture & UnitPlay Functions

Recommended Posts

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

Remember to execuite them with spawn and not call.

Share this post


Link to post
Share on other sites
Guest

Ok, can someone help me out here please? I am absolutely baffled, would it be possible to just post a really simple step by step instruction of what to do?

I have successfully recorded all the data I want, that was no problem. I now have 2 different notepad documents, one with the movement data, and one with the fire data.

I got that far, and now I can't get anything else to work. What exactly do I do with this data? And then how do I get it to play back?

I am really frustrated, I am new to all this scripting stuff and it is soooooo frustrating lol!

Thanks!

Share this post


Link to post
Share on other sites

In the "script.sqf":

_unitPlayback = Walloftext-rememberbracketattheend-->;

_fireData = firedatawalloftext-rememberbracketattheend-->;

[heliname, _unitPlayback] spawn BIS_fnc_UnitPlay;

[heliname, _fireData] spawn BIS_fnc_UnitPlayFiring;

in the init.sqf:

MyPath = compile preprocessFile "script.sqf";

Call with:

result = [] call MyPath;

Share this post


Link to post
Share on other sites
Guest

Thank you very much, all working now :)

Share this post


Link to post
Share on other sites

This is the most amazing thing i´ve seen in a long time! Just trying out sniperwolf´s demo mission for the first time but i already know exactly what i´m going to do with it!

:yay:

Two questions:

1) does unitcapture work in MP, i.e. for gunner & pilot of vehicle x?

2) is there a function to detect if an object is illuminated by IR laser?

btw. in the demo mission i activated 0-0-1 (Help) and was left helpless :p

Edited by Mr Burns

Share this post


Link to post
Share on other sites

btw. in the demo mission i activated 0-0-1 (Help) and was left helpless :p

It should just activate the BIS_fnc_help function, it wasn't supposed to give you any assistance, it's just a leftover of something I use when mission making. :p

(tho if you find the relevant functions in it, they contain a pretty good reference on how to them in their headers)

Share this post


Link to post
Share on other sites

hi ,how works setVariable and waitUntil getVariable ?,

I have two scenes that works

I wish I had two scenes that are played one after the other

I have currently one scenes works and the second does not start

init.sqf

_missionScopeGroup = createGroup sideLogic; 
"Logic" createUnit [[10,10,0], _missionScopeGroup, "BIS_missionScope = this"];
publicVariable "BIS_missionScope";

BIS_missionScope setVariable ["b52Landing1Seq_Done", false];
BIS_missionScope setVariable ["f35show", false];


BIS_b52 = compile preprocessFile "b52_landing1.sqf"; 
BIS_f35 = compile preprocessFile "f35a.sqf";

nul=[] execVM "meating.sqf";

hint "test go";

f35a.sqf

[] Spawn {
_targetUnit = f35;

_capturedData = 
Data of reccord..................

[_targetUnit, _capturedData, [bIS_missionScope, "f35show"], true, false] spawn BIS_fnc_UnitPlay;

[f35b] exec "STblue.sqs"; 
[f35a] exec "STred.sqs";
[f35] exec "STwhight.sqs";	


waitUntil {(BIS_missionScope getVariable "f35show")};

_targetUnit setPos [random 50,random 50,100 + random 100];
_targetUnit setVelocity [0,0,0];
_targetUnit enableSimulation false;
_targetUnit hideObject true;
};


meating.sqf

result = [] call BIS_f35;


waitUntil {(BIS_missionScope getVariable "f35show")};


result = [] call BIS_b52;

b52_landing1.sqf

[] Spawn {
_targetUnit = b52;

_capturedData = 
[[10,[5553.03,8809.94,518.416],[-0.526402,0.850006,-0.0197574],.........etc

[_targetUnit, _capturedData, [bIS_missionScope, "b52Landing1Seq_Done"], true, false] spawn BIS_fnc_UnitPlay;

waitUntil {(BIS_missionScope getVariable "b52Landing1Seq_Done")};

b52_landing_1_Pilot assignAsDriver _targetUnit;
b52_landing_1_Pilot moveInDriver _targetUnit;
b52_landing_1_Pilot action ["engineOff", _targetUnit];
}

Edited by Powel

Share this post


Link to post
Share on other sites

ok so can a f35 do a vertical take off I record it and make harriers work (clears his throat)

haa hmmm you know they way they should,

I want to make the AI do it and Im having an issue with it.

Share this post


Link to post
Share on other sites
ok so can a f35 do a vertical take off I record it and make harriers work (clears his throat)

haa hmmm you know they way they should,

I want to make the AI do it and Im having an issue with it.

The AV-8B Harriers max vertical take off weight is around 20,000lb, whilst it's standard loaded weight is around 22000lb.. With a combat load on board, the Harrier needs a short roll..

Share this post


Link to post
Share on other sites
Here and here.

Failed and Failed, why do people keep using rapidshare?

Its worthless, use mediafire or filefront.

Two great places that keep your files for free and have very fast speeds.

Heres the permanent uploaded file - http://www.mediafire.com/file/fzw0mfrindqnwzn/capture.Zargabad.zip

Edited by Toasticuss

Share this post


Link to post
Share on other sites

Just how cool is this, another thing to get my head around. Damn you BI!!! :p

Share this post


Link to post
Share on other sites

wow this is really impressive, and I'm 12 days late! I havent tried this yet, but has anyone tried translating or transforming the data and replaying it? I guess I'm basing this on the assumption the data is recorded trajectories or gestures against time?

cheers

Share this post


Link to post
Share on other sites

This is cool!

I could have used this last night when the best I could muster was to set a waypoint that crashes the heli on top of a building.

Share this post


Link to post
Share on other sites
wow this is really impressive, and I'm 12 days late! I havent tried this yet, but has anyone tried translating or transforming the data and replaying it? I guess I'm basing this on the assumption the data is recorded trajectories or gestures against time?

cheers

Each frame contains a time, a position, and direction vectors. I suppose if you know the math well enough you could transform the data, it might take some noticeable time to compute if your data is really large.

Share this post


Link to post
Share on other sites

Im lost with this absolutely amazing thing. Its not working for me at all.

I cant even capture my moves.

I would like to make this http://forums.bistudio.com/showthread.php?t=104351.

So Mighty Big Dawg recommended me his topic and I Want this So baaad.

So, I need to capture my fly with hercules and I need it to capture from very beggining for 100 seconds. I tried to watch all triggers in demo mission Capture, but did not work at all ...

Im lost....

Share this post


Link to post
Share on other sites

Okay I'm a complete noob at this, but I think I've recorded a movement file, but what do I do with the wall of text that appears in notepad.

All I want to do is make a scripted airstrike at the beginning of my mission for cinematic effect, it would probably be around 30 seconds.

Edited by Ivan2294
To clarify more detail

Share this post


Link to post
Share on other sites
Okay I'm a complete noob at this, but I think I've recorded a movement file, but what do I do with the wall of text that appears in notepad.

All I want to do is make a scripted airstrike at the beginning of my mission for cinematic effect, it would probably be around 30 seconds.

You execute the wall of text file inside of a trigger to play back the data.

Share this post


Link to post
Share on other sites

Whoa! This might be one of the coolest script commands/variables whatever! Though it's quite complicated. I can just imagine, what people will do with this. Great tool for making machinimas and so on... Thanks everyone who posted demo missions or instructions, how to use this awesomeness!

Share this post


Link to post
Share on other sites

ALL YOUR QUESTIONS ARE ANSWERED BY THIS POST ON PAGE 3!!!!!

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.

Half of this thread are questions that are answered by looking into the mission that dude gave us. That's all I did because the rest was too complicated. And see? I just wasted 2 hours of my life flying jets, choppers and Ospreys in low fly bys to enjoy my soundmod n stuff.

LOVE it.

I wonder when BIS will start to make mission-PBOs compressed, you can save a lot of space by compressing all that data.

What FPS are you guys suggesting?

30 is sweet of course, 20 runs smooth still, I did not try anything below. What FPS should I take for what purpose?

Thank you a lot in advance! :)

Share this post


Link to post
Share on other sites

Hello guys.

First off, I would say thank you to BIS for this lovely new script addition!

Secondly, I have just managed to get unitcapture and play to work, by using Big Dawg's sample mission. I'm making a teaser and need some help with use of formation.

Since it uses radio triggers, I will have to manually start all choppers one by one.

My question is, if I want a chopper formation to work together simultaneously, with perhaps the same or not the same path, how do I make this work in a single radio trigger?

I know I need a slight delay on all aircrafts following the leader to avoid a collision, but how do you create this delay for everyone, in a single trigger?

If this does not work, I will have to manually activate the individual paths of every aircraft one by one. This is something I would love to avoid!

Any help would be greatly appreciated!

Regards,

Stuntman

Share this post


Link to post
Share on other sites

What you could do is...

1 radio trigger saying:

variablename = true; publicvariable "variablename";

Then you set up a trigger for each vehicle, in condition you put "variablename".

So what it does is -> "variablename" becomes "true" and you say it to the whole world. The other three triggers are like: "Ah! There is "variablename", my condition is true so I can fire up now!".

I dont know how to set up the delay, maybe like this ->

3 triggers.

1st one (for first chopper) delay 0

2nd - delay 2 sec

3rd - delay 3 sec.

There are those "min" "med" and "max" values somewhere in the trigger, try using those.

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.

Would it be possible to record it once but use it with an offset to play on other units. What I'd really like is the ability to record a flight path but play it form different positions.

Share this post


Link to post
Share on other sites
Would it be possible to record it once but use it with an offset to play on other units. What I'd really like is the ability to record a flight path but play it form different positions.

I dunno, maybe if you applied a transform to all of the frames. You might be able to write a script that goes through the data and applies an offset to it.

Share this post


Link to post
Share on other sites

What's the best way to use this in MP? Would it work fine it you just had the data in an sqf file and called it with play = [chopper1,call compile loadFile "playchopper.sqf"] spawn BIS_fnc_UnitPlay or whatever, or is it better to use Sniperwolf's method?

EDIT

Ok it works fine except the chopper shakes horrendously in 3rd person. I guess I'll look into that FPS option.

Edited by 2nd Ranger

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  

×