Jump to content
Sign in to follow this  
zooloo75

Primitive Recording System

Recommended Posts

Download Example

I've made a very basic system to record a single unit. I thought someone would learn or find some use out of this.

Inside the zip is a mission - it includes the entire system to record, and replay.

It captures position,direction,velocity,vectors, and animations.

Use radio commands to record.

After you have recorded, you need to paste the information that is automatically copied to your clipboard into the appropriate part of info.sqf.

//Info Template

[
the object you are recording (use the editor name),
paste in the recorded info here
] execVM "play.sqf";

Examples of usage would be to get an accurate flight path for a helicopter if the AI lacks the ability to reproduce the movement you require.

This is merely just a resource for those interested in learning scripting.

You are free to modify and release the content - no need to credit me (it's a simple system - anyone can do it :P)

Edited by zooloo75

Share this post


Link to post
Share on other sites

Really nice and really good idea. The only issue is that it is dependent of the FPS the player has. For the animation to play smoothly and for it to be sync on eachclient in MP, each frame should be replayed at a given time and not at a given frame (otherwise it would depend on the video settings/rig of the player, right?). For instance, one could test and adjust _t in this alternative version of your play.sqf:

objPlay = _this select 0;
infoPlay = _this select 1;
curFrame = 0;
_t=0.016;

for [{_k = 0},{_k < count infoplay},{_k = _k + 1}] do {
hint format ["%1",curFrame];
objPlay setPos ((infoPlay select curFrame) select 1);
objPlay setDir ((infoPlay select curFrame) select 2);
objPlay setVelocity ((infoPlay select curFrame) select 3);
objPlay setVectorDir ((infoPlay select curFrame) select 4);
objPlay setVectorUp ((infoPlay select curFrame) select 5);
objPlay playMoveNow ((infoPlay select curFrame) select 6);

sleep _t;
curFrame = curFrame + 1;

};

On issue is that the FPS are not constant during recording (it decreases)...and so _t should increase during the replay...hmm, I'll think about it.

Also, is there a way to record the player actions like firing and so on? It would be pretty cool to be able to record that for scripted missions.

edit:

Best solution so far is to record also every _t seconds and then play each recorded frame every _t' seconds. For some reason, _t' must be bigger than _t and needs to be adjusted...?

Edited by super-truite

Share this post


Link to post
Share on other sites

To record gunfire, add a fired eventhandler on the object you are recording, and have it record the proper info in the record.sqf. Have a var set to 1 if firing, and 0 if not, then have it watch for that in the recording, and it will transfer over in the info. Then have the play script utilize that info.

Share this post


Link to post
Share on other sites

BIS unit play works with on each frame so it doesn't work in mp.

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  

×