Skip to content

Commit

Permalink
1.6.5.0 (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnb432 authored Feb 4, 2024
1 parent b98f76a commit 4aaf485
Show file tree
Hide file tree
Showing 78 changed files with 5,409 additions and 1,060 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Changelog for Zeus Additions 4.2.2024

1.6.5.0
- Added "Garrison Building" module that allows Zeuses to easily garrison buildings with units of their choosing.
- Added "AI Driver" module that allows Zeuses to spawn AI drivers for vehicles with player commanders.
- Removed ACE Medical Menu and Cargo Menu modules, as they are now part of ACE 3.16.2.
- Removed "Enable leave unconscious unit" feature, as it's no longer needed.
- Removed "Enable JIP feature" CBA setting, it's now enabled by default.
- Fixed several bugs.

# Changelog for Zeus Additions 30.10.2023

1.6.4.0
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
**Zeus Additions** is a client side mod and adds a handful of modules to the Zeus interface, some of which can also be found in the context menu from ZEN (default keybind: 'V'). Requires ZEN on all clients.
**Zeus Additions** is a client side mod and adds a handful of modules to the Zeus interface, some of which can also be found in the context menu from ZEN (default keybind: 'V'). Requires ZEN on all clients. ACE is optional.

<h2>Modules</h2>

Expand All @@ -7,6 +7,7 @@
* **ACE Medical Injuries:** Allows the Zeus to create ACE Medical injuries on AI or players, either dead or alive. Also can create random wounds, taking a damage value and type you are able to set. Random damage can only be applied to a living unit.
* **ACE Medical Resupply:** Spawns an ACE medical resupply. If the module is placed on an object, it can put the resupply in the inventory of the object and clear out the inventory prior to that if wanted.
* **AI Crew Behaviour:** Can prevent AI from dismounting in combat and also when their vehicle is immobilized. Allows the Zeus to change if AI can turn out or not.
* **AI Driver:** Allows the Zeus to spawn AI drivers for vehicles with player commanders.
* **Ammo Resupply for Players:** Spawns a magazine resupply using the unit's or units weapons. A unit is either chosen by placing the module on the unit or the choosing a player from the menu. If the module is placed on an object, it can put the resupply in the inventory of the object and clear out the inventory prior to that if wanted. It can use a blacklist which can be defined in the CBA settings. Supports the FK arsenal blacklist.
* **Ammo Resupply for Players (Selection):** Spawns a magazine resupply using the list predefined in the CBA settings and another UI that is opened after the first window which allows the Zeus to pick magazines in a more precise fashion for resupplying given units. If no units are specified, it will show all groups of magazines. If the module is placed on an object, it can put the resupply in the inventory of the object and clear out the inventory prior to that if wanted.
* **Attack Dog:** Spawns a dog that can attack specific sides. This module can also spawn a peaceful dog.
Expand All @@ -17,6 +18,7 @@
* **Delete Object (Forced):** Allows the Zeus to delete an object when he gets the "insufficient resources" error when trying to delete an object.
* **Dust Storm:** Allows the Zeus to apply a dust storm script to players.
* **End Scenario:** Ends the mission with all players (except Zeuses) having the chosen modifier applied to them.
* **Garrison Building:** Allows the Zeus to easily garrison buildings with units of their choosing.
* **Grass Rendering:** Allows the Zeus to change grass rendering on players. Use Low (Off) to turn off grass completely, Standard is recommended if you wish to turn it on (The others are there in case you want to use them).
* **Loadout: Apply to Group:** Applies predetermined loadouts to the entire group of unit that the module was placed on. It will try to apply various loadouts based on their roles (it will try at least, as there no good way of determining an exact role as it isn't very precise).
* **Loadout: Apply to Single Unit:** Applies a predetermined loadout to a single unit. If that loadout isn't defined, it will fall back onto the group defined loadouts.
Expand Down Expand Up @@ -45,9 +47,10 @@ Inputs are arrays of strings.
* **Blacklist:** Allows the user to set up a list of ammo that won't be put in the resupply using the "Spawn Ammo Resupply for unit" module.
* **X Ammunition:** Allows the user to set up custom arrays of ammunition to give to users using the "Spawn Ammo Resupply" module.
* **Enable automatic blacklist detection for FK servers:** FK is a gaming community.
* **Enable leave unconscious unit:** Allows the user to leave an unconscious remote controlled unit when pressing the ESCAPE key. Handy for people who have their Zeus key bound to a double tap.
* **Enable no curator found hint:** If enabled, it will hint if no curator was found for JIP and object counter features.
* **Enable ACE Dragging missing addon hint:** If enabled, it will hint if ACE Dragging is missing.
* **Enable ACE Medical missing addon hint:** If enabled, it will hint if ACE Medical is missing.
* **Enable TFAR missing addon hint:** If enabled, it will hint if TFAR is missing.
* **Enable RHS missing addon hint:** If enabled, it will hint if RHS is missing.
* **Enable JIP features:** If enabled, it will add JIP functionality to the server, if the player is a curator.
* **Enable Building Destruction handling:** If enabled, it will make floating objects near a building upon destruction fall to the ground.
* **Enable Mission Object Counter:** This will only work if the player is a curator. If enabled, it will count what you have placed down as a curator. If disabled, it will remove the counter, but not reset it.
Expand Down Expand Up @@ -90,6 +93,7 @@ Only 1 client needs it to be enabled for it to be added to the server. If multip
* Compiling functions script by commy2 (CBA), modified by johnb43
* Sanitise functions script by BadGuy (CLib), modified by johnb43
* Thanks to [sh4rdknight](https://gitlab.com/sh4rdknight) for enduring testing sessions
* Thanks to the ZEN team for making ZEN!
* Mod by johnb43

<h2>License</h2>
Expand Down
5 changes: 4 additions & 1 deletion README_steam.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[b]Zeus Additions[/b] is a client side mod and adds a handful of modules to the Zeus interface, some of which can also be found in the context menu from ZEN (default keybind: 'V'). Requires ZEN on all clients.
[b]Zeus Additions[/b] is a client side mod and adds a handful of modules to the Zeus interface, some of which can also be found in the context menu from ZEN (default keybind: 'V'). Requires ZEN on all clients. ACE is optional.

[h2]Modules[/h2]
[list]
Expand All @@ -7,6 +7,7 @@
[*] ACE Medical Injuries
[*] ACE Medical Resupply
[*] AI Crew Behaviour (does not work fully with ACE Vehicle Damage enabled)
[*] AI Driver
[*] Ammo Resupply for Players
[*] Ammo Resupply for Players (Selection)
[*] Attack Dog
Expand All @@ -17,6 +18,7 @@
[*] Delete Object (Forced)
[*] Dust Storm
[*] End Scenario
[*] Garrison Building
[*] Grass Rendering
[*] Loadout: Apply to Group
[*] Loadout: Apply to Single Unit
Expand Down Expand Up @@ -66,6 +68,7 @@ This mod also adds:
[*] Compiling functions script by commy2 (CBA), modified by johnb43
[*] Sanitise functions script by BadGuy (CLib), modified by johnb43
[*] Thanks to [url=https://gitlab.com/sh4rdknight]sh4rdknight[/url] for enduring testing sessions
[*] Thanks to the ZEN team for making ZEN!
[*] Mod by johnb43
[/list]

Expand Down
12 changes: 4 additions & 8 deletions addons/main/CfgContext.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#if __has_include("\z\ace\addons\zeus\script_component.hpp")
#define ICON_PARADROP "\z\ace\addons\zeus\ui\Icon_Module_Zeus_ParadropCargo_ca.paa"
#else
#define ICON_PARADROP "x\zen\addons\modules\ui\heli_ca.paa"
#endif
#pragma hemtt flag pe23_ignore_has_include

class zen_context_menu_actions {
class GVAR(disablePathingContextMenu) {
Expand All @@ -23,11 +19,11 @@ class zen_context_menu_actions {

#if __has_include("\z\ace\addons\medical_gui\script_component.hpp")
class GVAR(openMedicalMenuContextMenu) {
condition = QUOTE(zen_common_aceMedical && {_hoveredEntity isEqualType objNull} && {([ARR_2(_hoveredEntity,effectiveCommander _hoveredEntity)] select (alive _hoveredEntity)) isKindOf 'CAManBase'});
condition = QUOTE(_hoveredEntity isEqualType objNull && {_hoveredEntity = ([ARR_2(_hoveredEntity,effectiveCommander _hoveredEntity)] select (alive _hoveredEntity)); _hoveredEntity isKindOf 'CAManBase'} && {[ARR_2(objNull,_hoveredEntity)] call ace_medical_gui_fnc_canOpenMenu});
displayName = CSTRING_ACE(medical_GUI,openMedicalMenu);
icon = ICON_MEDICAL;
priority = 50;
statement = QUOTE([ARR_2([ARR_2(_hoveredEntity,effectiveCommander _hoveredEntity)] select (alive _hoveredEntity),MEDICAL_MENU)] call FUNC(openACEMenu));
statement = QUOTE(([ARR_2(_hoveredEntity,effectiveCommander _hoveredEntity)] select (alive _hoveredEntity)) call ace_medical_gui_fnc_openMenu);
};
#endif

Expand All @@ -38,7 +34,7 @@ class zen_context_menu_actions {
priority = 10;

class GVAR(selectParadropUnitsContextMenu) {
condition = QUOTE(_objects findIf {alive _x && {_x isKindOf 'CAManBase'} && {!(_x isKindOf 'VirtualCurator_F')}} != -1);
condition = QUOTE(_objects findIf {alive _x && {_x isKindOf 'CAManBase'} && {getNumber ((configOf _x) >> 'isPlayableLogic') == 0}} != -1);
displayName = CSTRING(selectParadropUnitsContextMenu);
icon = ICON_PARADROP;
statement = QUOTE([ARR_2(_objects,PARADROP_UNITS)] call FUNC(unitParadropContextMenu));
Expand Down
2 changes: 1 addition & 1 deletion addons/main/CfgVersioning.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class CfgSettings {
class Versioning {
class PREFIX {
class Dependencies {
ACE[] = {"ace_main", {3, 16, 0}, QUOTE(isClass (configFile >> 'CfgPatches' >> 'ace_main'))};
ACE[] = {"ace_main", {3, 16, 2}, QUOTE(isClass (configFile >> 'CfgPatches' >> 'ace_main'))};
CBA[] = {"cba_main", {3, 16, 0}, "true"};
ZEN[] = {"zen_main", {1, 14, 0}, "true"};
};
Expand Down
10 changes: 5 additions & 5 deletions addons/main/XEH_PREP.hpp
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
PREP(compileSanitisedFunction);
PREP(createResupplyGUI);
PREP(exitUnconsciousUnit);
PREP(getRespawnTime);
PREP(getRole);
PREP(globalEventJIP);
PREP(logCuratorObjects);
PREP(objectsCounterMissionEH);
PREP(openACEMenu);
PREP(pathingCondition);
PREP(pathingStatement);
PREP(removeGlobalEventJIP);
PREP(sanitiseFunction);
PREP(switchUnitStart);
PREP(switchUnitStop);
PREP(unitParadropContextMenu);

PREP(gui_createResupply);
PREP(gui_garrisonBuilding);

// 'PREP_MP' requires 'FUNC(compileSanitisedFunction)'
PREP_MP(init);

PREP_MP(changeReason);
PREP_MP(handleBuildingDestruction);
PREP_MP(handleJIP);
71 changes: 24 additions & 47 deletions addons/main/XEH_postInit.sqf
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#include "script_component.hpp"

// Macros don't like commas in strings
INFO_ZA(FORMAT_2(QUOTE(PostInit: didJIP: ARR_2(%1,Functions) sent: %2),didJIP,!isNil QGVAR(functionsSent)));
INFO_2("PostInit: didJIP: %1 - Functions sent: %2",didJIP,!isNil QGVAR(functionsSent));

// Execute init for everyone and JIP if init hasn't been run yet
if (!isServer && {isNil QGVAR(functionsSent)}) then {
SEND_MP(init);
remoteExecCall [QFUNC(init), 0, QGVAR(initJIPId)];
// Execute init for everyone and JIP
if (isNil QGVAR(functionsSent)) then {
["zen_common_execute", [FUNC(init), []], QGVAR(initJipID)] call CBA_fnc_globalEventJIP;
};

if (!hasInterface) exitWith {};
Expand All @@ -21,20 +20,20 @@ if (!hasInterface) exitWith {};
["zen_curatorDisplayLoaded", {
[_thisType, _thisId] call CBA_fnc_removeEventHandler;

// Add the JIP & building destruction functionality; If CBA settings haven't been initialised yet, just let CBA settings handle reason changing
// Add the building destruction functionality; If CBA settings haven't been initialised yet, just let CBA settings handle reason changing
if (GETMVAR("CBA_settings_ready",false)) then {
private _uid = getPlayerUID player;

[QGVAR(JIP), _uid, GVAR(enableJIP), QFUNC(handleJIP)] call FUNC(changeReason);
[QGVAR(buildingDestruction), _uid, GVAR(enableBuildingDestructionHandling), QFUNC(handleBuildingDestruction)] call FUNC(changeReason);
[QGVAR(buildingDestruction), getPlayerUID player, GVAR(enableBuildingDestructionHandling), QFUNC(handleBuildingDestruction)] call FUNC(changeReason);
};

// Add Drag Bodies module
if (zen_common_aceMedical && {!isNil "ace_medical_treatment"} && {!isNil "ace_dragging"}) then {
if (!isNil "ace_dragging") then {
#include "modules\module_dragBodies.sqf"
};
}] call CBA_fnc_addEventHandlerArgs;

// Add functionality
#include "modules\functionality_dragBodies.sqf"

// Add modules
#include "modules\module_behaviourCrew.sqf"
#include "modules\module_captive.sqf"
Expand All @@ -46,6 +45,7 @@ if (!hasInterface) exitWith {};
#include "modules\module_deleteZeus.sqf"
#include "modules\module_dogAttack.sqf"
#include "modules\module_dustStorm.sqf"
#include "modules\module_garrisonBuilding.sqf"
#include "modules\module_gearScript.sqf"
#include "modules\module_grassRender.sqf"
#include "modules\module_mapMarkers.sqf"
Expand All @@ -65,33 +65,18 @@ if (!hasInterface) exitWith {};
private _cfgPatches = configFile >> "CfgPatches";
GVAR(ACEClipboardLoaded) = isClass (configFile >> "ACE_Extensions" >> "ace_clipboard");

// Check if ACE Cargo is loaded
if (!isNil "ace_cargo") then {
#include "modules\module_unloadACECargo.sqf"
};

// Check if ACE Dragging is loaded
if (!isNil "ace_dragging") then {
#include "modules\module_dragAndCarry.sqf"

if (zen_common_aceMedical && {!isNil "ace_medical_treatment"}) then {
#include "modules\functionality_dragBodies.sqf"
};
};

// Check if ACE Medical is loaded
if (zen_common_aceMedical) then {
// Check if ACE Medical components are loaded
if (!isNil "ace_medical_damage") then {
#include "modules\module_createInjuries.sqf"
};

// If KAT is not loaded, load medical menu module
if (isNil "kat_zeus") then {
#include "modules\module_medicalMenu.sqf"
};

// Check if ACE Medical Treatment is loaded
if (!isNil "ace_medical_treatment") then {
#include "modules\module_createResupplyMedical.sqf"
};
if (zen_common_aceMedicalTreatment) then {
#include "modules\module_createResupplyMedical.sqf"
};

// Check if TFAR is loaded
Expand All @@ -108,22 +93,12 @@ if (isClass (_cfgPatches >> "rhs_main_loadorder")) then {
// Hint what is missing once CBA settings have been loaded
["CBA_settingsInitialized", {
private _cfgPatches = configFile >> "CfgPatches";
private _notificationArray = ["[Zeus Additions]:"];

// Check if ACE Cargo is loaded
if (isNil "ace_cargo") then {
private _string = LLSTRING(aceCargoMissing);
INFO_ZA(_string);

if (GVAR(enableACECargoHint)) then {
_notificationArray pushBack _string;
};
};
private _notificationArray = [];

// Check if ACE Dragging is loaded
if (isNil "ace_dragging") then {
private _string = LLSTRING(aceDraggingMissing);
INFO_ZA(_string);
INFO(_string);

if (GVAR(enableACEDragHint)) then {
_notificationArray pushBack _string;
Expand All @@ -133,7 +108,7 @@ if (isClass (_cfgPatches >> "rhs_main_loadorder")) then {
// Check if ACE Medical is loaded
if (!zen_common_aceMedical) then {
private _string = LLSTRING(aceMedicalMissing);
INFO_ZA(_string);
INFO(_string);

if (GVAR(enableACEMedicalHint)) then {
_notificationArray pushBack _string;
Expand All @@ -143,7 +118,7 @@ if (isClass (_cfgPatches >> "rhs_main_loadorder")) then {
// Check if TFAR is loaded
if (!isClass (_cfgPatches >> "tfar_core") && {!isClass (_cfgPatches >> "task_force_radio")}) then {
private _string = LLSTRING(tfarMissing);
INFO_ZA(_string);
INFO(_string);

if (GVAR(enableTFARHint)) then {
_notificationArray pushBack _string;
Expand All @@ -153,15 +128,17 @@ if (isClass (_cfgPatches >> "rhs_main_loadorder")) then {
// Check if RHS AFRF is loaded
if (!isClass (_cfgPatches >> "rhs_main_loadorder")) then {
private _string = LLSTRING(rhsMissing);
INFO_ZA(_string);
INFO(_string);

if (GVAR(enableRHSHint)) then {
_notificationArray pushBack _string;
};
};

// Hint what is missing if wanted
if ((count _notificationArray) == 1) exitWith {};
if (_notificationArray isEqualTo []) exitWith {};

_notificationArray insert [0, ["[Zeus Additions]:"]];

{
systemChat _x;
Expand Down
11 changes: 1 addition & 10 deletions addons/main/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@ ADDON = false;

#include "XEH_PREP.hpp"

// Macros don't like commas in strings
INFO_ZA(FORMAT_2(QUOTE(PreInit: Net mode: ARR_2(%1,Functions) sent: %2),call BIS_fnc_getNetMode,!isNil QGVAR(functionsSent)));

// Execute init for everyone and JIP if init hasn't been run yet
if (isServer && {isNil QGVAR(functionsSent)}) then {
SEND_MP(init);
remoteExecCall [QFUNC(init), 0, QGVAR(initJIPId)];
};

// Default arrays for ammunition choice
GVAR(LATBLU) = ["UK3CB_BAF_AT4_CS_AP_Launcher","UK3CB_BAF_AT4_CS_AT_Launcher","rhs_weap_M136","rhs_weap_M136_hedp","rhs_weap_M136_hp","rhs_weap_m72a7"];
GVAR(LATRED) = ["rhs_weap_rpg18","rhs_weap_rpg26","rhs_weap_rshg2","rhs_weap_m80","rhs_weap_rpg75"];
Expand All @@ -29,6 +20,6 @@ GVAR(AARED) = ["rhs_mag_9k38_rocket","Titan_AA"];
GVAR(magsTotal) = [];

// CBA Settings
#include "initSettings.sqf"
#include "initSettings.inc.sqf"

ADDON = true;
6 changes: 3 additions & 3 deletions addons/main/XEH_preStart.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ if (hasInterface) then {

// Add magazinewells and magazines themselves to hashmap only if it has items
if (_magazinesList isNotEqualTo createHashMap) then {
_magazinesHashmap set [toLowerANSI configName _x, keys _magazinesList];
_magazinesHashmap set [configName _x, keys _magazinesList];
};
} forEach configProperties [configFile >> "CfgMagazineWells", "isClass _x", true];

// Store hashmap with all info necessary
// Store hashmap with all necessary info
SETUVAR(QGVAR(magazinesHashmap),_magazinesHashmap);

private _keys = keys _magazinesHashmap;

// Sort alphabetically
_keys sort true;

SETUVAR(QGVAR(sortedKeys),_keys);
SETUVAR(QGVAR(sortedKeysMagazinesCache),_keys);
};
4 changes: 1 addition & 3 deletions addons/main/addon.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
[rapify]
exclude = [
"/addons/main/config.cpp"
]
enabled = true

[binarize]
enabled = true
Expand Down
5 changes: 1 addition & 4 deletions addons/main/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ class CfgPatches {
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {
"A3_Data_F_AoW_Loadorder",
"cba_main",
"cba_xeh",
"zen_main",
"zen_context_actions",
"zen_modules"
};
author = "johnb43";
Expand Down
Loading

0 comments on commit 4aaf485

Please sign in to comment.