ARMA3 mission replay script (working but wip)
CBA, ACE3
#include "node_modules\@gruppe-adler\replay\ui\defines.hpp"
#include "node_modules\@gruppe-adler\replay\ui\dialog.hpp"
// if CfgFunctions already exists, just put the #include part inside
class CfgFunctions {
#include "node_modules\@gruppe-adler\replay\cfgFunctions.hpp"
};
[] call GRAD_replay_fnc_init;
Must be executed on server only!
// stops record, sends data and starts replay
call GRAD_replay_fnc_stopRecord;
// ends mission after replay is over
[{
REPLAY_FINISHED
}, {
["END1"] remoteExec ["endMission",0,false]; // your custom end mission call or whatever you want to do after replay
}, []] call CBA_fnc_waitUntilAndExecute;
Optionally configure grad-replay by adding the following to your missionconfig (description.ext
):
class GRAD_Replay {
precision = 5; // precision of replay, 5 means every 5 seconds one snapshot (number)
trackedSides[] = {"west", "east", "civilian"}; // defines the sides that will be tracked (possible are "west", "east", "independent", "civilian") (array)
stepsPerTick = 1; // defines steps played back at once (number)
trackedVehicles = 0; // defines if empty and AI steered vehicles will be tracked (0/1)
trackedAI = 0; // defines if AI will be tracked (0/1)
sendingChunkSize = 10; // higher number means replay loading is faster, but might cause instability / lags during loading (number)
trackShots = 0; // defines if shots will be tracked (0/1)
upload = 1; // defines if replay data will be uploaded to replay.gruppe-adler.de (0/1)
};
Note that for the upload setting to have an effect, you need to have grad-replay-intercept (and the Intercept mod) loaded on your server. Check the repo's README to see how to configure it to upload to your server.
define grad_replay_color global variable on a unit as a callback that returns a color in the format [<red>, <green>, <blue>, <opacity>]
, each value a number from the interval 0..1
example:
_unit setVariable ["grad_replay_color", {[[0.0, 0.9, 1.0, 0.8]}, true];
you can change the color anytime during the mission to cause the color to change during replay. NOTE: color will be adjusted automatically for incapacitation & death
Currently there is no helper function to resume normal gameplay after replay has played, this means all assets will be frozen and TFAR spectator channel will be set for all players, furthermore every wound will be healed and all spectator cams left.
to pause recording, set GRAD_REPLAY_RECORDING_PAUSED
to true on server / false to resume