Skip to content

Commit 96f81f1

Browse files
Dystopianjonpasjohnb432PabstMirror
authored
Interaction - Add actions based on animations (#6144)
* 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>
1 parent e36363e commit 96f81f1

24 files changed

Lines changed: 939 additions & 5 deletions

File tree

addons/compat_rhs_afrf3/XEH_preInit.sqf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,12 @@ PREP_RECOMPILE_START;
66
#include "XEH_PREP.hpp"
77
PREP_RECOMPILE_END;
88

9+
// Disable RHS' wheel replacement mechanic
10+
if (["ace_repair"] call EFUNC(common,isModLoaded)) then {
11+
RHS_Retread_Enabled = false;
12+
rhs_btr70_EnableRetread = false;
13+
rhs_TypeTirePressure = 1;
14+
RHS_BTR_Effects_Init = true;
15+
};
16+
917
ADDON = true;
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
class CfgVehicles {
2+
class Wheeled_APC_F;
3+
class rhs_btr_base: Wheeled_APC_F {
4+
class EGVAR(interaction,anims) {
5+
class wheel_1_unhide {
6+
positions[] = {{-0.8, -1.7, 0}};
7+
items[] = {"ACE_Wheel"};
8+
name = ECSTRING(repair,RemoveWheel);
9+
text = ECSTRING(repair,RemovingWheel);
10+
};
11+
class wheel_2_unhide {
12+
positions[] = {{0.35, -2.9, -0.1}};
13+
items[] = {"ACE_Wheel"};
14+
name = ECSTRING(repair,RemoveWheel);
15+
text = ECSTRING(repair,RemovingWheel);
16+
};
17+
};
18+
};
19+
class rhs_btr70_vmf: rhs_btr_base {
20+
class EGVAR(interaction,anims): EGVAR(interaction,anims) {
21+
class wheel_1_unhide: wheel_1_unhide {
22+
positions[] = {{-1.2, -2.6, 0.2}};
23+
};
24+
class wheel_2_unhide: wheel_2_unhide {
25+
positions[] = {{-0.3, -3.8, 0}};
26+
};
27+
};
28+
};
29+
30+
class rhs_btr70_msv: rhs_btr70_vmf {};
31+
class rhs_btr80_msv: rhs_btr70_msv {
32+
class EGVAR(interaction,anims): EGVAR(interaction,anims) {
33+
class wheel_1_unhide: wheel_1_unhide {
34+
positions[] = {{-1, -2.5, 0.6}};
35+
};
36+
class wheel_2_unhide: wheel_2_unhide {
37+
enabled = 0;
38+
};
39+
};
40+
};
41+
42+
class Truck_F;
43+
class rhs_truck: Truck_F {
44+
class EGVAR(interaction,anims) {
45+
class spare_hide {
46+
selections[] = {"spare"};
47+
items[] = {"ACE_Wheel"};
48+
name = ECSTRING(repair,RemoveWheel);
49+
text = ECSTRING(repair,RemovingWheel);
50+
};
51+
};
52+
};
53+
54+
class RHS_Ural_BaseTurret: Truck_F {
55+
class EGVAR(interaction,anims) {
56+
class spare_hide {
57+
selections[] = {"spare"};
58+
items[] = {"ACE_Wheel"};
59+
name = ECSTRING(repair,RemoveWheel);
60+
text = ECSTRING(repair,RemovingWheel);
61+
};
62+
};
63+
};
64+
65+
class rhs_zil131_base: Truck_F {
66+
class EGVAR(interaction,anims) {
67+
class spare_hide {
68+
selections[] = {"spare"};
69+
items[] = {"ACE_Wheel"};
70+
name = ECSTRING(repair,RemoveWheel);
71+
text = ECSTRING(repair,RemovingWheel);
72+
};
73+
};
74+
};
75+
76+
class rhs_kraz255_base;
77+
class rhs_kraz255b1_base: rhs_kraz255_base {
78+
class EGVAR(interaction,anims) {
79+
class spare_hide {
80+
selections[] = {"spare"};
81+
items[] = {"ACE_Wheel"};
82+
name = ECSTRING(repair,RemoveWheel);
83+
text = ECSTRING(repair,RemovingWheel);
84+
};
85+
};
86+
};
87+
88+
class O_Truck_02_covered_F;
89+
class rhs_kamaz5350: O_Truck_02_covered_F {
90+
class EGVAR(interaction,anims) {
91+
class spare_hide {
92+
selections[] = {"spare"};
93+
items[] = {"ACE_Wheel"};
94+
name = ECSTRING(repair,RemoveWheel);
95+
text = ECSTRING(repair,RemovingWheel);
96+
};
97+
};
98+
};
99+
100+
class MRAP_02_base_F;
101+
class rhs_tigr_base: MRAP_02_base_F {
102+
class EGVAR(interaction,anims) {
103+
class spare_hide {
104+
selections[] = {"spare"};
105+
items[] = {"ACE_Wheel"};
106+
name = ECSTRING(repair,RemoveWheel);
107+
text = ECSTRING(repair,RemovingWheel);
108+
};
109+
};
110+
};
111+
112+
class Offroad_01_base_f;
113+
class RHS_UAZ_Base: Offroad_01_base_f {
114+
class EGVAR(interaction,anims) {
115+
class spare_hide {
116+
selections[] = {"spare"};
117+
items[] = {"ACE_Wheel"};
118+
name = ECSTRING(repair,RemoveWheel);
119+
text = ECSTRING(repair,RemovingWheel);
120+
};
121+
};
122+
};
123+
};
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#include "script_component.hpp"
2+
3+
class CfgPatches {
4+
class SUBADDON {
5+
name = COMPONENT_NAME;
6+
units[] = {};
7+
weapons[] = {};
8+
requiredVersion = REQUIRED_VERSION;
9+
requiredAddons[] = {
10+
"rhs_main_loadorder",
11+
"ace_repair"
12+
};
13+
skipWhenMissingDependencies = 1;
14+
author = ECSTRING(common,ACETeam);
15+
authors[] = {"Dystopian", "johnb43"};
16+
url = ECSTRING(main,URL);
17+
VERSION_CONFIG;
18+
};
19+
};
20+
21+
#include "CfgVehicles.hpp"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#define SUBCOMPONENT repair
2+
#define SUBCOMPONENT_BEAUTIFIED Repair
3+
#include "..\script_component.hpp"

addons/compat_rhs_usf3/CfgVehicles.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ class CfgVehicles {
4343
EGVAR(refuel,fuelCapacity) = 302;
4444
};
4545

46-
class Truck_F;
47-
class Truck_01_base_F: Truck_F {};
46+
class Truck_01_base_F;
4847
class rhsusf_fmtv_base: Truck_01_base_F {
4948
EGVAR(refuel,fuelCapacity) = 219;
5049
};
@@ -55,8 +54,7 @@ class CfgVehicles {
5554
EGVAR(refuel,fuelCargo) = 900; // 45 jerrycans
5655
};
5756

58-
class rhsusf_HEMTT_A4_base: Truck_01_base_F {};
59-
class rhsusf_M977A4_usarmy_wd: rhsusf_HEMTT_A4_base {};
57+
class rhsusf_M977A4_usarmy_wd;
6058
class rhsusf_M977A4_AMMO_usarmy_wd: rhsusf_M977A4_usarmy_wd {
6159
EGVAR(rearm,defaultSupply) = 1200;
6260
};
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
class CfgVehicles {
2+
class rhsusf_stryker_base;
3+
class rhsusf_stryker_m1126_base: rhsusf_stryker_base {
4+
class EGVAR(interaction,anims) {
5+
class Hide_FCans {
6+
positions[] = {{-0.7, -3, -0.4}};
7+
items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F"};
8+
name = ECSTRING(refuel,TakeFuelCanister);
9+
text = ECSTRING(refuel,TakeFuelCanisterAction);
10+
};
11+
};
12+
};
13+
class rhsusf_stryker_m1127_base: rhsusf_stryker_m1126_base {
14+
class EGVAR(interaction,anims): EGVAR(interaction,anims) {
15+
class Hide_FCans: Hide_FCans {
16+
positions[] = {{-0.5, -3, -0.4}};
17+
};
18+
};
19+
};
20+
21+
class rhsusf_stryker_m1126_m2_base: rhsusf_stryker_m1126_base {};
22+
class rhsusf_stryker_m1132_m2_base: rhsusf_stryker_m1126_m2_base {
23+
class EGVAR(interaction,anims): EGVAR(interaction,anims) {
24+
class Hide_FCans: Hide_FCans {
25+
positions[] = {{-1, -4, -0.4}};
26+
};
27+
};
28+
};
29+
class rhsusf_stryker_m1134_base: rhsusf_stryker_m1132_m2_base {
30+
class EGVAR(interaction,anims): EGVAR(interaction,anims) {
31+
class Hide_FCans: Hide_FCans {
32+
positions[] = {{-0.7, -3, -0.7}};
33+
};
34+
};
35+
};
36+
37+
class rhsusf_m1a2tank_base;
38+
class rhsusf_m1a2sep2_base: rhsusf_m1a2tank_base {
39+
class EGVAR(interaction,anims) {
40+
class fuelcans_hide {
41+
// Rotate interactions with turret rotation
42+
positions[] = {
43+
"[0.23, -0.6, 0] vectorAdd ([[1.1, -3.6, 0.6], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)",
44+
"[0.23, -0.6, 0] vectorAdd ([[-1.1, -3.6, 0.6], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)"
45+
};
46+
items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F"};
47+
name = ECSTRING(refuel,TakeFuelCanister);
48+
text = ECSTRING(refuel,TakeFuelCanisterAction);
49+
};
50+
};
51+
};
52+
};

addons/compat_rhs_usf3/compat_rhs_usf3_refuel/config.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ class CfgPatches {
2121
};
2222

2323
#include "CfgEventHandlers.hpp"
24+
#include "CfgVehicles.hpp"
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
class CfgVehicles {
2+
class Truck_01_base_F;
3+
class rhsusf_fmtv_base: Truck_01_base_F {
4+
class EGVAR(interaction,anims) {
5+
class hide_spare {
6+
positions[] = {{1, 1.4, 0}};
7+
items[] = {"ACE_Wheel"};
8+
name = ECSTRING(repair,RemoveWheel);
9+
text = ECSTRING(repair,RemovingWheel);
10+
};
11+
};
12+
};
13+
class rhsusf_M1078A1P2_fmtv_usarmy: rhsusf_fmtv_base {};
14+
class rhsusf_M1078A1P2_B_fmtv_usarmy: rhsusf_M1078A1P2_fmtv_usarmy {};
15+
class rhsusf_M1078A1P2_B_M2_fmtv_usarmy: rhsusf_M1078A1P2_B_fmtv_usarmy {
16+
class EGVAR(interaction,anims): EGVAR(interaction,anims) {
17+
class hide_spare: hide_spare {
18+
positions[] = {{1, 1.4, -0.5}};
19+
};
20+
};
21+
};
22+
class rhsusf_M1078A1R_SOV_M2_D_fmtv_socom: rhsusf_M1078A1P2_B_M2_fmtv_usarmy {
23+
class EGVAR(interaction,anims): EGVAR(interaction,anims) {
24+
class hide_spare: hide_spare {
25+
positions[] = {{1, 1, -0.5}};
26+
};
27+
};
28+
};
29+
class rhsusf_M1083A1P2_fmtv_usarmy: rhsusf_M1078A1P2_fmtv_usarmy {};
30+
class rhsusf_M1083A1P2_B_fmtv_usarmy: rhsusf_M1083A1P2_fmtv_usarmy {};
31+
class rhsusf_M1083A1P2_B_M2_fmtv_usarmy: rhsusf_M1083A1P2_B_fmtv_usarmy {
32+
class EGVAR(interaction,anims): EGVAR(interaction,anims) {
33+
class hide_spare: hide_spare {
34+
positions[] = {{1, 1.4, -0.5}};
35+
};
36+
};
37+
};
38+
class rhsusf_M1084A1P2_fmtv_usarmy: rhsusf_M1083A1P2_fmtv_usarmy {
39+
class EGVAR(interaction,anims): EGVAR(interaction,anims) {
40+
class hide_spare: hide_spare {
41+
positions[] = {{1, 1.8, 0}};
42+
};
43+
};
44+
};
45+
class rhsusf_M1084A1P2_B_M2_fmtv_usarmy: rhsusf_M1083A1P2_B_M2_fmtv_usarmy {
46+
class EGVAR(interaction,anims): EGVAR(interaction,anims) {
47+
class hide_spare: hide_spare {
48+
positions[] = {{1, 1.8, -0.5}};
49+
};
50+
};
51+
};
52+
class rhsusf_M1085A1P2_B_Medical_fmtv_usarmy: rhsusf_M1083A1P2_B_fmtv_usarmy {
53+
class EGVAR(interaction,anims): EGVAR(interaction,anims) {
54+
class hide_spare: hide_spare {
55+
positions[] = {{1, 6.1, 0}};
56+
};
57+
};
58+
};
59+
60+
class rhsusf_HEMTT_A4_base: Truck_01_base_F {
61+
class EGVAR(interaction,anims) {
62+
class hide_spare {
63+
positions[] = {"_target selectionPosition 'sparewheel' vectorAdd [0.6, 0.6, -0.4]"};
64+
items[] = {"ACE_Wheel"};
65+
name = ECSTRING(repair,RemoveWheel);
66+
text = ECSTRING(repair,RemovingWheel);
67+
};
68+
};
69+
};
70+
71+
class MRAP_01_base_F;
72+
class rhsusf_m1151_base: MRAP_01_base_F {
73+
class EGVAR(interaction,anims) {
74+
class hide_spare {
75+
positions[] = {"_target selectionPosition 'sparewheel' vectorAdd [-0.465, 0, 0]"};
76+
items[] = {"ACE_Wheel"};
77+
name = ECSTRING(repair,RemoveWheel);
78+
text = ECSTRING(repair,RemovingWheel);
79+
};
80+
};
81+
};
82+
// Don't inherit, as it's easier for the trenches compat
83+
class rhsusf_M1165A1_GMV_SAG2_base: rhsusf_m1151_base {
84+
class EGVAR(interaction,anims) {
85+
class hide_spare {
86+
positions[] = {"_target selectionPosition 'sparewheel_gmv' vectorAdd [0, -0.44, 0]"};
87+
items[] = {"ACE_Wheel"};
88+
name = ECSTRING(repair,RemoveWheel);
89+
text = ECSTRING(repair,RemovingWheel);
90+
};
91+
};
92+
};
93+
94+
class rhsusf_rg33_base: MRAP_01_base_F {
95+
class EGVAR(interaction,anims) {
96+
class hide_spare {
97+
selections[] = {"sparewheel"};
98+
items[] = {"ACE_Wheel"};
99+
name = ECSTRING(repair,RemoveWheel);
100+
text = ECSTRING(repair,RemovingWheel);
101+
};
102+
};
103+
};
104+
105+
class rhsusf_M1239_base: MRAP_01_base_F {
106+
class EGVAR(interaction,anims) {
107+
class hide_spare {
108+
selections[] = {"sparewheel"};
109+
items[] = {"ACE_Wheel"};
110+
name = ECSTRING(repair,RemoveWheel);
111+
text = ECSTRING(repair,RemovingWheel);
112+
};
113+
};
114+
};
115+
116+
class rhsusf_MATV_base: MRAP_01_base_F {
117+
class EGVAR(interaction,anims) {
118+
class hide_spare {
119+
selections[] = {"sparewheel"};
120+
items[] = {"ACE_Wheel"};
121+
name = ECSTRING(repair,RemoveWheel);
122+
text = ECSTRING(repair,RemovingWheel);
123+
};
124+
};
125+
};
126+
};
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#include "script_component.hpp"
2+
3+
class CfgPatches {
4+
class SUBADDON {
5+
name = COMPONENT_NAME;
6+
units[] = {};
7+
weapons[] = {};
8+
requiredVersion = REQUIRED_VERSION;
9+
requiredAddons[] = {
10+
"rhsusf_main_loadorder",
11+
"ace_repair"
12+
};
13+
skipWhenMissingDependencies = 1;
14+
author = ECSTRING(common,ACETeam);
15+
authors[] = {"johnb43"};
16+
url = ECSTRING(main,URL);
17+
VERSION_CONFIG;
18+
19+
addonRootClass = QUOTE(ADDON);
20+
};
21+
};
22+
23+
#include "CfgVehicles.hpp"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#define SUBCOMPONENT repair
2+
#define SUBCOMPONENT_BEAUTIFIED Repair
3+
#include "..\script_component.hpp"

0 commit comments

Comments
 (0)