Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [Unreleased]
### Fixed
- Make bodybagging work properly again.

## [1.12.0] - 2021-03-30
### Added
- Athena hack to hide other players
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified release/@zeusops/addons/zeusops_addon.pbo
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed release/@zeusops/keys/zeusops-1.12.0.bikey
Binary file not shown.
Binary file added release/@zeusops/keys/zeusops-1.13.0-a1.bikey
Binary file not shown.
10 changes: 10 additions & 0 deletions source/@zeusops/addons/zeusops_addon/XEH_preInit.sqf
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
diag_log "[ZOPS] preInit start";
#include "initSettings.sqf"

// Define functions here early before Athena has a chance to define them
fnc_gatherGroups = compileFinal preprocessFileLineNumbers "\zeusops_addon\athena\gatherGroups.sqf";
fnc_gatherUnits = compileFinal preprocessFileLineNumbers "\zeusops_addon\athena\gatherUnits.sqf";
fnc_gatherVehicles = compileFinal preprocessFileLineNumbers "\zeusops_addon\athena\gatherVehicles.sqf";

[] call zeusops_fnc_define_bodybag_player;
[] call zeusops_fnc_define_bodybag_respawn;
[] call zeusops_fnc_define_force_respawn;
[] call zeusops_fnc_define_move_respawn;
[] call zeusops_fnc_define_spawn_arsenal;
[] call zeusops_fnc_define_spawn_rearm;
[] call zeusops_fnc_define_toggle_respawn;
diag_log "[ZOPS] preInit done";
12 changes: 10 additions & 2 deletions source/@zeusops/addons/zeusops_addon/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ class CfgFunctions
class moduleToggleRespawn;
class respawnPlayer;
class showCuratorMessage;
class define_bodybag_player;
class define_bodybag_respawn;
class define_force_respawn;
class define_move_respawn;
class define_spawn_arsenal;
class define_spawn_rearm;
class define_toggle_respawn;
};
};
};
Expand All @@ -64,12 +71,13 @@ class CfgVehicles
{
class Logic;
class Module_F: Logic {};
class zeusops_ModuleBase : Module_F
class zen_modules_moduleBase;
class zeusops_ModuleBase : zen_modules_moduleBase
{
category="zeusops_modules";
scope=1; // not visible in editor
scopeCurator = 2; // visible in zeus
isGlobal=2; // ran globally
isGlobal=1; // ran globally
functionPriority=1;
isTriggerActivated=0;
isDisposable=1;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
fn_bodybag_player = {
_type = if (isServer) then { "server" } else { format ["player: %1", name player] };
_logic = _this param [0,objNull];
[_logic, _type] remoteExec ["fn_log_owner", 2];
format ["[ZOPS] [fn_bodybag_player] %1, isNull: %2. clientOwner: %3, params: %4", _type, isNull _logic, clientOwner, _this joinString ", "] remoteExec ["diag_log", 2];

// Exit if module wasn't created by this instance
if (!local _logic) exitWith {
"[ZOPS] [fn_bodybag_player] exiting: not local" remoteExec ["diag_log", 2];
};
if (!(_this select 2)) then {
"[ZOPS] [fn_bodybag_player] DEBUG NOT ACTIVE: module not active, continuing" remoteExec ["diag_log", 2];
};
"[ZOPS] [fn_bodybag_player] passed checks" remoteExec ["diag_log", 2];

// Find player
_player = objNull;
_object = _logic call zeusops_fnc_getUnitUnderCursor;
if (_object in allPlayers) then {
_player = _object;
};

// Bodybag if player is found
if (!(isNull _player)) then {
_player setDamage 1;
// Wait a bit for the death to register before bagging
sleep 0.1;
[objNull, _player] call ace_medical_treatment_fnc_placeInBodyBag;
"Bodybagged player" call zeusops_fnc_showCuratorMessage;
} else {
"Module needs to be placed on player" call zeusops_fnc_showCuratorMessage;
};

// Delete module
if (count objectcurators _logic > 0) then {
deletevehicle _logic;
};

true;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
fn_bodybag_respawn = {
_type = if (isServer) then { "server" } else { format ["player: %1", name player] };
_logic = _this param [0,objNull];
[_logic, _type] remoteExec ["fn_log_owner", 2];
format ["[ZOPS] [fn_bodybag_respawn] %1, isNull: %2. clientOwner: %3, params: %4", _type, isNull _logic, clientOwner, _this joinString ", "] remoteExec ["diag_log", 2];

// Exit if module wasn't created by this instance
if (!local _logic) exitWith {
"[ZOPS] [fn_bodybag_respawn] exiting: not local" remoteExec ["diag_log", 2];
};
if (!(_this select 2)) then {
"[ZOPS] [fn_bodybag_respawn] DEBUG NOT ACTIVE: module not active, continuing" remoteExec ["diag_log", 2];
};
"[ZOPS] [fn_bodybag_respawn] passed checks" remoteExec ["diag_log", 2];

_pos = position _logic;

// Find player
_player = objNull;
_object = _logic call zeusops_fnc_getUnitUnderCursor;
if (_object in allPlayers) then {
_player = _object;
};

// Bodybag and respawn if player found
if (!(isNull _player)) then {
_player setDamage 1;
// Wait a bit for the death to register before bagging
sleep 0.1;
[objNull, _player] call ace_medical_treatment_fnc_placeInBodyBag;
[] remoteExec ["zeusops_fnc_respawnPlayer", _player];
"Bodybagged and respawned player" call zeusops_fnc_showCuratorMessage;
} else {
"Module needs to be placed on player" call zeusops_fnc_showCuratorMessage;
};

// Delete module
if (count objectcurators _logic > 0) then {
deletevehicle _logic;
};

true;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
fn_force_respawn = {
_type = if (isServer) then { "server" } else { format ["player: %1", name player] };
_logic = _this param [0,objNull];
[_logic, _type] remoteExec ["fn_log_owner", 2];
format ["[ZOPS] [fn_force_respawn] %1, isNull: %2. clientOwner: %3, params: %4", _type, isNull _logic, clientOwner, _this joinString ", "] remoteExec ["diag_log", 2];

// Exit if module wasn't created by this instance
if (!local _logic) exitWith {
"[ZOPS] [fn_force_respawn] exiting: not local" remoteExec ["diag_log", 2];
};
if (!(_this select 2)) then {
"[ZOPS] [fn_force_respawn] DEBUG NOT ACTIVE: module not active, continuing" remoteExec ["diag_log", 2];
};
"[ZOPS] [fn_force_respawn] passed checks" remoteExec ["diag_log", 2];

// Force respawn wave
missionNameSpace setVariable ["respawnNextWaveTime", 1, true];
"Forced respawn wave" call zeusops_fnc_showCuratorMessage;

// Delete module
if (count objectcurators _logic > 0) then {
deletevehicle _logic;
};

true;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
fn_move_respawn = {
_type = if (isServer) then { "server" } else { format ["player: %1", name player] };
_logic = _this param [0,objNull];
[_logic, _type] remoteExec ["fn_log_owner", 2];
format ["[ZOPS] [fn_move_respawn] %1, isNull: %2. clientOwner: %3, params: %4", _type, isNull _logic, clientOwner, _this joinString ", "] remoteExec ["diag_log", 2];

// Exit if module wasn't created by this instance
if (!local _logic) exitWith {
"[ZOPS] [fn_move_respawn] exiting: not local" remoteExec ["diag_log", 2];
};
if (!(_this select 2)) then {
"[ZOPS] [fn_move_respawn] DEBUG NOT ACTIVE: module not active, continuing" remoteExec ["diag_log", 2];
};
"[ZOPS] [fn_move_respawn] passed checks" remoteExec ["diag_log", 2];

_pos = getPosASL _logic;

// Find object
_object = _logic call zeusops_fnc_getUnitUnderCursor;

if (isNull _object) then {
// Move spawn
missionNameSpace setVariable ["RESPAWN_POSITION", _pos, true];
"Moved Respawn position" call zeusops_fnc_showCuratorMessage;
} else {
// Move spawn to object
missionNameSpace setVariable ["RESPAWN_POSITION", getPosASL _object, true];
"Moved Respawn position to object" call zeusops_fnc_showCuratorMessage;
};

// Delete module
if (count objectcurators _logic > 0) then {
deletevehicle _logic;
};

true;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
fn_log_owner = {
params ["_object", "_type"];
diag_log format ["[ZOPS] [log_owner] type: %1, owner: %2", _type, owner _object];
};
fn_spawn_arsenal = {
_type = if (isServer) then { "server" } else { format ["player: %1", name player] };
_logic = _this param [0,objNull];
[_logic, _type] remoteExec ["fn_log_owner", 2];
format ["[ZOPS] [fn_spawn_arsenal] %1, isNull: %2. clientOwner: %3, params: %4", _type, isNull _logic, clientOwner, _this joinString ", "] remoteExec ["diag_log", 2];

// Exit if module wasn't created by this instance
if (!local _logic) exitWith {
"[ZOPS] [fn_spawn_arsenal] exiting: not local" remoteExec ["diag_log", 2];
};
if (!(_this select 2)) then {
"[ZOPS] [fn_spawn_arsenal] DEBUG NOT ACTIVE: module not active, continuing" remoteExec ["diag_log", 2];
};
"[ZOPS] [fn_spawn_arsenal] passed checks" remoteExec ["diag_log", 2];

_pos = position _logic;

// Find object
_object = _logic call zeusops_fnc_getUnitUnderCursor;

// Spawn arsenal box
if (isNull _object) then {
// Spawn ammobox
_object = createVehicle ["B_supplyCrate_F", _pos, [], 0, "CAN_COLLIDE"];
_object setDir (round random 360);

// Allow zeuses to move the ammobox
[(getAssignedCuratorLogic player),[[_object],true]] remoteExec ["addCuratorEditableObjects", allCurators, true];

[2, _object] spawn ZO_fnc_gearBox;
"Spawned arsenal box" call zeusops_fnc_showCuratorMessage;
} else {
// Make existing object an arsenal box
[2, _object] spawn ZO_fnc_gearBox;
"Made object an arsenal box" call zeusops_fnc_showCuratorMessage;
};

// Delete module
if (count objectcurators _logic > 0) then {
deletevehicle _logic;
};

true;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
fn_spawn_rearm = {
_type = if (isServer) then { "server" } else { format ["player: %1", name player] };
_logic = _this param [0,objNull];
[_logic, _type] remoteExec ["fn_log_owner", 2];
format ["[ZOPS] [fn_spawn_rearm] %1, isNull: %2. clientOwner: %3, params: %4", _type, isNull _logic, clientOwner, _this joinString ", "] remoteExec ["diag_log", 2];

// Exit if module wasn't created by this instance
if (!local _logic) exitWith {
"[ZOPS] [fn_spawn_rearm] exiting: not local" remoteExec ["diag_log", 2];
};
if (!(_this select 2)) then {
"[ZOPS] [fn_spawn_rearm] DEBUG NOT ACTIVE: module not active, continuing" remoteExec ["diag_log", 2];
};
"[ZOPS] [fn_spawn_rearm] passed checks" remoteExec ["diag_log", 2];

_pos = position _logic;

// Find object
_object = _logic call zeusops_fnc_getUnitUnderCursor;

// Spawn rearm box
if (isNull _object) then {
// Spawn ammobox
_object = createVehicle ["B_supplyCrate_F", _pos, [], 0, "CAN_COLLIDE"];
_object setDir (round random 360);

// Allow zeuses to move the ammobox
[(getAssignedCuratorLogic player),[[_object],true]] remoteExec ["addCuratorEditableObjects", allCurators, true];

[3, _object] spawn ZO_fnc_gearBox;
"Spawned rearm box" call zeusops_fnc_showCuratorMessage;
} else {
// Make existing object an rearm box
[3, _object] spawn ZO_fnc_gearBox;
"Made object an rearm box" call zeusops_fnc_showCuratorMessage;
};

// Delete module
if (count objectcurators _logic > 0) then {
deletevehicle _logic;
};

true;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
fn_toggle_respawn = {
_type = if (isServer) then { "server" } else { format ["player: %1", name player] };
_logic = _this param [0,objNull];
[_logic, _type] remoteExec ["fn_log_owner", 2];
format ["[ZOPS] [fn_toggle_respawn] %1, isNull: %2. clientOwner: %3, params: %4", _type, isNull _logic, clientOwner, _this joinString ", "] remoteExec ["diag_log", 2];

// Exit if module wasn't created by this instance
if (!local _logic) exitWith {
"[ZOPS] [fn_toggle_respawn] exiting: not local" remoteExec ["diag_log", 2];
};
if (!(_this select 2)) then {
"[ZOPS] [fn_toggle_respawn] DEBUG NOT ACTIVE: module not active, continuing" remoteExec ["diag_log", 2];
};
"[ZOPS] [fn_toggle_respawn] passed checks" remoteExec ["diag_log", 2];

// Toggle respawn
if (missionNameSpace getVariable "respawnAllow") then {
missionNameSpace setVariable ["respawnAllow", false, true];
[999999] remoteExec ["setPlayerRespawnTime", allPlayers];
"Respawn disabled" call zeusops_fnc_showCuratorMessage;
} else {
missionNameSpace setVariable ["respawnAllow", true, true];
[900] remoteExec ["setPlayerRespawnTime", allPlayers];
"Respawn enabled" call zeusops_fnc_showCuratorMessage;
};

// Delete module
if (count objectcurators _logic > 0) then {
deletevehicle _logic;
};

true;
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

params ["_logic"];

if !(local _logic) exitWith {};
if !(local _logic) exitWith {
diag_log "[ZOPS] [fn_getUnitUnderCursor] exiting: not local";
};

private _unit = attachedTo _logic;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,4 @@
@file_author: Dyzalonius
*/

_logic = _this param [0,objNull];

// Exit if module wasn't created by this instance
if (!local _logic) exitWith {};

_pos = position _logic;

// Find player
_player = objNull;
_object = _logic call zeusops_fnc_getUnitUnderCursor;
if (_object in allPlayers) then {
_player = _object;
};

// Bodybag and respawn if player found
if (!(isNull _player)) then {
_player setDamage 1;
[objNull, _player] call ace_medical_fnc_actionPlaceInBodyBag;
[] remoteExec ["zeusops_fnc_respawnPlayer", _player];
"Bodybagged and respawned player" call zeusops_fnc_showCuratorMessage;
} else {
"Module needs to be placed on player" call zeusops_fnc_showCuratorMessage;
};

// Delete module
if (count objectcurators _logic > 0) then {
deletevehicle _logic;
};

true;
_this call fn_bodybag_respawn;
Loading