Skip to content

Commit 44b1ade

Browse files
committed
Added: Enemy AI ragdoll based on the MDH ragdoll addon from Moerderhoschi (see https://steamcommunity.com/sharedfiles/filedetails/?id=3387437564)
1 parent 0aa47b4 commit 44b1ade

File tree

12 files changed

+121
-1
lines changed

12 files changed

+121
-1
lines changed

co30_Domination.Altis/cfgfunctions.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,8 @@ class cfgFunctions {
708708
addc(dynsimcheck);
709709
addc(addbarrelsfun);
710710
addc(bfunexp);
711+
addc(airagdoll);
712+
addc(airddo);
711713
};
712714
class Dom_PrePostInit {
713715
file = "init";

co30_Domination.Altis/changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
- Added: More targets and side missions to the Chernarus 2020 version
44
- Added: AH-99 Blackfoot (Stub Wings)
5+
- Added: Enemy AI ragdoll based on the MDH ragdoll addon from Moerderhoschi (see https://steamcommunity.com/sharedfiles/filedetails/?id=3387437564)
56
- Fixed: Resources were subracted from dropped ammo boxes even if a player didn't take or change gear
67
- Fixed: Empty east groups in the Western Sahara version
78
- Fixed: Simplified enemy RPG force fire script to avoid stuttering, by longtime

co30_Domination.Altis/description.ext

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,13 @@ class Params {
758758
texts[] = {"$STR_DOM_MISSIONSTRING_922","$STR_DOM_MISSIONSTRING_1007"};
759759
};
760760

761+
class d_doairagdoll {
762+
title = "$STR_DOM_MISSIONSTRING_2116";
763+
values[] = {0,1};
764+
default = 1;
765+
texts[] = {"$STR_DOM_MISSIONSTRING_1007","$STR_DOM_MISSIONSTRING_922"};
766+
};
767+
761768
class d_del_crew_always {
762769
title = "$STR_DOM_MISSIONSTRING_2062";
763770
values[] = {0,1};

co30_Domination.Altis/init/sm_bonus_vec_ar_gmcwg.sqf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ switch (d_own_side) do {
66
if (d_gmcwgwinter) exitWith {
77
["gm_ge_army_marder1a1a_win","gm_ge_army_marder1a1plus_win","gm_ge_army_marder1a2_win","gm_ge_army_gepard1a1_win","gm_ge_army_Leopard1a1a1_win","gm_ge_army_Leopard1a1a2_win","gm_ge_army_Leopard1a1a3_win","gm_ge_army_Leopard1a1a4_win","gm_ge_army_Leopard1a3_win","gm_ge_army_Leopard1a3a1_win","gm_ge_army_Leopard1a3a2_win","gm_ge_army_Leopard1a3a3_win","gm_ge_army_m113a1g_apc_win","gm_ge_army_m113a1g_apc_milan_win","gm_dk_army_Leopard1a3_win","gm_ge_army_luchsa1_win","gm_ge_army_luchsa2_win","gm_ge_army_bo105p_pah1a1_un","gm_ge_army_bo105p_pah1_un"]
88
};
9-
["gm_ge_army_marder1a1a","gm_ge_army_marder1a1plus","gm_ge_army_marder1a2","gm_ge_army_gepard1a1","gm_ge_army_Leopard1a1a1","gm_ge_army_Leopard1a1a2","gm_ge_army_Leopard1a1a3","gm_ge_army_Leopard1a1a4","gm_ge_army_Leopard1a3","gm_ge_army_Leopard1a3a1","gm_ge_army_Leopard1a3a2","gm_ge_army_Leopard1a3a3","gm_ge_army_m113a1g_apc","gm_ge_army_m113a1g_apc_milan","gm_dk_army_Leopard1a3","gm_ge_army_luchsa1","gm_ge_army_luchsa2","gm_ge_army_bo105p_pah1","gm_ge_army_bo105p_pah1a1"]
9+
["gm_ge_army_marder1a1a","gm_ge_army_marder1a1plus","gm_ge_army_marder1a2","gm_ge_army_gepard1a1","gm_ge_army_Leopard1a1a1","gm_ge_army_Leopard1a1a2","gm_ge_army_Leopard1a1a3","gm_ge_army_Leopard1a1a4","gm_ge_army_Leopard1a3","gm_ge_army_Leopard1a3a1","gm_ge_army_Leopard1a3a2","gm_ge_army_Leopard1a3a3","gm_ge_army_m113a1g_apc","gm_ge_army_m113a1g_apc_milan","gm_dk_army_Leopard1a3","gm_ge_army_luchsa1","gm_ge_army_luchsa2","gm_ge_army_bo105p_pah1","gm_ge_army_bo105p_pah1a1","gm_ge_army_rakjpz2","gm_ge_army_Leopard1a4","gm_ge_army_m113a1g_mortar"]
1010
};
1111
};
1212
case "EAST": {["O_APC_Tracked_02_cannon_F","O_APC_Wheeled_02_rcws_F","O_APC_Tracked_02_AA_F","O_MBT_02_cannon_F","O_UGV_01_F","O_UGV_01_rcws_F","O_MBT_04_cannon_F","O_MBT_04_command_F","O_Plane_Fighter_02_F","O_Plane_Fighter_02_Stealth_F","O_Plane_CAS_02_dynamicLoadout_F","O_Heli_Attack_02_dynamicLoadout_F"]};
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// by Moerderhoschi
2+
// see also:
3+
// MDH RAGDOLL AI UNITS GET MORE DAMAGE AT HIT & AI UNITS GET RAGDOLL EFFECT AT HIT(by Moerderhoschi) - v2025-04-14
4+
// github: https://github.com/Moerderhoschi/arma3_mdhRagdoll
5+
// steam mod version: https://steamcommunity.com/sharedfiles/filedetails/?id=3387437564
6+
7+
//#define __DEBUG__
8+
#include "..\x_setup.sqf"
9+
10+
params ["_u", "_selection"];
11+
12+
if (_selection == "body" && {isNull objectParent _u && {(_this # 8) && {alive _u && {lifeState _u != "INCAPACITATED"}}}}) then {
13+
if !(_u getVariable ["DomEnemyDamageEhForceHit", false]) then {
14+
_u setVariable ["DomEnemyDamageEhForceHit", true];
15+
_u spawn d_fnc_airddo;
16+
};
17+
};
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
// by Moerderhoschi
2+
// see also:
3+
// MDH RAGDOLL AI UNITS GET MORE DAMAGE AT HIT & AI UNITS GET RAGDOLL EFFECT AT HIT(by Moerderhoschi) - v2025-04-14
4+
// github: https://github.com/Moerderhoschi/arma3_mdhRagdoll
5+
// steam mod version: https://steamcommunity.com/sharedfiles/filedetails/?id=3387437564
6+
7+
#define __DEBUG__
8+
#include "..\x_setup.sqf"
9+
10+
__TRACE_1("","_this")
11+
12+
params ["_u"];
13+
if (!alive _u) exitWith {};
14+
_u addForce [[0,0,0], [0,0,0], false]; // reduce warping on ground
15+
sleep 3;
16+
if (!alive _u) exitWith {};
17+
_u setUnconscious true;
18+
19+
if (0.4 > random 1) then {
20+
__TRACE("lower than 0.2")
21+
private _w = "";
22+
private _t = primaryWeapon _u;
23+
if (secondaryWeapon _u != "") then {
24+
_w = "Weapon_Empty" createVehicle [500, 500, 500];
25+
_u actionNow ["DropWeapon", _w, secondaryWeapon _u];
26+
private _p = getPosWorld _u;
27+
_w setpos [(_p#0) + 0.3, _p#1, 0];
28+
};
29+
if (primaryWeapon _u != "") then {
30+
_w = "Weapon_Empty" createVehicle [500, 500, 500];
31+
_u actionNow ["DropWeapon", _w, primaryWeapon _u];
32+
private _p = getPosWorld _u;
33+
_w setpos [_p#0, _p#1, 0];
34+
};
35+
sleep 10 + (random 5);
36+
if (!alive _u) exitWith {};
37+
_u setUnconscious false;
38+
if (_t != "") then {
39+
_u actionNow ["TakeWeapon", _w, _t];
40+
_u selectWeapon primaryWeapon _u;
41+
};
42+
sleep 5;
43+
if (!alive _u) exitWith {};
44+
_u setVariable ["DomEnemyDamageEhForceHit", false];
45+
_u playMove "AmovPknlMstpSrasWrflDnon";
46+
_u selectWeapon primaryWeapon _u;
47+
} else {
48+
__TRACE("greater than 0.2")
49+
_u disableConversation true;
50+
_u setvariable ["bis_nocoreconversations",true];
51+
_u disableAI "FSM";
52+
_u disableAI "RADIOPROTOCOL";
53+
if (secondaryWeapon _u != "") then {
54+
private _w = "Weapon_Empty" createVehicle [500, 500, 500];
55+
_u actionNow ["DropWeapon", _w, secondaryWeapon _u];
56+
private _p = getPosWorld _u;
57+
_w setpos [(_p#0) + 0.3, _p#1, 0];
58+
};
59+
if (primaryWeapon _u != "") then {
60+
private _w = "Weapon_Empty" createVehicle [500, 500, 500];
61+
_u actionNow ["DropWeapon", _w, primaryWeapon _u];
62+
private _p = getPosWorld _u;
63+
_w setpos [_p#0, _p#1, 0];
64+
};
65+
sleep 120 + (random 180);
66+
if (alive _u) then {
67+
_u setDamage 1;
68+
};
69+
};

co30_Domination.Altis/server/fn_createpara2.sqf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ if (alive _chopper && {canMove _chopper && {alive driver _chopper}}) then {
122122
//_one_unit enableFatigue false;
123123
_one_unit disableAI "RADIOPROTOCOL";
124124
[_one_unit, _nightorfog, true] call d_fnc_changeskill;
125+
if (d_doairagdoll == 1) then {
126+
_one_unit addEventHandler ["HandleDamage", {call d_fnc_airagdoll}];
127+
};
125128
sleep 0.551;
126129
} forEach _real_units;
127130
_paragrp allowFleeing 0;

co30_Domination.Altis/server/fn_createpara3x.sqf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@ private _make_jump = {
188188
d_delinfsm pushBack _one_unit;
189189
[_one_unit, _nightorfog, true] call d_fnc_changeskill;
190190
[_one_unit, 3] call d_fnc_setekmode;
191+
if (d_doairagdoll == 1) then {
192+
_one_unit addEventHandler ["HandleDamage", {call d_fnc_airagdoll}];
193+
};
191194
sleep 0.01;
192195
private _bino = binocular _one_unit;
193196
if (_bino isNotEqualTo "") then {

co30_Domination.Altis/server/fn_makemgroup.sqf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ _women_infantry = [
134134
if (_bino isNotEqualTo "") then {
135135
_one_unit removeWeapon _bino;
136136
};
137+
if (d_doairagdoll == 1) then {
138+
_one_unit addEventHandler ["HandleDamage", {call d_fnc_airagdoll}];
139+
};
137140
_one_unit setDamage 0;
138141
_one_unit allowDamage true;
139142
} forEach _unitliste;

co30_Domination.Altis/server/fn_spawncrew.sqf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ if (count _crew > 0) then {
6565
if (d_with_dynsim == 0) then {
6666
[_one_unit, 10] spawn d_fnc_enabledynsim;
6767
};
68+
if (d_doairagdoll == 1) then {
69+
_one_unit addEventHandler ["HandleDamage", {call d_fnc_airagdoll}];
70+
};
6871
#ifdef __GROUPDEBUG__
6972
// does not subtract if a unit dies!
7073
if (side _grp == d_side_enemy) then {

0 commit comments

Comments
 (0)