Skip to content

Commit

Permalink
Compatiblity - Fix error popups caused by KKA3 ACE Extension (#207)
Browse files Browse the repository at this point in the history
* Update CBA macros to 3.16.0

SUBCOMPONENT support

* Add Compatibility component

* Fix errors caused by KKA3_ACE_Extension

766491311

* Fix being able to move in static animations

* Add KKA3 (commented) to launch config

* Depend on AFM main, bump min version to 2.14

* Remove tabs
  • Loading branch information
veteran29 authored Oct 18, 2023
1 parent 2f3a2f2 commit 1b27253
Show file tree
Hide file tree
Showing 10 changed files with 123 additions and 17 deletions.
1 change: 1 addition & 0 deletions .hemtt/project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ workshop = [
"450814997", # CBA_A3
"2369477168", # ADT
"463939057", # ACE
# "766491311", # KKA3 ACE Extension
]
parameters = [
"-name=dev",
Expand Down
1 change: 1 addition & 0 deletions addons/compatibility/$PBOPREFIX$
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
z\afm\addons\compatibility
3 changes: 3 additions & 0 deletions addons/compatibility/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Compatiblity

Adds compatiblity for various mods, loaded as needed thanks to `skipWhenMissingDependencies`
17 changes: 17 additions & 0 deletions addons/compatibility/config.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include "script_component.hpp"

class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {
"afm_main",
"A3_Data_F_Decade_Loadorder"
};
author = "ArmaForces";
authors[] = {"veteran29"};
VERSION_CONFIG;
};
};
47 changes: 47 additions & 0 deletions addons/compatibility/kka3_ace_extension/CfgMoves.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@

class CfgMovesBasic;
class CfgMovesMaleSdr: CfgMovesBasic {
class States {
class AmovPercMstpSnonWnonDnon;
class CutSceneAnimationBase;
class relax_44: CutSceneAnimationBase {
actions = "CivilStandActions";
};
class relax_45: CutSceneAnimationBase {
actions = "CivilStandActions";
};
class attention1: CutSceneAnimationBase {
actions = "CivilStandActions";
};
class attention2: CutSceneAnimationBase {
actions = "CivilStandActions";
};
class attention3: CutSceneAnimationBase {
actions = "CivilStandActions";
};
class relax_tes: CutSceneAnimationBase {
actions = "CivilStandActions";
};
class relax_21: CutSceneAnimationBase {
actions = "CivilStandActions";
};
class relax_24: CutSceneAnimationBase {
actions = "CivilStandActions";
};
class relax_3: CutSceneAnimationBase {
actions = "CivilStandActions";
};
class relax_32: CutSceneAnimationBase {
actions = "CivilStandActions";
};
class relax_8: CutSceneAnimationBase {
actions = "CivilStandActions";
};
class relax_7: CutSceneAnimationBase {
actions = "CivilStandActions";
};
class rattention2: CutSceneAnimationBase {
actions = "CivilStandActions";
};
};
};
19 changes: 19 additions & 0 deletions addons/compatibility/kka3_ace_extension/config.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include "script_component.hpp"

class CfgPatches {
class SUBADDON {
name = COMPONENT_NAME;
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {
"KKA3_ACE_Extension_Anim"
};
skipWhenMissingDependencies = 1;
author = "ArmaForces";
authors[] = {"veteran29"};
VERSION_CONFIG;
};
};

#include "CfgMoves.hpp"
2 changes: 2 additions & 0 deletions addons/compatibility/kka3_ace_extension/script_component.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#define SUBCOMPONENT kka3_ace_extension
#include "..\script_component.hpp"
14 changes: 14 additions & 0 deletions addons/compatibility/script_component.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#define COMPONENT compatibility
#include "\z\afm\addons\main\script_mod.hpp"

// #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE

#ifdef DEBUG_ENABLED_COMPATIBILITY
#define DEBUG_MODE_FULL
#endif
#ifdef DEBUG_SETTINGS_COMPATIBILITY
#define DEBUG_SETTINGS DEBUG_SETTINGS_COMPATIBILITY
#endif

#include "\z\afm\addons\main\script_macros.hpp"
2 changes: 1 addition & 1 deletion addons/main/script_mod.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#define VERSION_STR MAJOR.MINOR.PATCH
#define VERSION_AR MAJOR,MINOR,PATCH

#define REQUIRED_VERSION 2.00
#define REQUIRED_VERSION 2.14

#ifdef COMPONENT_BEAUTIFIED
#define COMPONENT_NAME QUOTE(AFM - COMPONENT_BEAUTIFIED)
Expand Down
34 changes: 18 additions & 16 deletions include/x/cba/addons/main/script_macros_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
- Provide a solid structure that can be dynamic and easy editable (Which sometimes means we cannot adhere to Aim #1 ;-)
An example is the path that is built from defines. Some available in this file, others in mods and addons.
Follows Standard:
Follows Standard:
Object variables: PREFIX_COMPONENT
Main-object variables: PREFIX_main
Paths: MAINPREFIX\PREFIX\SUBPREFIX\COMPONENT\SCRIPTNAME.sqf
Expand All @@ -29,6 +29,10 @@
and include your mod's script_macros.hpp
In your scripts you can then include the addon's component.hpp with relative path)
use in subcomponents (subconfigs)
define SUBCOMPONENT and include parent component's script_component.hpp
currently only supported by SUBADDON, additional macros may be added in the future
TODO:
- Try only to use 1 string type " vs '
- Evaluate double functions, and simplification
Expand All @@ -54,6 +58,10 @@
#define ADDON DOUBLES(PREFIX,COMPONENT)
#define MAIN_ADDON DOUBLES(PREFIX,main)

#ifdef SUBCOMPONENT
#define SUBADDON DOUBLES(ADDON,SUBCOMPONENT)
#endif

/* -------------------------------------------
Macro: VERSION_CONFIG
Define CBA Versioning System config entries.
Expand Down Expand Up @@ -857,15 +865,10 @@ Macro: ISNILS()
#define COMPILE_SCRIPT(var1) compileScript ['PATHTO_SYS(PREFIX,COMPONENT_F,var1)']


#define VERSIONING_SYS(var1) class CfgSettings \
{ \
class CBA \
{ \
class Versioning \
{ \
class var1 \
{ \
}; \
#define VERSIONING_SYS(var1) class CfgSettings { \
class CBA { \
class Versioning { \
class var1 {}; \
}; \
}; \
};
Expand Down Expand Up @@ -1032,12 +1035,9 @@ Macro: PATHTO_FNC()
#define QQEFUNC(var1,var2) QUOTE(QEFUNC(var1,var2))

#ifndef PRELOAD_ADDONS
#define PRELOAD_ADDONS class CfgAddons \
{ \
class PreloadAddons \
{ \
class ADDON \
{ \
#define PRELOAD_ADDONS class CfgAddons { \
class PreloadAddons { \
class ADDON { \
list[]={ QUOTE(ADDON) }; \
}; \
}; \
Expand Down Expand Up @@ -1275,9 +1275,11 @@ Macro: xSTRING()
#define ELSTRING(var1,var2) QUOTE(TRIPLES(STR,DOUBLES(PREFIX,var1),var2))
#define CSTRING(var1) QUOTE(TRIPLES($STR,ADDON,var1))
#define ECSTRING(var1,var2) QUOTE(TRIPLES($STR,DOUBLES(PREFIX,var1),var2))
#define SUBCSTRING(var1) QUOTE(TRIPLES($STR,SUBADDON,var1))

#define LLSTRING(var1) localize QUOTE(TRIPLES(STR,ADDON,var1))
#define LELSTRING(var1,var2) localize QUOTE(TRIPLES(STR,DOUBLES(PREFIX,var1),var2))
#define LSUBLSTRING(var1) localize QUOTE(TRIPLES(STR,SUBADDON,var1))
#endif


Expand Down

0 comments on commit 1b27253

Please sign in to comment.