From 4dc915522409fb9e59388870fd323454152bc98e Mon Sep 17 00:00:00 2001 From: oOKexOo Date: Thu, 28 May 2020 01:09:31 +0200 Subject: [PATCH 01/13] Unlock malaria civs --- addons/characters/$PBOPREFIX$ | 1 + addons/characters/CfgEditorSubcategories.hpp | 5 ++ addons/characters/CfgVehicles.hpp | 69 ++++++++++++++++++++ addons/characters/config.cpp | 21 ++++++ addons/characters/script_component.hpp | 12 ++++ addons/characters/stringtable.xml | 15 +++++ 6 files changed, 123 insertions(+) create mode 100755 addons/characters/$PBOPREFIX$ create mode 100755 addons/characters/CfgEditorSubcategories.hpp create mode 100755 addons/characters/CfgVehicles.hpp create mode 100755 addons/characters/config.cpp create mode 100755 addons/characters/script_component.hpp create mode 100755 addons/characters/stringtable.xml diff --git a/addons/characters/$PBOPREFIX$ b/addons/characters/$PBOPREFIX$ new file mode 100755 index 000000000..e9ea6964e --- /dev/null +++ b/addons/characters/$PBOPREFIX$ @@ -0,0 +1 @@ +x\cba\addons\characters diff --git a/addons/characters/CfgEditorSubcategories.hpp b/addons/characters/CfgEditorSubcategories.hpp new file mode 100755 index 000000000..f897d8994 --- /dev/null +++ b/addons/characters/CfgEditorSubcategories.hpp @@ -0,0 +1,5 @@ +class CfgEditorSubcategories { + class EdSubcat_Personnel_MalariaInfected { + displayName = CSTRING(MenMalariaInfected); + }; +}; diff --git a/addons/characters/CfgVehicles.hpp b/addons/characters/CfgVehicles.hpp new file mode 100755 index 000000000..9a65c0036 --- /dev/null +++ b/addons/characters/CfgVehicles.hpp @@ -0,0 +1,69 @@ +#define UNLOCK_MALARIA_INFECTED_CIVILIAN \ + editorSubcategory = "EdSubcat_Personnel_MalariaInfected"; \ + scope = 2; \ + scopeCurator = 2; \ + class EventHandlers { \ + init = "(_this select 0) setIdentity selectRandom [ \ + 'BIS_Ambient01_sick', \ + 'BIS_Ambient02_sick', \ + 'BIS_Ambient03_sick', \ + 'BIS_Arthur_sick', \ + 'BIS_Howard_sick', \ + 'BIS_John_sick', \ + 'BIS_Lucas_sick', \ + 'BIS_Renly_sick' \ + ]; \ + (_this select 0) setDamage 0.45"; \ + } + +class CfgVehicles { + class C_Man_casual_1_F_afro; + class C_Man_casual_1_F_afro_sick: C_Man_casual_1_F_afro { + UNLOCK_MALARIA_INFECTED_CIVILIAN; + }; + + class C_Man_casual_3_F_afro; + class C_Man_casual_3_F_afro_sick: C_Man_casual_3_F_afro { + UNLOCK_MALARIA_INFECTED_CIVILIAN; + }; + + class C_Man_casual_4_F_afro; + class C_Man_casual_4_F_afro_sick: C_Man_casual_4_F_afro { + UNLOCK_MALARIA_INFECTED_CIVILIAN; + }; + + class C_Man_casual_5_F_afro; + class C_Man_casual_5_F_afro_sick: C_Man_casual_5_F_afro { + UNLOCK_MALARIA_INFECTED_CIVILIAN; + }; + + class C_Man_casual_6_F_afro; + class C_Man_casual_6_F_afro_sick: C_Man_casual_6_F_afro { + UNLOCK_MALARIA_INFECTED_CIVILIAN; + }; + + class C_man_polo_1_F_afro; + class C_man_polo_1_F_afro_sick: C_man_polo_1_F_afro { + UNLOCK_MALARIA_INFECTED_CIVILIAN; + }; + + class C_man_polo_2_F_afro; + class C_man_polo_2_F_afro_sick: C_man_polo_2_F_afro { + UNLOCK_MALARIA_INFECTED_CIVILIAN; + }; + + class C_man_polo_3_F_afro; + class C_man_polo_3_F_afro_sick: C_man_polo_3_F_afro { + UNLOCK_MALARIA_INFECTED_CIVILIAN; + }; + + class C_man_polo_6_F_afro; + class C_man_polo_6_F_afro_sick: C_man_polo_6_F_afro { + UNLOCK_MALARIA_INFECTED_CIVILIAN; + }; + + class C_man_sport_2_F_afro; + class C_man_sport_2_F_afro_sick: C_man_sport_2_F_afro { + UNLOCK_MALARIA_INFECTED_CIVILIAN; + }; +}; diff --git a/addons/characters/config.cpp b/addons/characters/config.cpp new file mode 100755 index 000000000..b0981a0ee --- /dev/null +++ b/addons/characters/config.cpp @@ -0,0 +1,21 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + name = CSTRING(component); + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"cba_common"}; + author = "$STR_CBA_Author"; + authors[] = {"Kex"}; + url = "$STR_CBA_URL"; + VERSION_CONFIG; + + // This prevents any patched class from requiring this addon + addonRootClass = "A3_Characters_F"; + }; +}; + +#include "CfgEditorSubcategories.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/characters/script_component.hpp b/addons/characters/script_component.hpp new file mode 100755 index 000000000..6c013792d --- /dev/null +++ b/addons/characters/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT characters +#include "\x\cba\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_CHARACTERS + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_CHARACTERS + #define DEBUG_SETTINGS DEBUG_SETTINGS_CHARACTERS +#endif + +#include "\x\cba\addons\main\script_macros.hpp" diff --git a/addons/characters/stringtable.xml b/addons/characters/stringtable.xml new file mode 100755 index 000000000..a4703ddbb --- /dev/null +++ b/addons/characters/stringtable.xml @@ -0,0 +1,15 @@ + + + + + Community Base Addons - Characters + Community Base Addons - Charaktere + Community Base Addons - Caractères + + + Men (Malaria-Infected) + Männer (Malariainfiziert) + Hommes (Infectés par la malaria) + + + From 9697feac88fc4e95489f4bd0a5133b925c6f895b Mon Sep 17 00:00:00 2001 From: oOKexOo Date: Thu, 28 May 2020 22:54:23 +0200 Subject: [PATCH 02/13] Fix locality issues --- addons/characters/CfgEventHandlers.hpp | 5 +++++ addons/characters/CfgVehicles.hpp | 31 ++++++++++++++++---------- addons/characters/XEH_postInit.sqf | 7 ++++++ addons/characters/config.cpp | 1 + 4 files changed, 32 insertions(+), 12 deletions(-) create mode 100755 addons/characters/CfgEventHandlers.hpp create mode 100755 addons/characters/XEH_postInit.sqf diff --git a/addons/characters/CfgEventHandlers.hpp b/addons/characters/CfgEventHandlers.hpp new file mode 100755 index 000000000..b0cc92b51 --- /dev/null +++ b/addons/characters/CfgEventHandlers.hpp @@ -0,0 +1,5 @@ +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; diff --git a/addons/characters/CfgVehicles.hpp b/addons/characters/CfgVehicles.hpp index 9a65c0036..f3ed5f75c 100755 --- a/addons/characters/CfgVehicles.hpp +++ b/addons/characters/CfgVehicles.hpp @@ -1,19 +1,26 @@ -#define UNLOCK_MALARIA_INFECTED_CIVILIAN \ +#define UNLOCK_MALARIA_INFECTED_CIVILIAN \ editorSubcategory = "EdSubcat_Personnel_MalariaInfected"; \ scope = 2; \ scopeCurator = 2; \ class EventHandlers { \ - init = "(_this select 0) setIdentity selectRandom [ \ - 'BIS_Ambient01_sick', \ - 'BIS_Ambient02_sick', \ - 'BIS_Ambient03_sick', \ - 'BIS_Arthur_sick', \ - 'BIS_Howard_sick', \ - 'BIS_John_sick', \ - 'BIS_Lucas_sick', \ - 'BIS_Renly_sick' \ - ]; \ - (_this select 0) setDamage 0.45"; \ + init = QUOTE(params ['_unit']; \ + if (local _unit) then { \ + private _identity = setIdentity selectRandom [ARR_8( \ + 'BIS_Ambient01_sick', \ + 'BIS_Ambient02_sick', \ + 'BIS_Ambient03_sick', \ + 'BIS_Arthur_sick', \ + 'BIS_Howard_sick', \ + 'BIS_John_sick', \ + 'BIS_Lucas_sick', \ + 'BIS_Renly_sick' \ + )]; \ + [ARR_2( \ + QGVAR(broadcastIdentity), \ + [ARR_2(_unit, _identity)] \ + )] call FUNC(globalEventJIP); \ + _unit setDamage 0.45; \ + }); \ } class CfgVehicles { diff --git a/addons/characters/XEH_postInit.sqf b/addons/characters/XEH_postInit.sqf new file mode 100755 index 000000000..678fc7c32 --- /dev/null +++ b/addons/characters/XEH_postInit.sqf @@ -0,0 +1,7 @@ +#include "script_component.hpp" + +[QGVAR(broadcastIdentity), { + params ["_unit", "_identity"]; + + _unit setIdentity _identity; +}] call FUNC(addEventHandler); diff --git a/addons/characters/config.cpp b/addons/characters/config.cpp index b0981a0ee..cb11c72b2 100755 --- a/addons/characters/config.cpp +++ b/addons/characters/config.cpp @@ -17,5 +17,6 @@ class CfgPatches { }; }; +#include "CfgEventHandlers.hpp" #include "CfgEditorSubcategories.hpp" #include "CfgVehicles.hpp" From 41b747f4c9bc7ee61b23dd8e611675ae254df33f Mon Sep 17 00:00:00 2001 From: oOKexOo Date: Thu, 28 May 2020 22:55:11 +0200 Subject: [PATCH 03/13] Fix indentation --- addons/characters/CfgVehicles.hpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/addons/characters/CfgVehicles.hpp b/addons/characters/CfgVehicles.hpp index f3ed5f75c..501252a09 100755 --- a/addons/characters/CfgVehicles.hpp +++ b/addons/characters/CfgVehicles.hpp @@ -26,51 +26,51 @@ class CfgVehicles { class C_Man_casual_1_F_afro; class C_Man_casual_1_F_afro_sick: C_Man_casual_1_F_afro { - UNLOCK_MALARIA_INFECTED_CIVILIAN; + UNLOCK_MALARIA_INFECTED_CIVILIAN; }; class C_Man_casual_3_F_afro; class C_Man_casual_3_F_afro_sick: C_Man_casual_3_F_afro { - UNLOCK_MALARIA_INFECTED_CIVILIAN; + UNLOCK_MALARIA_INFECTED_CIVILIAN; }; class C_Man_casual_4_F_afro; class C_Man_casual_4_F_afro_sick: C_Man_casual_4_F_afro { - UNLOCK_MALARIA_INFECTED_CIVILIAN; + UNLOCK_MALARIA_INFECTED_CIVILIAN; }; class C_Man_casual_5_F_afro; class C_Man_casual_5_F_afro_sick: C_Man_casual_5_F_afro { - UNLOCK_MALARIA_INFECTED_CIVILIAN; + UNLOCK_MALARIA_INFECTED_CIVILIAN; }; class C_Man_casual_6_F_afro; class C_Man_casual_6_F_afro_sick: C_Man_casual_6_F_afro { - UNLOCK_MALARIA_INFECTED_CIVILIAN; + UNLOCK_MALARIA_INFECTED_CIVILIAN; }; class C_man_polo_1_F_afro; class C_man_polo_1_F_afro_sick: C_man_polo_1_F_afro { - UNLOCK_MALARIA_INFECTED_CIVILIAN; + UNLOCK_MALARIA_INFECTED_CIVILIAN; }; class C_man_polo_2_F_afro; class C_man_polo_2_F_afro_sick: C_man_polo_2_F_afro { - UNLOCK_MALARIA_INFECTED_CIVILIAN; + UNLOCK_MALARIA_INFECTED_CIVILIAN; }; class C_man_polo_3_F_afro; class C_man_polo_3_F_afro_sick: C_man_polo_3_F_afro { - UNLOCK_MALARIA_INFECTED_CIVILIAN; + UNLOCK_MALARIA_INFECTED_CIVILIAN; }; class C_man_polo_6_F_afro; class C_man_polo_6_F_afro_sick: C_man_polo_6_F_afro { - UNLOCK_MALARIA_INFECTED_CIVILIAN; + UNLOCK_MALARIA_INFECTED_CIVILIAN; }; class C_man_sport_2_F_afro; class C_man_sport_2_F_afro_sick: C_man_sport_2_F_afro { - UNLOCK_MALARIA_INFECTED_CIVILIAN; + UNLOCK_MALARIA_INFECTED_CIVILIAN; }; }; From 902ce549890e5a3e9906777aab726f6f733b6ff6 Mon Sep 17 00:00:00 2001 From: oOKexOo Date: Thu, 28 May 2020 22:59:49 +0200 Subject: [PATCH 04/13] Fix quote in quote --- addons/characters/CfgVehicles.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/characters/CfgVehicles.hpp b/addons/characters/CfgVehicles.hpp index 501252a09..09fef466b 100755 --- a/addons/characters/CfgVehicles.hpp +++ b/addons/characters/CfgVehicles.hpp @@ -16,7 +16,7 @@ 'BIS_Renly_sick' \ )]; \ [ARR_2( \ - QGVAR(broadcastIdentity), \ + QQGVAR(broadcastIdentity), \ [ARR_2(_unit, _identity)] \ )] call FUNC(globalEventJIP); \ _unit setDamage 0.45; \ From 42612e10bf9c5e080275ddf0ec99bffddd84a20d Mon Sep 17 00:00:00 2001 From: oOKexOo Date: Thu, 28 May 2020 23:13:18 +0200 Subject: [PATCH 05/13] Remove erroneous setIdendity --- addons/characters/CfgVehicles.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/characters/CfgVehicles.hpp b/addons/characters/CfgVehicles.hpp index 09fef466b..f2d43f03a 100755 --- a/addons/characters/CfgVehicles.hpp +++ b/addons/characters/CfgVehicles.hpp @@ -5,7 +5,7 @@ class EventHandlers { \ init = QUOTE(params ['_unit']; \ if (local _unit) then { \ - private _identity = setIdentity selectRandom [ARR_8( \ + private _identity = selectRandom [ARR_8( \ 'BIS_Ambient01_sick', \ 'BIS_Ambient02_sick', \ 'BIS_Ambient03_sick', \ From e04ea4d3fa7a3eb3d444cb63b7f70baaacc97e82 Mon Sep 17 00:00:00 2001 From: oOKexOo Date: Fri, 29 May 2020 00:00:05 +0200 Subject: [PATCH 06/13] Correct func name macro --- addons/characters/CfgVehicles.hpp | 2 +- addons/characters/XEH_postInit.sqf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/characters/CfgVehicles.hpp b/addons/characters/CfgVehicles.hpp index f2d43f03a..260ea8685 100755 --- a/addons/characters/CfgVehicles.hpp +++ b/addons/characters/CfgVehicles.hpp @@ -18,7 +18,7 @@ [ARR_2( \ QQGVAR(broadcastIdentity), \ [ARR_2(_unit, _identity)] \ - )] call FUNC(globalEventJIP); \ + )] call FUNCMAIN(globalEventJIP); \ _unit setDamage 0.45; \ }); \ } diff --git a/addons/characters/XEH_postInit.sqf b/addons/characters/XEH_postInit.sqf index 678fc7c32..bfaef5514 100755 --- a/addons/characters/XEH_postInit.sqf +++ b/addons/characters/XEH_postInit.sqf @@ -4,4 +4,4 @@ params ["_unit", "_identity"]; _unit setIdentity _identity; -}] call FUNC(addEventHandler); +}] call FUNCMAIN(addEventHandler); From 172e0bb9aa5a21ecd789284d5fe10a68e4d39b39 Mon Sep 17 00:00:00 2001 From: oOKexOo Date: Fri, 29 May 2020 00:40:19 +0200 Subject: [PATCH 07/13] Adjust damage and move setIdentity to next frame --- addons/characters/CfgVehicles.hpp | 36 ++++++++++++++++++------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/addons/characters/CfgVehicles.hpp b/addons/characters/CfgVehicles.hpp index 260ea8685..a5ad97a2c 100755 --- a/addons/characters/CfgVehicles.hpp +++ b/addons/characters/CfgVehicles.hpp @@ -5,21 +5,27 @@ class EventHandlers { \ init = QUOTE(params ['_unit']; \ if (local _unit) then { \ - private _identity = selectRandom [ARR_8( \ - 'BIS_Ambient01_sick', \ - 'BIS_Ambient02_sick', \ - 'BIS_Ambient03_sick', \ - 'BIS_Arthur_sick', \ - 'BIS_Howard_sick', \ - 'BIS_John_sick', \ - 'BIS_Lucas_sick', \ - 'BIS_Renly_sick' \ - )]; \ - [ARR_2( \ - QQGVAR(broadcastIdentity), \ - [ARR_2(_unit, _identity)] \ - )] call FUNCMAIN(globalEventJIP); \ - _unit setDamage 0.45; \ + _unit setDamage 0.475; \ + [ \ + { \ + params ['_unit']; \ + private _identity = selectRandom [ARR_8( \ + 'BIS_Ambient01_sick', \ + 'BIS_Ambient02_sick', \ + 'BIS_Ambient03_sick', \ + 'BIS_Arthur_sick', \ + 'BIS_Howard_sick', \ + 'BIS_John_sick', \ + 'BIS_Lucas_sick', \ + 'BIS_Renly_sick' \ + )]; \ + [ARR_2( \ + QQGVAR(broadcastIdentity), \ + [ARR_2(_unit, _identity)] \ + )] call FUNCMAIN(globalEventJIP); \ + }, \ + _unit \ + ] call FUNCMAIN(execNextFrame); \ }); \ } From 4c372864bd09d6c563ce9bd699c1c7bac68076fb Mon Sep 17 00:00:00 2001 From: oOKexOo Date: Fri, 29 May 2020 00:42:06 +0200 Subject: [PATCH 08/13] Fix array --- addons/characters/CfgVehicles.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/characters/CfgVehicles.hpp b/addons/characters/CfgVehicles.hpp index a5ad97a2c..efbabc88b 100755 --- a/addons/characters/CfgVehicles.hpp +++ b/addons/characters/CfgVehicles.hpp @@ -6,7 +6,7 @@ init = QUOTE(params ['_unit']; \ if (local _unit) then { \ _unit setDamage 0.475; \ - [ \ + [ARR_2( \ { \ params ['_unit']; \ private _identity = selectRandom [ARR_8( \ @@ -25,7 +25,7 @@ )] call FUNCMAIN(globalEventJIP); \ }, \ _unit \ - ] call FUNCMAIN(execNextFrame); \ + )] call FUNCMAIN(execNextFrame); \ }); \ } From c051e545533e35eddcf2fe74b82ff7f4541429b4 Mon Sep 17 00:00:00 2001 From: oOKexOo Date: Fri, 29 May 2020 00:47:18 +0200 Subject: [PATCH 09/13] Change German translation --- addons/characters/stringtable.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/characters/stringtable.xml b/addons/characters/stringtable.xml index a4703ddbb..6255a9be8 100755 --- a/addons/characters/stringtable.xml +++ b/addons/characters/stringtable.xml @@ -8,7 +8,7 @@ Men (Malaria-Infected) - Männer (Malariainfiziert) + Männer (Malaria infiziert) Hommes (Infectés par la malaria) From e9ae6bba30f229c91c3565d95ac7ba91de552d50 Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 29 May 2020 13:17:06 +0200 Subject: [PATCH 10/13] some fixes --- addons/characters/CfgEventHandlers.hpp | 4 +-- addons/characters/CfgVehicles.hpp | 36 +++----------------- addons/characters/XEH_postInit.sqf | 7 ---- addons/characters/XEH_preInit.sqf | 46 ++++++++++++++++++++++++++ addons/characters/config.cpp | 3 -- addons/characters/script_component.hpp | 6 ++++ 6 files changed, 59 insertions(+), 43 deletions(-) delete mode 100755 addons/characters/XEH_postInit.sqf create mode 100644 addons/characters/XEH_preInit.sqf diff --git a/addons/characters/CfgEventHandlers.hpp b/addons/characters/CfgEventHandlers.hpp index b0cc92b51..b928bc2de 100755 --- a/addons/characters/CfgEventHandlers.hpp +++ b/addons/characters/CfgEventHandlers.hpp @@ -1,5 +1,5 @@ -class Extended_PostInit_EventHandlers { +class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_postInit)); + init = QUOTE(call COMPILE_FILE(XEH_preInit)); }; }; diff --git a/addons/characters/CfgVehicles.hpp b/addons/characters/CfgVehicles.hpp index efbabc88b..8707344d6 100755 --- a/addons/characters/CfgVehicles.hpp +++ b/addons/characters/CfgVehicles.hpp @@ -1,35 +1,9 @@ -#define UNLOCK_MALARIA_INFECTED_CIVILIAN \ - editorSubcategory = "EdSubcat_Personnel_MalariaInfected"; \ - scope = 2; \ - scopeCurator = 2; \ - class EventHandlers { \ - init = QUOTE(params ['_unit']; \ - if (local _unit) then { \ - _unit setDamage 0.475; \ - [ARR_2( \ - { \ - params ['_unit']; \ - private _identity = selectRandom [ARR_8( \ - 'BIS_Ambient01_sick', \ - 'BIS_Ambient02_sick', \ - 'BIS_Ambient03_sick', \ - 'BIS_Arthur_sick', \ - 'BIS_Howard_sick', \ - 'BIS_John_sick', \ - 'BIS_Lucas_sick', \ - 'BIS_Renly_sick' \ - )]; \ - [ARR_2( \ - QQGVAR(broadcastIdentity), \ - [ARR_2(_unit, _identity)] \ - )] call FUNCMAIN(globalEventJIP); \ - }, \ - _unit \ - )] call FUNCMAIN(execNextFrame); \ - }); \ - } - class CfgVehicles { + class C_man_p_beggar_F_afro; + class C_man_p_beggar_F_afro_sick: C_man_p_beggar_F_afro { + UNLOCK_MALARIA_INFECTED_CIVILIAN; + }; + class C_Man_casual_1_F_afro; class C_Man_casual_1_F_afro_sick: C_Man_casual_1_F_afro { UNLOCK_MALARIA_INFECTED_CIVILIAN; diff --git a/addons/characters/XEH_postInit.sqf b/addons/characters/XEH_postInit.sqf deleted file mode 100755 index bfaef5514..000000000 --- a/addons/characters/XEH_postInit.sqf +++ /dev/null @@ -1,7 +0,0 @@ -#include "script_component.hpp" - -[QGVAR(broadcastIdentity), { - params ["_unit", "_identity"]; - - _unit setIdentity _identity; -}] call FUNCMAIN(addEventHandler); diff --git a/addons/characters/XEH_preInit.sqf b/addons/characters/XEH_preInit.sqf new file mode 100644 index 000000000..8995b8d2f --- /dev/null +++ b/addons/characters/XEH_preInit.sqf @@ -0,0 +1,46 @@ +#include "script_component.hpp" + +ADDON = false; + +[QGVAR(setIdentity), { + params ["_unit", "_identity"]; + + _unit setIdentity _identity; +}] call CBA_fnc_addEventHandler; + +{ + [_x, "InitPost", { + params ["_unit"]; + + if (isServer) then { + _unit setDamage 0.475; + + private _identity = selectRandom [ + "BIS_Ambient01_sick", + "BIS_Ambient02_sick", + "BIS_Ambient03_sick", + "BIS_Arthur_sick", + "BIS_Howard_sick", + "BIS_John_sick", + "BIS_Lucas_sick", + "BIS_Renly_sick" + ]; + + [QGVAR(setIdentity), [_unit, _identity]] call CBA_fnc_globalEventJIP; + }; + }, nil, nil, true] call CBA_fnc_addClassEventHandler; +} forEach [ + "C_man_p_beggar_F_afro_sick", + "C_Man_casual_1_F_afro_sick", + "C_Man_casual_3_F_afro_sick", + "C_Man_casual_4_F_afro_sick", + "C_Man_casual_5_F_afro_sick", + "C_Man_casual_6_F_afro_sick", + "C_man_polo_1_F_afro_sick", + "C_man_polo_2_F_afro_sick", + "C_man_polo_3_F_afro_sick", + "C_man_polo_6_F_afro_sick", + "C_man_sport_2_F_afro_sick" +]; + +ADDON = true; diff --git a/addons/characters/config.cpp b/addons/characters/config.cpp index cb11c72b2..da9ceb081 100755 --- a/addons/characters/config.cpp +++ b/addons/characters/config.cpp @@ -11,9 +11,6 @@ class CfgPatches { authors[] = {"Kex"}; url = "$STR_CBA_URL"; VERSION_CONFIG; - - // This prevents any patched class from requiring this addon - addonRootClass = "A3_Characters_F"; }; }; diff --git a/addons/characters/script_component.hpp b/addons/characters/script_component.hpp index 6c013792d..e19d7e238 100755 --- a/addons/characters/script_component.hpp +++ b/addons/characters/script_component.hpp @@ -10,3 +10,9 @@ #endif #include "\x\cba\addons\main\script_macros.hpp" + +#define UNLOCK_MALARIA_INFECTED_CIVILIAN\ + author = "$STR_A3_Bohemia_Interactive";\ + scope = 2;\ + scopeCurator = 2;\ + editorSubcategory = "EdSubcat_Personnel_MalariaInfected" From 4138bb329cc3c9fbda2f8b6a2b73a1e30c1dd404 Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 29 May 2020 14:49:20 +0200 Subject: [PATCH 11/13] less scripts --- addons/characters/CfgFaces.hpp | 164 ++++++++++++++++++++++++++++++ addons/characters/CfgVehicles.hpp | 25 ++++- addons/characters/XEH_preInit.sqf | 20 ---- addons/characters/config.cpp | 1 + 4 files changed, 185 insertions(+), 25 deletions(-) create mode 100644 addons/characters/CfgFaces.hpp diff --git a/addons/characters/CfgFaces.hpp b/addons/characters/CfgFaces.hpp new file mode 100644 index 000000000..1c97de6aa --- /dev/null +++ b/addons/characters/CfgFaces.hpp @@ -0,0 +1,164 @@ +class CfgFaces { + class Default; + class Man_A3: Default { + class AfricanHead_01; + class AfricanHead_01_sick: AfricanHead_01 { + identityTypes[] = {QGVAR(Head_NATO_sick), QGVAR(Head_African_sick)}; + }; + + class AfricanHead_02; + class AfricanHead_02_sick: AfricanHead_02 { + identityTypes[] = {QGVAR(Head_NATO_sick), QGVAR(Head_African_sick)}; + }; + + class AfricanHead_03; + class AfricanHead_03_sick: AfricanHead_03 { + identityTypes[] = {QGVAR(Head_NATO_sick), QGVAR(Head_African_sick)}; + }; + + class AsianHead_A3_01; + class AsianHead_A3_01_sick: AsianHead_A3_01 { + identityTypes[] = {QGVAR(Head_Asian_sick)}; + }; + + class AsianHead_A3_02; + class AsianHead_A3_02_sick: AsianHead_A3_02 { + identityTypes[] = {QGVAR(Head_Asian_sick)}; + }; + + class AsianHead_A3_03; + class AsianHead_A3_03_sick: AsianHead_A3_03 { + identityTypes[] = {QGVAR(Head_Asian_sick)}; + }; + + class AsianHead_A3_04; + class AsianHead_A3_04_sick: AsianHead_A3_04 { + identityTypes[] = {QGVAR(Head_Asian_sick)}; + }; + + class AsianHead_A3_05; + class AsianHead_A3_05_sick: AsianHead_A3_05 { + identityTypes[] = {QGVAR(Head_Asian_sick)}; + }; + + class AsianHead_A3_06; + class AsianHead_A3_06_sick: AsianHead_A3_06 { + identityTypes[] = {QGVAR(Head_Asian_sick)}; + }; + + class AsianHead_A3_07; + class AsianHead_A3_07_sick: AsianHead_A3_07 { + identityTypes[] = {QGVAR(Head_Asian_sick)}; + }; + + class GreekHead_A3_01; + class GreekHead_A3_01_sick: GreekHead_A3_01 { + identityTypes[] = {QGVAR(Head_Greek_sick)}; + }; + + class GreekHead_A3_02; + class GreekHead_A3_02_sick: GreekHead_A3_02 { + identityTypes[] = {QGVAR(Head_Greek_sick)}; + }; + + class GreekHead_A3_03; + class GreekHead_A3_03_sick: GreekHead_A3_03 { + identityTypes[] = {QGVAR(Head_Greek_sick)}; + }; + + class GreekHead_A3_04; + class GreekHead_A3_04_sick: GreekHead_A3_04 { + identityTypes[] = {QGVAR(Head_Greek_sick)}; + }; + + class PersianHead_A3_01; + class PersianHead_A3_01_sick: PersianHead_A3_01 { + identityTypes[] = {QGVAR(Head_TK_sick)}; + }; + + class PersianHead_A3_02; + class PersianHead_A3_02_sick: PersianHead_A3_02 { + identityTypes[] = {QGVAR(Head_TK_sick)}; + }; + + class PersianHead_A3_03; + class PersianHead_A3_03_sick: PersianHead_A3_03 { + identityTypes[] = {QGVAR(Head_TK_sick)}; + }; + + class TanoanHead_A3_01; + class TanoanHead_A3_01_sick: TanoanHead_A3_01 { + identityTypes[] = {QGVAR(Head_Tanoan_sick)}; + }; + + class TanoanHead_A3_02; + class TanoanHead_A3_02_sick: TanoanHead_A3_02 { + identityTypes[] = {QGVAR(Head_Tanoan_sick)}; + }; + + class TanoanHead_A3_03; + class TanoanHead_A3_03_sick: TanoanHead_A3_03 { + identityTypes[] = {QGVAR(Head_Tanoan_sick)}; + }; + + class TanoanHead_A3_04; + class TanoanHead_A3_04_sick: TanoanHead_A3_04 { + identityTypes[] = {QGVAR(Head_Tanoan_sick)}; + }; + + class TanoanHead_A3_05; + class TanoanHead_A3_05_sick: TanoanHead_A3_05 { + identityTypes[] = {QGVAR(Head_Tanoan_sick)}; + }; + + class TanoanHead_A3_06; + class TanoanHead_A3_06_sick: TanoanHead_A3_06 { + identityTypes[] = {QGVAR(Head_Tanoan_sick)}; + }; + + class TanoanHead_A3_07; + class TanoanHead_A3_07_sick: TanoanHead_A3_07 { + identityTypes[] = {QGVAR(Head_Tanoan_sick)}; + }; + + class TanoanHead_A3_08; + class TanoanHead_A3_08_sick: TanoanHead_A3_08 { + identityTypes[] = {QGVAR(Head_Tanoan_sick)}; + }; + + class TanoanBossHead; + class TanoanBossHead_sick: TanoanBossHead { + identityTypes[] = {QGVAR(Head_Tanoan_sick)}; //Syndikat_Boss_F + }; + + class WhiteHead_16; //Kelly + class WhiteHead_16_sick: WhiteHead_16 { + identityTypes[] = {QGVAR(Head_NATO_sick), QGVAR(Head_Euro_sick)}; + }; + + class WhiteHead_17; //O'Connor + class WhiteHead_17_sick: WhiteHead_17 { + identityTypes[] = {QGVAR(Head_NATO_sick), QGVAR(Head_Euro_sick)}; + }; + + class WhiteHead_18; //Byrne + class WhiteHead_18_sick: WhiteHead_18 { + identityTypes[] = {QGVAR(Head_NATO_sick), QGVAR(Head_Euro_sick)}; + }; + + class WhiteHead_19; //O'Brien + class WhiteHead_19_sick: WhiteHead_19 { + identityTypes[] = {QGVAR(Head_NATO_sick), QGVAR(Head_Euro_sick)}; + }; + + class WhiteHead_20; //Walsh + class WhiteHead_20_sick: WhiteHead_20 { + identityTypes[] = {QGVAR(Head_NATO_sick), QGVAR(Head_Euro_sick)}; + }; + + class WhiteHead_21; //O'Sullivan + class WhiteHead_21_sick: WhiteHead_21 { + identityTypes[] = {QGVAR(Head_NATO_sick), QGVAR(Head_Euro_sick)}; + }; + }; +}; diff --git a/addons/characters/CfgVehicles.hpp b/addons/characters/CfgVehicles.hpp index 8707344d6..32dc846e4 100755 --- a/addons/characters/CfgVehicles.hpp +++ b/addons/characters/CfgVehicles.hpp @@ -1,56 +1,71 @@ -class CfgVehicles { - class C_man_p_beggar_F_afro; - class C_man_p_beggar_F_afro_sick: C_man_p_beggar_F_afro { - UNLOCK_MALARIA_INFECTED_CIVILIAN; - }; +/* identityTypes +QGVAR(Head_NATO_sick) +QGVAR(Head_African_sick) +QGVAR(Head_Asian_sick) +QGVAR(Head_Greek_sick) +QGVAR(Head_TK_sick) +QGVAR(Head_Tanoan_sick) +QGVAR(Head_Euro_sick) +*/ +class CfgVehicles { class C_Man_casual_1_F_afro; class C_Man_casual_1_F_afro_sick: C_Man_casual_1_F_afro { UNLOCK_MALARIA_INFECTED_CIVILIAN; + identityTypes[] = {QGVAR(Head_African_sick)}; }; class C_Man_casual_3_F_afro; class C_Man_casual_3_F_afro_sick: C_Man_casual_3_F_afro { UNLOCK_MALARIA_INFECTED_CIVILIAN; + identityTypes[] = {QGVAR(Head_African_sick)}; }; class C_Man_casual_4_F_afro; class C_Man_casual_4_F_afro_sick: C_Man_casual_4_F_afro { UNLOCK_MALARIA_INFECTED_CIVILIAN; + identityTypes[] = {QGVAR(Head_African_sick)}; }; class C_Man_casual_5_F_afro; class C_Man_casual_5_F_afro_sick: C_Man_casual_5_F_afro { UNLOCK_MALARIA_INFECTED_CIVILIAN; + identityTypes[] = {QGVAR(Head_African_sick)}; }; class C_Man_casual_6_F_afro; class C_Man_casual_6_F_afro_sick: C_Man_casual_6_F_afro { UNLOCK_MALARIA_INFECTED_CIVILIAN; + identityTypes[] = {QGVAR(Head_African_sick)}; }; class C_man_polo_1_F_afro; class C_man_polo_1_F_afro_sick: C_man_polo_1_F_afro { UNLOCK_MALARIA_INFECTED_CIVILIAN; + identityTypes[] = {QGVAR(Head_African_sick)}; }; class C_man_polo_2_F_afro; class C_man_polo_2_F_afro_sick: C_man_polo_2_F_afro { UNLOCK_MALARIA_INFECTED_CIVILIAN; + identityTypes[] = {QGVAR(Head_African_sick)}; }; class C_man_polo_3_F_afro; class C_man_polo_3_F_afro_sick: C_man_polo_3_F_afro { UNLOCK_MALARIA_INFECTED_CIVILIAN; + identityTypes[] = {QGVAR(Head_African_sick)}; }; class C_man_polo_6_F_afro; class C_man_polo_6_F_afro_sick: C_man_polo_6_F_afro { UNLOCK_MALARIA_INFECTED_CIVILIAN; + identityTypes[] = {QGVAR(Head_African_sick)}; }; class C_man_sport_2_F_afro; class C_man_sport_2_F_afro_sick: C_man_sport_2_F_afro { UNLOCK_MALARIA_INFECTED_CIVILIAN; + identityTypes[] = {QGVAR(Head_African_sick)}; }; }; diff --git a/addons/characters/XEH_preInit.sqf b/addons/characters/XEH_preInit.sqf index 8995b8d2f..124409983 100644 --- a/addons/characters/XEH_preInit.sqf +++ b/addons/characters/XEH_preInit.sqf @@ -2,35 +2,15 @@ ADDON = false; -[QGVAR(setIdentity), { - params ["_unit", "_identity"]; - - _unit setIdentity _identity; -}] call CBA_fnc_addEventHandler; - { [_x, "InitPost", { params ["_unit"]; if (isServer) then { _unit setDamage 0.475; - - private _identity = selectRandom [ - "BIS_Ambient01_sick", - "BIS_Ambient02_sick", - "BIS_Ambient03_sick", - "BIS_Arthur_sick", - "BIS_Howard_sick", - "BIS_John_sick", - "BIS_Lucas_sick", - "BIS_Renly_sick" - ]; - - [QGVAR(setIdentity), [_unit, _identity]] call CBA_fnc_globalEventJIP; }; }, nil, nil, true] call CBA_fnc_addClassEventHandler; } forEach [ - "C_man_p_beggar_F_afro_sick", "C_Man_casual_1_F_afro_sick", "C_Man_casual_3_F_afro_sick", "C_Man_casual_4_F_afro_sick", diff --git a/addons/characters/config.cpp b/addons/characters/config.cpp index da9ceb081..1ad17fd9a 100755 --- a/addons/characters/config.cpp +++ b/addons/characters/config.cpp @@ -16,4 +16,5 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgEditorSubcategories.hpp" +#include "CfgFaces.hpp" #include "CfgVehicles.hpp" From f24e949d5ffc32e7f472221f5e4de1c910690b97 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 30 May 2020 12:59:44 +0200 Subject: [PATCH 12/13] pretty threshold number --- addons/characters/XEH_preInit.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/characters/XEH_preInit.sqf b/addons/characters/XEH_preInit.sqf index 124409983..7a95fc29f 100644 --- a/addons/characters/XEH_preInit.sqf +++ b/addons/characters/XEH_preInit.sqf @@ -7,7 +7,7 @@ ADDON = false; params ["_unit"]; if (isServer) then { - _unit setDamage 0.475; + _unit setDamage 0.46; }; }, nil, nil, true] call CBA_fnc_addClassEventHandler; } forEach [ From 7c065335698e9cf9f5f8634afbcd8ba3f87f1ce2 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 31 May 2020 07:57:11 +0200 Subject: [PATCH 13/13] custom tokens need tags --- addons/characters/CfgEditorSubcategories.hpp | 2 +- addons/characters/script_component.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/characters/CfgEditorSubcategories.hpp b/addons/characters/CfgEditorSubcategories.hpp index f897d8994..6509d024c 100755 --- a/addons/characters/CfgEditorSubcategories.hpp +++ b/addons/characters/CfgEditorSubcategories.hpp @@ -1,5 +1,5 @@ class CfgEditorSubcategories { - class EdSubcat_Personnel_MalariaInfected { + class GVARMAIN(EdSubcat_Personnel_MalariaInfected) { displayName = CSTRING(MenMalariaInfected); }; }; diff --git a/addons/characters/script_component.hpp b/addons/characters/script_component.hpp index e19d7e238..d1b44aeae 100755 --- a/addons/characters/script_component.hpp +++ b/addons/characters/script_component.hpp @@ -15,4 +15,4 @@ author = "$STR_A3_Bohemia_Interactive";\ scope = 2;\ scopeCurator = 2;\ - editorSubcategory = "EdSubcat_Personnel_MalariaInfected" + editorSubcategory = QGVARMAIN(EdSubcat_Personnel_MalariaInfected)