Skip to content

Commit

Permalink
Interaction - Add actions based on animations (#6144)
Browse files Browse the repository at this point in the history
* Add actions based on animations

* Add setting

* Add ability to set items for users

* Add actions for 1.82 changes

Add actions for backpacks, canisters, entrench tool.
Move items and backpack to WeaponHolder.

* Add RHS 0.4.6 ZIL spare

* Update to new standards

* Handle RHS BTR retread system

* Make init faster: move condition to configClasses

* Fix CUP fake anims

* Refactor

* Rework

* Rename init function

* Decrease number of classes to init

* Fix merge mistake

* Apply suggestions from code review

* Updated code for current mod structure

* Multiple fixes & tweaks

- Made anim setting require a mission restart
- Handle more types of items that can be spawned
- Prioritise adding items to inventory and only drop on ground if no inventory space
- Add more position checks to make certain no valid position are present before stopping
- If 1 item was spawned in, it's considered as success
- Disable RHS' wheel replacement only if ace_repair is loaded

* Update CfgVehicles.hpp

* cache config lookup at preStart

* Fix error

* Add text config entry for progress bar title

* Restructure interactions, improved some locations & added interaction to some missing vehicles

* Reverted preInit change

---------

Co-authored-by: jonpas <jonpas33@gmail.com>
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
  • Loading branch information
4 people authored Aug 11, 2024
1 parent e36363e commit 96f81f1
Show file tree
Hide file tree
Showing 24 changed files with 939 additions and 5 deletions.
8 changes: 8 additions & 0 deletions addons/compat_rhs_afrf3/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,12 @@ PREP_RECOMPILE_START;
#include "XEH_PREP.hpp"
PREP_RECOMPILE_END;

// Disable RHS' wheel replacement mechanic
if (["ace_repair"] call EFUNC(common,isModLoaded)) then {
RHS_Retread_Enabled = false;
rhs_btr70_EnableRetread = false;
rhs_TypeTirePressure = 1;
RHS_BTR_Effects_Init = true;
};

ADDON = true;
123 changes: 123 additions & 0 deletions addons/compat_rhs_afrf3/compat_rhs_afrf3_repair/CfgVehicles.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
class CfgVehicles {
class Wheeled_APC_F;
class rhs_btr_base: Wheeled_APC_F {
class EGVAR(interaction,anims) {
class wheel_1_unhide {
positions[] = {{-0.8, -1.7, 0}};
items[] = {"ACE_Wheel"};
name = ECSTRING(repair,RemoveWheel);
text = ECSTRING(repair,RemovingWheel);
};
class wheel_2_unhide {
positions[] = {{0.35, -2.9, -0.1}};
items[] = {"ACE_Wheel"};
name = ECSTRING(repair,RemoveWheel);
text = ECSTRING(repair,RemovingWheel);
};
};
};
class rhs_btr70_vmf: rhs_btr_base {
class EGVAR(interaction,anims): EGVAR(interaction,anims) {
class wheel_1_unhide: wheel_1_unhide {
positions[] = {{-1.2, -2.6, 0.2}};
};
class wheel_2_unhide: wheel_2_unhide {
positions[] = {{-0.3, -3.8, 0}};
};
};
};

class rhs_btr70_msv: rhs_btr70_vmf {};
class rhs_btr80_msv: rhs_btr70_msv {
class EGVAR(interaction,anims): EGVAR(interaction,anims) {
class wheel_1_unhide: wheel_1_unhide {
positions[] = {{-1, -2.5, 0.6}};
};
class wheel_2_unhide: wheel_2_unhide {
enabled = 0;
};
};
};

class Truck_F;
class rhs_truck: Truck_F {
class EGVAR(interaction,anims) {
class spare_hide {
selections[] = {"spare"};
items[] = {"ACE_Wheel"};
name = ECSTRING(repair,RemoveWheel);
text = ECSTRING(repair,RemovingWheel);
};
};
};

class RHS_Ural_BaseTurret: Truck_F {
class EGVAR(interaction,anims) {
class spare_hide {
selections[] = {"spare"};
items[] = {"ACE_Wheel"};
name = ECSTRING(repair,RemoveWheel);
text = ECSTRING(repair,RemovingWheel);
};
};
};

class rhs_zil131_base: Truck_F {
class EGVAR(interaction,anims) {
class spare_hide {
selections[] = {"spare"};
items[] = {"ACE_Wheel"};
name = ECSTRING(repair,RemoveWheel);
text = ECSTRING(repair,RemovingWheel);
};
};
};

class rhs_kraz255_base;
class rhs_kraz255b1_base: rhs_kraz255_base {
class EGVAR(interaction,anims) {
class spare_hide {
selections[] = {"spare"};
items[] = {"ACE_Wheel"};
name = ECSTRING(repair,RemoveWheel);
text = ECSTRING(repair,RemovingWheel);
};
};
};

class O_Truck_02_covered_F;
class rhs_kamaz5350: O_Truck_02_covered_F {
class EGVAR(interaction,anims) {
class spare_hide {
selections[] = {"spare"};
items[] = {"ACE_Wheel"};
name = ECSTRING(repair,RemoveWheel);
text = ECSTRING(repair,RemovingWheel);
};
};
};

class MRAP_02_base_F;
class rhs_tigr_base: MRAP_02_base_F {
class EGVAR(interaction,anims) {
class spare_hide {
selections[] = {"spare"};
items[] = {"ACE_Wheel"};
name = ECSTRING(repair,RemoveWheel);
text = ECSTRING(repair,RemovingWheel);
};
};
};

class Offroad_01_base_f;
class RHS_UAZ_Base: Offroad_01_base_f {
class EGVAR(interaction,anims) {
class spare_hide {
selections[] = {"spare"};
items[] = {"ACE_Wheel"};
name = ECSTRING(repair,RemoveWheel);
text = ECSTRING(repair,RemovingWheel);
};
};
};
};
21 changes: 21 additions & 0 deletions addons/compat_rhs_afrf3/compat_rhs_afrf3_repair/config.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include "script_component.hpp"

class CfgPatches {
class SUBADDON {
name = COMPONENT_NAME;
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {
"rhs_main_loadorder",
"ace_repair"
};
skipWhenMissingDependencies = 1;
author = ECSTRING(common,ACETeam);
authors[] = {"Dystopian", "johnb43"};
url = ECSTRING(main,URL);
VERSION_CONFIG;
};
};

#include "CfgVehicles.hpp"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#define SUBCOMPONENT repair
#define SUBCOMPONENT_BEAUTIFIED Repair
#include "..\script_component.hpp"
6 changes: 2 additions & 4 deletions addons/compat_rhs_usf3/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ class CfgVehicles {
EGVAR(refuel,fuelCapacity) = 302;
};

class Truck_F;
class Truck_01_base_F: Truck_F {};
class Truck_01_base_F;
class rhsusf_fmtv_base: Truck_01_base_F {
EGVAR(refuel,fuelCapacity) = 219;
};
Expand All @@ -55,8 +54,7 @@ class CfgVehicles {
EGVAR(refuel,fuelCargo) = 900; // 45 jerrycans
};

class rhsusf_HEMTT_A4_base: Truck_01_base_F {};
class rhsusf_M977A4_usarmy_wd: rhsusf_HEMTT_A4_base {};
class rhsusf_M977A4_usarmy_wd;
class rhsusf_M977A4_AMMO_usarmy_wd: rhsusf_M977A4_usarmy_wd {
EGVAR(rearm,defaultSupply) = 1200;
};
Expand Down
52 changes: 52 additions & 0 deletions addons/compat_rhs_usf3/compat_rhs_usf3_refuel/CfgVehicles.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
class CfgVehicles {
class rhsusf_stryker_base;
class rhsusf_stryker_m1126_base: rhsusf_stryker_base {
class EGVAR(interaction,anims) {
class Hide_FCans {
positions[] = {{-0.7, -3, -0.4}};
items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F"};
name = ECSTRING(refuel,TakeFuelCanister);
text = ECSTRING(refuel,TakeFuelCanisterAction);
};
};
};
class rhsusf_stryker_m1127_base: rhsusf_stryker_m1126_base {
class EGVAR(interaction,anims): EGVAR(interaction,anims) {
class Hide_FCans: Hide_FCans {
positions[] = {{-0.5, -3, -0.4}};
};
};
};

class rhsusf_stryker_m1126_m2_base: rhsusf_stryker_m1126_base {};
class rhsusf_stryker_m1132_m2_base: rhsusf_stryker_m1126_m2_base {
class EGVAR(interaction,anims): EGVAR(interaction,anims) {
class Hide_FCans: Hide_FCans {
positions[] = {{-1, -4, -0.4}};
};
};
};
class rhsusf_stryker_m1134_base: rhsusf_stryker_m1132_m2_base {
class EGVAR(interaction,anims): EGVAR(interaction,anims) {
class Hide_FCans: Hide_FCans {
positions[] = {{-0.7, -3, -0.7}};
};
};
};

class rhsusf_m1a2tank_base;
class rhsusf_m1a2sep2_base: rhsusf_m1a2tank_base {
class EGVAR(interaction,anims) {
class fuelcans_hide {
// Rotate interactions with turret rotation
positions[] = {
"[0.23, -0.6, 0] vectorAdd ([[1.1, -3.6, 0.6], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)",
"[0.23, -0.6, 0] vectorAdd ([[-1.1, -3.6, 0.6], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)"
};
items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F"};
name = ECSTRING(refuel,TakeFuelCanister);
text = ECSTRING(refuel,TakeFuelCanisterAction);
};
};
};
};
1 change: 1 addition & 0 deletions addons/compat_rhs_usf3/compat_rhs_usf3_refuel/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ class CfgPatches {
};

#include "CfgEventHandlers.hpp"
#include "CfgVehicles.hpp"
126 changes: 126 additions & 0 deletions addons/compat_rhs_usf3/compat_rhs_usf3_repair/CfgVehicles.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
class CfgVehicles {
class Truck_01_base_F;
class rhsusf_fmtv_base: Truck_01_base_F {
class EGVAR(interaction,anims) {
class hide_spare {
positions[] = {{1, 1.4, 0}};
items[] = {"ACE_Wheel"};
name = ECSTRING(repair,RemoveWheel);
text = ECSTRING(repair,RemovingWheel);
};
};
};
class rhsusf_M1078A1P2_fmtv_usarmy: rhsusf_fmtv_base {};
class rhsusf_M1078A1P2_B_fmtv_usarmy: rhsusf_M1078A1P2_fmtv_usarmy {};
class rhsusf_M1078A1P2_B_M2_fmtv_usarmy: rhsusf_M1078A1P2_B_fmtv_usarmy {
class EGVAR(interaction,anims): EGVAR(interaction,anims) {
class hide_spare: hide_spare {
positions[] = {{1, 1.4, -0.5}};
};
};
};
class rhsusf_M1078A1R_SOV_M2_D_fmtv_socom: rhsusf_M1078A1P2_B_M2_fmtv_usarmy {
class EGVAR(interaction,anims): EGVAR(interaction,anims) {
class hide_spare: hide_spare {
positions[] = {{1, 1, -0.5}};
};
};
};
class rhsusf_M1083A1P2_fmtv_usarmy: rhsusf_M1078A1P2_fmtv_usarmy {};
class rhsusf_M1083A1P2_B_fmtv_usarmy: rhsusf_M1083A1P2_fmtv_usarmy {};
class rhsusf_M1083A1P2_B_M2_fmtv_usarmy: rhsusf_M1083A1P2_B_fmtv_usarmy {
class EGVAR(interaction,anims): EGVAR(interaction,anims) {
class hide_spare: hide_spare {
positions[] = {{1, 1.4, -0.5}};
};
};
};
class rhsusf_M1084A1P2_fmtv_usarmy: rhsusf_M1083A1P2_fmtv_usarmy {
class EGVAR(interaction,anims): EGVAR(interaction,anims) {
class hide_spare: hide_spare {
positions[] = {{1, 1.8, 0}};
};
};
};
class rhsusf_M1084A1P2_B_M2_fmtv_usarmy: rhsusf_M1083A1P2_B_M2_fmtv_usarmy {
class EGVAR(interaction,anims): EGVAR(interaction,anims) {
class hide_spare: hide_spare {
positions[] = {{1, 1.8, -0.5}};
};
};
};
class rhsusf_M1085A1P2_B_Medical_fmtv_usarmy: rhsusf_M1083A1P2_B_fmtv_usarmy {
class EGVAR(interaction,anims): EGVAR(interaction,anims) {
class hide_spare: hide_spare {
positions[] = {{1, 6.1, 0}};
};
};
};

class rhsusf_HEMTT_A4_base: Truck_01_base_F {
class EGVAR(interaction,anims) {
class hide_spare {
positions[] = {"_target selectionPosition 'sparewheel' vectorAdd [0.6, 0.6, -0.4]"};
items[] = {"ACE_Wheel"};
name = ECSTRING(repair,RemoveWheel);
text = ECSTRING(repair,RemovingWheel);
};
};
};

class MRAP_01_base_F;
class rhsusf_m1151_base: MRAP_01_base_F {
class EGVAR(interaction,anims) {
class hide_spare {
positions[] = {"_target selectionPosition 'sparewheel' vectorAdd [-0.465, 0, 0]"};
items[] = {"ACE_Wheel"};
name = ECSTRING(repair,RemoveWheel);
text = ECSTRING(repair,RemovingWheel);
};
};
};
// Don't inherit, as it's easier for the trenches compat
class rhsusf_M1165A1_GMV_SAG2_base: rhsusf_m1151_base {
class EGVAR(interaction,anims) {
class hide_spare {
positions[] = {"_target selectionPosition 'sparewheel_gmv' vectorAdd [0, -0.44, 0]"};
items[] = {"ACE_Wheel"};
name = ECSTRING(repair,RemoveWheel);
text = ECSTRING(repair,RemovingWheel);
};
};
};

class rhsusf_rg33_base: MRAP_01_base_F {
class EGVAR(interaction,anims) {
class hide_spare {
selections[] = {"sparewheel"};
items[] = {"ACE_Wheel"};
name = ECSTRING(repair,RemoveWheel);
text = ECSTRING(repair,RemovingWheel);
};
};
};

class rhsusf_M1239_base: MRAP_01_base_F {
class EGVAR(interaction,anims) {
class hide_spare {
selections[] = {"sparewheel"};
items[] = {"ACE_Wheel"};
name = ECSTRING(repair,RemoveWheel);
text = ECSTRING(repair,RemovingWheel);
};
};
};

class rhsusf_MATV_base: MRAP_01_base_F {
class EGVAR(interaction,anims) {
class hide_spare {
selections[] = {"sparewheel"};
items[] = {"ACE_Wheel"};
name = ECSTRING(repair,RemoveWheel);
text = ECSTRING(repair,RemovingWheel);
};
};
};
};
23 changes: 23 additions & 0 deletions addons/compat_rhs_usf3/compat_rhs_usf3_repair/config.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include "script_component.hpp"

class CfgPatches {
class SUBADDON {
name = COMPONENT_NAME;
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {
"rhsusf_main_loadorder",
"ace_repair"
};
skipWhenMissingDependencies = 1;
author = ECSTRING(common,ACETeam);
authors[] = {"johnb43"};
url = ECSTRING(main,URL);
VERSION_CONFIG;

addonRootClass = QUOTE(ADDON);
};
};

#include "CfgVehicles.hpp"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#define SUBCOMPONENT repair
#define SUBCOMPONENT_BEAUTIFIED Repair
#include "..\script_component.hpp"
Loading

0 comments on commit 96f81f1

Please sign in to comment.