Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "\ocap\script_macros.hpp"
- private _isKindOfApc = {
- _bool = false;
- {
- if (_this isKindOf _x) exitWith {_bool = true;};false
- } count ["Wheeled_APC_F","Tracked_APC","APC_Wheeled_01_base_F","APC_Wheeled_02_base_F",
- "APC_Wheeled_03_base_F","APC_Tracked_01_base_F","APC_Tracked_02_base_F","APC_Tracked_03_base_F"];
- _bool
- };
- private _getClass = {
- if (_this isKindOf "Truck_F") exitWith {"truck"}; // Should be higher than Car
- if (_this call _isKindOfApc) exitWith {"apc"};
- if (_this isKindOf "Car") exitWith {"car"};
- if (_this isKindOf "Tank") exitWith {"tank"};
- if (_this isKindOf "StaticMortar") exitWith {"static-mortar"};
- if (_this isKindOf "StaticWeapon") exitWith {"static-weapon"};
- if (_this isKindOf "ParachuteBase") exitWith {"parachute"};
- if (_this isKindOf "Helicopter") exitWith {"heli"};
- if (_this isKindOf "Plane") exitWith {"plane"};
- if (_this isKindOf "Air") exitWith {"plane"};
- if (_this isKindOf "Ship") exitWith {"sea"};
- if (_this isKindOf "TimeBombCore") exitWith {"explosive"};
- "unknown"
- };
- waitUntil{sleep 5.127; (count(allPlayers) >= ocap_minPlayerCount) && (a3a_var_started)};
- ocap_capture = true;
- ocap_startTime = time;
- LOG(ARR3(__FILE__, "ocap_capture start, time:", ocap_startTime));
- private _id = 0;
- {
- private _tempArray = [];
- _playersMarker = toArray _x;
- _playersMarker resize 15;
- _swtMarker = toArray _x;
- _swtMarker resize 6;
- if ((toString _playersMarker != "_USER_DEFINED #") && (toString _swtMarker != "SWT_M#")) then {
- _tempArray pushBack _x;
- _tempArray pushBack (markerText _x);
- _tempArray pushBack (getMarkerType _x);
- _tempArray pushBack (getMarkerPos _x);
- _tempArray pushBack (getMarkerSize _x);
- _tempArray pushBack (getMarkerColor _x);
- _tempArray pushBack (markerBrush _x);
- _tempArray pushBack (markerAlpha _x);
- _tempArray pushBack round(markerDir _x);
- [":EDITORMARKER:CREATE:", _tempArray] call ocap_fnc_extension;
- }
- } forEach allMapMarkers;
- while {ocap_capture} do {
- isNil {
- {
- if !(_x getVariable ["ocap_isInitialised", false]) then {
- if (_x isKindOf "Logic") exitWith {
- _x setVariable ["ocap_exclude", true];
- _x setVariable ["ocap_isInitialised", true];
- };
- _x setVariable ["ocap_id", _id];
- [":NEW:UNIT:", [
- ocap_captureFrameNo, //1
- _id, //2
- name _x, //3
- groupID (group _x), //4
- str side _x, //5
- BOOL(isPlayer _x), //6
- roleDescription _x //7
- ]] call ocap_fnc_extension;
- _x spawn ocap_fnc_addEventHandlers;
- _id = _id + 1;
- _x setVariable ["ocap_isInitialised", true];
- };
- if !(_x getVariable ["ocap_exclude", false]) then {
- _pos = getPosATL _x;
- _pos resize 2;
- [":UPDATE:UNIT:", [
- (_x getVariable "ocap_id"), //1
- _pos, //2
- round getDir _x, //3
- if (alive _x) then {
- BOOL(_x getVariable ["ACE_isUnconscious", false]) + 1
- } else {
- 0
- }, //4
- BOOL(!((vehicle _x) isEqualTo _x)), //5
- if (alive _x) then {name _x} else {""}, //6
- BOOL(isPlayer _x) //7
- ]] call ocap_fnc_extension;
- };
- false
- } count (allUnits + allDeadMen);
- {
- if !(_x getVariable ["ocap_isInitialised", false]) then {
- _vehType = typeOf _x;
- _class = _vehType call _getClass;
- if ((_class isEqualTo "unknown") || (_vehType in ocap_excludeFromRecord)) exitWith {
- LOG(ARR2("WARNING: vehicle is defined as 'unknown' or exclude:", _vehType));
- _x setVariable ["ocap_isInitialised", true];
- _x setVariable ["ocap_exclude", true];
- };
- _x setVariable ["ocap_id", _id];
- [":NEW:VEH:", [
- ocap_captureFrameNo, //1
- _id, //2
- _class, //3
- getText (configFile >> "CfgVehicles" >> _vehType >> "displayName") //4
- ]] call ocap_fnc_extension;
- _x spawn ocap_fnc_addEventHandlers;
- _id = _id + 1;
- _x setVariable ["ocap_isInitialised", true];
- };
- if !(_x getVariable ["ocap_exclude", false]) then {
- private _crew = [];
- {
- if (_x getVariable ["ocap_isInitialised", false]) then {
- _crew pushBack (_x getVariable "ocap_id");
- }; false
- } count (crew _x);
- _pos = getPosATL _x;
- _pos set [2, round(_pos select 2)];
- [":UPDATE:VEH:", [
- (_x getVariable "ocap_id"), //1
- _pos, //2
- round getDir _x, //3
- BOOL(alive _x), //4
- _crew //5
- ]] call ocap_fnc_extension;
- };
- false
- } count vehicles;
- {
- if !(_x getVariable ["ocap_isInitialised", false]) then {
- _ammoType = typeOf _x;
- _class = _ammoType call _getClass;
- if ((_class isEqualTo "unknown") || (_ammoType in ocap_excludeFromRecord)) exitWith {
- LOG(ARR2("WARNING: vehicle is defined as 'unknown' or exclude:", _ammoType));
- _x setVariable ["ocap_isInitialised", true];
- _x setVariable ["ocap_exclude", true];
- };
- _x setVariable ["ocap_id", _id];
- [":NEW:VEH:", [
- ocap_captureFrameNo, //1
- _id, //2
- _class, //3
- _ammoType //4
- ]] call ocap_fnc_extension;
- _x spawn ocap_fnc_addEventHandlers;
- _id = _id + 1;
- _x setVariable ["ocap_isInitialised", true];
- };
- if !(_x getVariable ["ocap_exclude", false]) then {
- private _crew = [];
- _pos = getPosATL _x;
- _pos set [2, round(_pos select 2)];
- [":UPDATE:VEH:", [
- (_x getVariable "ocap_id"), //1
- _pos, //2
- round getDir _x, //3
- BOOL(alive _x), //4
- _crew //5
- ]] call ocap_fnc_extension;
- };
- false
- } count allMines;
- };
- sleep (call ocap_fnc_getDelay);
- ocap_captureFrameNo = ocap_captureFrameNo + 1;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement