Skip to content

Commit

Permalink
additional patameters for mission exporting
Browse files Browse the repository at this point in the history
  • Loading branch information
Zealot111 committed Mar 16, 2021
1 parent 646f40f commit 0160e67
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
8 changes: 5 additions & 3 deletions addons/ocap/functions/fn_addEventMission.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ addMissionEventHandler ["EntityKilled", {
_this call ocap_fnc_eh_killed;
}];

addMissionEventHandler ["MPEnded", {
["Mission ended automatically"] call ocap_fnc_exportData;
}];
if (ocap_saveMissionEnded) then {
addMissionEventHandler ["MPEnded", {
["Mission ended automatically"] call ocap_fnc_exportData;
}];
};

// Add event saving markers
["INIT"] call ocap_fnc_handleMarkers;
Expand Down
6 changes: 5 additions & 1 deletion addons/ocap/functions/fn_exportData.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@ if (count _this == 1) then {
};
[":EVENT:", [ocap_endFrameNo, "endMission", _wmt_info]] call ocap_fnc_extension;

[":SAVE:", [worldName, briefingName, getMissionConfigValue ["author", ""], ocap_frameCaptureDelay, ocap_endFrameNo]] call ocap_fnc_extension;
if (ocap_needToSave) then {
[":SAVE:", [worldName, briefingName, getMissionConfigValue ["author", ""], ocap_frameCaptureDelay, ocap_endFrameNo]] call ocap_fnc_extension;
} else {
LOG(["ocap_needToSave is set to false. Not saving"]);
};
14 changes: 13 additions & 1 deletion addons/ocap/functions/fn_init.sqf
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
#include "\userconfig\ocap\config.hpp"
#include "script_macros.hpp"

ocap_capture = false;
ocap_captureFrameNo = 0;
ocap_needToSave = [false, true] select (ocap_minMissionTime < 10);

// Add event missions
call ocap_fnc_addEventMission;
[":START:", [worldName, briefingName, getMissionConfigValue ["author", ""], ocap_frameCaptureDelay]] call ocap_fnc_extension;
0 spawn ocap_fnc_startCaptureLoop;
0 spawn ocap_fnc_startCaptureLoop;

0 spawn {
if (ocap_needToSave) exitWith {};
LOG(["Waiting freeze end!"]);
waitUntil {sleep 1.4; missionNamespace getVariable["WMT_pub_frzState", 3] >= 3};
LOG(["Waiting until ocap_minMissionTime ends"]);
sleep ocap_minMissionTime;
LOG(["ocap_needToSave is set to true"]);
ocap_needToSave = true;
};
4 changes: 3 additions & 1 deletion userconfig/ocap/config.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
ocap_nameServer = 'TvT';
ocap_minPlayerCount = 60;
ocap_frameCaptureDelay = 1;
ocap_excludeFromRecord = ["ACE_friesAnchorBar"];
ocap_excludeFromRecord = ["ACE_friesAnchorBar"];
ocap_saveMissionEnded = true;
ocap_minMissionTime = 90;

0 comments on commit 0160e67

Please sign in to comment.