-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated license Most cba integration with functions and settings
- Loading branch information
Showing
12 changed files
with
247 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
class Extended_PreInit_EventHandlers { | ||
class diwako_ragdoll { | ||
init = "call compile preprocessFileLineNumbers 'scripts\diwako\ragdoll\cba_settings.sqf'"; | ||
}; | ||
}; | ||
|
||
class cfgFunctions { | ||
class diwako_ragdoll { | ||
tag="diwako_ragdoll"; | ||
class functions { | ||
file = "scripts\diwako\ragdoll"; | ||
class initRagdoll{}; | ||
}; | ||
}; | ||
}; |
36 changes: 0 additions & 36 deletions
36
ace_ragdoll_unconscious.VR/initPlayerLocal-EnableForEveryThing.sqf
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
ace_ragdoll_unconscious.VR/scripts/diwako/ragdoll/cba_settings.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#define SETTINGS "Diwako's ACE Ragdolling" | ||
|
||
[ | ||
"diwako_ragdoll_ragdolling", // Internal setting name, should always contain a tag! This will be the global variable which takes the value of the setting. | ||
"CHECKBOX", // setting type | ||
["Enable ragdolling", "Enables ragdolling for players upon going unconscious"], // Pretty name of the category where the setting can be found. Can be stringtable entry. | ||
SETTINGS, // Pretty name shown inside the ingame settings menu. Can be stringtable entry. | ||
false, // data for this setting | ||
true, // "_isGlobal" flag. Set this to true to always have this setting synchronized between all clients in multiplayer | ||
{ | ||
params ["_value"]; | ||
if (_value isEqualTo true) then { | ||
[] call diwako_ragdoll_fnc_initRagdoll; | ||
}; | ||
} // function that will be executed once on mission start and every time the setting is changed. | ||
] call CBA_Settings_fnc_init; | ||
|
||
[ | ||
"diwako_ragdoll_ai", // Internal setting name, should always contain a tag! This will be the global variable which takes the value of the setting. | ||
"CHECKBOX", // setting type | ||
["Enable for AI", "Enables ragdolling for AI as well"], // Pretty name of the category where the setting can be found. Can be stringtable entry. | ||
SETTINGS, // Pretty name shown inside the ingame settings menu. Can be stringtable entry. | ||
false, // data for this setting | ||
true, // "_isGlobal" flag. Set this to true to always have this setting synchronized between all clients in multiplayer | ||
{} // function that will be executed once on mission start and every time the setting is changed. | ||
] call CBA_Settings_fnc_init; |
67 changes: 67 additions & 0 deletions
67
ace_ragdoll_unconscious.VR/scripts/diwako/ragdoll/fn_initRagdoll.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
Author: diwako | ||
Description: | ||
Adds ragdolling for players upon going unconscious | ||
Parameter(s): | ||
none | ||
Examples: | ||
(begin) | ||
[] call diwako_ragdoll_fnc_initRagdoll; | ||
(end) | ||
Returns: | ||
none | ||
*/ | ||
|
||
if(!hasInterface) exitWith {}; | ||
|
||
// no need to initialise ragdolling twice! | ||
if (!isNil 'diwako_ragdoll_ragdollRunning') exitWith {}; | ||
diwako_ragdoll_ragdollRunning = true; | ||
|
||
["ace_unconscious", { | ||
params [["_unit", objNull],["_state", false]]; | ||
if(!diwako_ragdoll_ragdolling) exitWith {}; // ragdolling if it active | ||
if( (_unit != player && {!diwako_ragdoll_ai}) || (!local _unit)) exitWith {}; // only ragdoll players and only ragdolling if it active | ||
if(_state && {vehicle _unit == _unit && {!([_unit] call ace_medical_fnc_isBeingCarried) && {!([_unit] call ace_medical_fnc_isBeingDragged)}}}) then { | ||
// ragdoll player | ||
_unit setUnconscious true; | ||
}; | ||
if(!_state) then { | ||
// player woke up before ragdolling was finished | ||
_unit setUnconscious false; | ||
}; | ||
}] call CBA_fnc_addEventHandler; | ||
|
||
["CAManBase", "AnimChanged", { | ||
params ["_unit","_anim"]; | ||
if(!diwako_ragdoll_ragdolling) exitWith {}; // disable ragdolling mid mission | ||
if( (_unit != player && {!diwako_ragdoll_ai}) || !(local _unit)) exitWith {}; // only run on players if ai setting is disabled | ||
if(_anim == "unconsciousrevivedefault" && {alive _unit && {_unit getVariable ["ACE_isUnconscious",false] && {vehicle _unit == _unit}}}) then { | ||
// unit stopped ragdolling, apply ace_death animation to unit | ||
_unit setUnconscious false; | ||
[_unit, [_unit] call ace_common_fnc_getDeathAnim, 2, true] call ace_common_fnc_doAnimation; | ||
if(isMultiplayer) then { | ||
// combat sync issues | ||
[ | ||
{ | ||
params ["_unit"]; | ||
if(!(_unit getVariable ["ACE_isUnconscious",false])) then { | ||
// unit is not unconscious anymore | ||
_unit setUnconscious false; | ||
} else { | ||
// unit is still unconscious, reapply death animation just in case and sync it again to all clients | ||
[_unit, [_unit] call ace_common_fnc_getDeathAnim, 2, true] call ace_common_fnc_doAnimation; | ||
}; | ||
}, // code | ||
[_unit], // params | ||
5 // delay | ||
] call CBA_fnc_waitAndExecute; | ||
}; | ||
}; | ||
}] call CBA_fnc_addClassEventHandler; | ||
|
||
player createDiaryRecord ["CBA_docs", ["Ragdolling", "Ragdolling has been activated in this mission! Better check those bodies!"]]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,5 @@ | ||
Copyright 2017 diwako | ||
Copyright 2018 diwako | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
This work (diwako_ace_ragdoll or the like) uses the license Arma Public License Share Alike (APL-SA) | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
Exception to the above license: | ||
You are not allowed to use these scripts on any monetised server which offers services or rewards in exchange of real life currency. | ||
https://www.bohemia.net/community/licenses/arma-public-license-share-alike |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
diwako_ragdoll |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class cfgFunctions { | ||
class diwako_ragdoll { | ||
tag="diwako_ragdoll"; | ||
class functions { | ||
file = "diwako_ragdoll\functions\diwako\ragdoll"; | ||
class initRagdoll{}; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#define REQUIRED_VERSION 1.82 | ||
#define VERSION "1.0" | ||
|
||
class CfgPatches { | ||
class diwako_ragdoll { | ||
units[] = {}; | ||
weapons[] = {}; | ||
requiredVersion = REQUIRED_VERSION; | ||
requiredAddons[] = { | ||
"ace_medical" | ||
,"cba_common" | ||
,"ace_common" | ||
}; | ||
author[] = {"diwako"}; | ||
authorUrl = "https://github.com/diwako/a3AceRagdoll"; | ||
version = VERSION; | ||
versionStr = VERSION; | ||
license = "https://www.bohemia.net/community/licenses/arma-public-license-share-alike"; | ||
}; | ||
}; | ||
|
||
class Extended_PreInit_EventHandlers { | ||
class diwako_ragdoll { | ||
init = "call compile preprocessFileLineNumbers 'diwako_ragdoll\functions\diwako\ragdoll\cba_settings.sqf'"; | ||
}; | ||
}; | ||
|
||
#include "cfgFunctions.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#define SETTINGS "Diwako's ACE Ragdolling" | ||
|
||
[ | ||
"diwako_ragdoll_ragdolling", // Internal setting name, should always contain a tag! This will be the global variable which takes the value of the setting. | ||
"CHECKBOX", // setting type | ||
["Enable ragdolling", "Enables ragdolling for players upon going unconscious"], // Pretty name of the category where the setting can be found. Can be stringtable entry. | ||
SETTINGS, // Pretty name shown inside the ingame settings menu. Can be stringtable entry. | ||
false, // data for this setting | ||
true, // "_isGlobal" flag. Set this to true to always have this setting synchronized between all clients in multiplayer | ||
{ | ||
params ["_value"]; | ||
if (_value isEqualTo true) then { | ||
[] call diwako_ragdoll_fnc_initRagdoll; | ||
}; | ||
} // function that will be executed once on mission start and every time the setting is changed. | ||
] call CBA_Settings_fnc_init; | ||
|
||
[ | ||
"diwako_ragdoll_ai", // Internal setting name, should always contain a tag! This will be the global variable which takes the value of the setting. | ||
"CHECKBOX", // setting type | ||
["Enable for AI", "Enables ragdolling for AI as well"], // Pretty name of the category where the setting can be found. Can be stringtable entry. | ||
SETTINGS, // Pretty name shown inside the ingame settings menu. Can be stringtable entry. | ||
false, // data for this setting | ||
true, // "_isGlobal" flag. Set this to true to always have this setting synchronized between all clients in multiplayer | ||
{} // function that will be executed once on mission start and every time the setting is changed. | ||
] call CBA_Settings_fnc_init; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
Author: diwako | ||
Description: | ||
Adds ragdolling for players upon going unconscious | ||
Parameter(s): | ||
none | ||
Examples: | ||
(begin) | ||
[] call diwako_ragdoll_fnc_initRagdoll; | ||
(end) | ||
Returns: | ||
none | ||
*/ | ||
|
||
if(!hasInterface) exitWith {}; | ||
|
||
// no need to initialise ragdolling twice! | ||
if (!isNil 'diwako_ragdoll_ragdollRunning') exitWith {}; | ||
diwako_ragdoll_ragdollRunning = true; | ||
|
||
["ace_unconscious", { | ||
params [["_unit", objNull],["_state", false]]; | ||
if(!diwako_ragdoll_ragdolling) exitWith {}; // ragdolling if it active | ||
if( (_unit != player && {!diwako_ragdoll_ai}) || (!local _unit)) exitWith {}; // only ragdoll players and only ragdolling if it active | ||
if(_state && {vehicle _unit == _unit && {!([_unit] call ace_medical_fnc_isBeingCarried) && {!([_unit] call ace_medical_fnc_isBeingDragged)}}}) then { | ||
// ragdoll player | ||
_unit setUnconscious true; | ||
}; | ||
if(!_state) then { | ||
// player woke up before ragdolling was finished | ||
_unit setUnconscious false; | ||
}; | ||
}] call CBA_fnc_addEventHandler; | ||
|
||
["CAManBase", "AnimChanged", { | ||
params ["_unit","_anim"]; | ||
if(!diwako_ragdoll_ragdolling) exitWith {}; // disable ragdolling mid mission | ||
if( (_unit != player && {!diwako_ragdoll_ai}) || !(local _unit)) exitWith {}; // only run on players if ai setting is disabled | ||
if(_anim == "unconsciousrevivedefault" && {alive _unit && {_unit getVariable ["ACE_isUnconscious",false] && {vehicle _unit == _unit}}}) then { | ||
// unit stopped ragdolling, apply ace_death animation to unit | ||
_unit setUnconscious false; | ||
[_unit, [_unit] call ace_common_fnc_getDeathAnim, 2, true] call ace_common_fnc_doAnimation; | ||
if(isMultiplayer) then { | ||
// combat sync issues | ||
[ | ||
{ | ||
params ["_unit"]; | ||
if(!(_unit getVariable ["ACE_isUnconscious",false])) then { | ||
// unit is not unconscious anymore | ||
_unit setUnconscious false; | ||
} else { | ||
// unit is still unconscious, reapply death animation just in case and sync it again to all clients | ||
[_unit, [_unit] call ace_common_fnc_getDeathAnim, 2, true] call ace_common_fnc_doAnimation; | ||
}; | ||
}, // code | ||
[_unit], // params | ||
5 // delay | ||
] call CBA_fnc_waitAndExecute; | ||
}; | ||
}; | ||
}] call CBA_fnc_addClassEventHandler; | ||
|
||
player createDiaryRecord ["CBA_docs", ["Ragdolling", "Ragdolling has been activated in this mission! Better check those bodies!"]]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Copyright 2018 diwako | ||
|
||
This work (diwako_ace_ragdoll or the like) uses the license Arma Public License Share Alike (APL-SA) | ||
|
||
https://www.bohemia.net/community/licenses/arma-public-license-share-alike |