Compare commits

...

7 Commits

5 changed files with 273 additions and 35 deletions

View File

@ -0,0 +1,16 @@
class H8_fnc_attach
{
allowedTargets = 0;
jip = 0;
};
class H8_fnc_detach
{
allowedTargets = 0;
jip = 0;
};
class H8_takeCorpse
{
allowedTargets = 0;
jip = 0;
};

View File

@ -0,0 +1,184 @@
/*
DragBody script by BangaBob (H8erMaker) v1.2
http://www.armaholic.com/page.php?id=26578
Modified by Zepheris to work with A3 Epoch's Dyna Menu System
*/
/*
Things I need to do:
1) rewrite the onEachFrame section of the code so its not using onEachFrame
2) Set variables so the game knows I'm dragging a Corpse
3) Figure out what I need to do in the event a player dragging a corpse dies.
4) Use variables to prevent the player from dragging more than one Corpse.
5) Use same variables to change how the corpse drag menu is displayed.
6) Verify the corpse is actually dead before allowing the drag to Work
**would like to have list below**
Figure out how to setup just one function so I can just add that to the cfgRemoteExec.hpp file.
Figure out how to add the corpse into a car.
*/
H8_CorpseDrag = {
params ["_corpse","_epochID"];
_output = format ["[dragBody] Debug: CorpseDrag - %1, %2, %3",player,_corpse,_epochID];
diag_log _output;
if (local _corpse) then {
_output = format ["[dragBody] Debug: Corpse is Local - %1, %2, %3",player,_corpse,_epochID];
diag_log _output;
[_corpse,player,_epochID] call H8_DragAction;
}
else {
_output = format ["[dragBody] Debug: Corpse is *NOT* Local - %1, %2, %3",player,_corpse,_epochID];
diag_log _output;
[_corpse,player,_epochID] remoteexec ["H8_takeOwnCorpse",2];
};
};
H8_takeOwnCorpse = {
_corpse = _this select 0;
_player = _this select 1;
_epochID = _this select 2;
_corpse setowner (owner _player);
_code = {
_corpse = _this select 0;
_player = _this select 1;
_epochID = _this select 2;
_start = diag_ticktime;
waituntil {diag_ticktime - _start > 5 || local (_corpse)};
if (local (_this select 0)) then {
[_corpse, _player,_epochID] call H8_DragAction;
};
};
_output = format ["[dragBody] Debug: Corpse: %1 - Code %2",_corpse, _code];
diag_log _output;
[[_corpse,_player,_epochID],_code] remoteexec ['BIS_fnc_spawn',_player];
};
H8_dragAction = {
_corpse = (_this select 0);
_player = (_this select 1);
_epochID = (_this select 2);
_output = format ["[dragBody] Debug: Drag Action - %1",_epochID];
diag_log _output;
[_corpse, _player, _epochID] remoteExec ["H8_fnc_attach",2];
_corpse attachTo [_player,[0,1,0]];
_player playAction "grabDrag";
_player forceWalk true;
};
H8_fnc_attach = {
_corpse = (_this select 0);
_player = (_this select 1);
_epochID = (_this select 2);
_output = format ["[dragBody] Debug: fnc_attach - %1",_epochID];
diag_log _output;
//_id = format ["h8EF%1",_epochID];
[_epochID, "onEachFrame", "H8_fnc_moveBody",[_corpse,_player]] call BIS_fnc_addStackedEventHandler;
};
H8_fnc_moveBody = {
_corpse = (_this select 0);
_player = (_this select 1);
// CREDIT TOO Das Attorney FOR CODE
_pos = _player modelToWorld [0,1,0];
_corpse setPos _pos;
_corpse setDir 180;
_corpse switchMove "AinjPpneMrunSnonWnonDb";
};
H8_dropAction = {
_corpse = (_this select 0);
_epochID = (_this select 1);
_output = format ["[dragBody] Debug: Drop Action - %1",_epochID];
diag_log _output;
[_corpse, vehicle player, _epochID] remoteExec ["H8_fnc_detach",2];
detach _corpse;
// CLIENT SIDE
player playMove "amovpknlmstpsraswrfldnon";
player forceWalk false;
};
H8_fnc_detach = {
_unit = (_this select 0);
_player = (_this select 1);
_epochID = (_this select 2);
_output = format ["[dragBody] Debug: fnc_detach - %1",_epochID];
diag_log _output;
//_id = format ["h8EF%1",_epochID];
[_epochID, "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
sleep 0.05;
_relD = [_unit,_player] call BIS_fnc_dirTo;
_unit switchMove "AinjPpneMstpSnonWrflDb_release";
_unit setDir _relD;
};
/*
H8_putIncar = {
_hideID = (_this select 2);
_dropID = player getVariable "H8dropact";
_unit = (_this select 3);
_vehicle = cursorTarget;
_loadedBody =_vehicle getVariable "H8loadedBody";
if (isNil "_loadedBody") then {
// CLIENT CODE
player playMove "amovpknlmstpsraswrfldnon";
player forceWalk false;
player removeAction _hideID;
player removeAction _dropID;
// GLOBAL CODE
_unitID = _unit getVariable "H8_increm";
0 = [[_unit, vehicle player,_unitID],"H8_fnc_detach",true] call BIS_fnc_MP;
sleep 1;
deTach _unit;
_unit setPos [0,0,0];
_vehicle setVariable ["H8loadedBody",_unit,true];
[[_vehicle],"H8_carAction",true] call BIS_fnc_MP;
}else{
hint "Vehicle already has a body loaded";
};
};
H8_carAction = {
_vehicle = (_this select 0);
_vehicle addAction [H8_UNLOTEXT,{call H8_removeBody},nil,0,false,false,"","_this distance _target < 8"];
};
H8_carRemoveAction = {
_vehicle = (_this select 0);
_id = (_this select 1);
_vehicle removeAction _id;
};
H8_removeBody = {
_vehicle = (_this select 0);
_player = (_this select 1);
_id = (_this select 2);
[[_vehicle,_id],"H8_carRemoveAction",true] call BIS_fnc_MP;
_unit = _vehicle getVariable "H8loadedBody";
_vehicle setVariable ["H8loadedBody",Nil];
_pos = _player modelToWorld [1,0,0];
_unit setPos _pos;
_unit switchMove "AinjPpneMstpSnonWrflDb_release";
};
/*

View File

@ -24,7 +24,28 @@ class flip_vic
};
*/
//end added by Zepheris
class drag_Stuff
{
condition = "true";
action = "";
icon = "x\addons\a3_epoch_code\Data\UI\buttons\epoch_bluekey.paa";
tooltip= "Drag Test";
class drag_body
{
condition = "if (!(isNull dyna_cursorTarget) && !(alive dyna_cursorTarget)) then {true} else {false}";
action = "[dyna_cursorTarget,Epoch_personalToken] call H8_CorpseDrag;";
icon = "x\addons\a3_epoch_code\Data\UI\buttons\epoch_brownkey.paa";
tooltip = "Grab Test";
};
class drop_body
{
condition = "true";
action = "[dyna_cursorTarget,Epoch_personalToken] call H8_dropAction;";
icon = "x\addons\a3_epoch_code\Data\UI\buttons\epoch_coralkey.paa";
tooltip = "Release Test";
};
};
class build_upgrade
{
condition = "dyna_buildMode select 0";

View File

@ -26,26 +26,26 @@ class CfgRemoteExec
{
mode = 1;
jip = 0;
class EPOCH_server_spawnLoot
{
allowedTargets=2;
jip = 0;
};
class EPOCH_server_PaintVehicle
{
allowedTargets=2;
jip = 0;
};
class EPOCH_server_PutCrypto
{
allowedTargets=2;
jip = 0;
};
class EPOCH_server_SetFinalPlayerPos
{
allowedTargets=2;
jip = 0;
};
class EPOCH_server_spawnLoot
{
allowedTargets=2;
jip = 0;
};
class EPOCH_server_PaintVehicle
{
allowedTargets=2;
jip = 0;
};
class EPOCH_server_PutCrypto
{
allowedTargets=2;
jip = 0;
};
class EPOCH_server_SetFinalPlayerPos
{
allowedTargets=2;
jip = 0;
};
class bis_fnc_reviveinitaddplayer
{
allowedTargets = 2;
@ -321,51 +321,66 @@ class CfgRemoteExec
allowedTargets = 2;
jip = 0;
};
class EPOCH_server_upgrade_vehicle
class EPOCH_server_upgrade_vehicle
{
allowedTargets = 2;
jip = 0;
};
class EPOCH_fnc_updatePlayerStats
class EPOCH_fnc_updatePlayerStats
{
allowedTargets = 2;
jip = 0;
};
class EPOCH_client_updatePlayerStat
class EPOCH_client_updatePlayerStat
{
allowedTargets = 1;
jip = 0;
};
class EPOCH_server_createTempGroup
{
class EPOCH_server_createTempGroup
{
allowedTargets = 2;
jip = 0;
};
class EPOCH_server_invitePlayerTempGroup
{
class EPOCH_server_invitePlayerTempGroup
{
allowedTargets = 2;
jip = 0;
};
class EPOCH_server_updatePlayerTempGroup
{
class EPOCH_server_updatePlayerTempGroup
{
allowedTargets = 2;
jip = 0;
};
class EPOCH_server_deleteTempGroup
{
class EPOCH_server_deleteTempGroup
{
allowedTargets = 2;
jip = 0;
};
class EPOCH_server_upgradeTempGroup
{
class EPOCH_server_upgradeTempGroup
{
allowedTargets = 2;
jip = 0;
};
class EPOCH_server_DefuseBomb
{
class EPOCH_server_DefuseBomb
{
allowedTargets = 2;
jip = 0;
};
class H8_fnc_attach
{
allowedTargets = 0;
jip = 0;
};
class H8_fnc_detach
{
allowedTargets = 0;
jip = 0;
};
class H8_takeOwnCorpse
{
allowedTargets = 0;
jip =0;
};
};
class Commands
{

View File

@ -30,3 +30,5 @@ call compile preprocessFileLineNumbers (TCL_Path+"TCL_Preprocess.sqf");
// 7. B_Heli_Transport_01_F = Transport helicopter for the mission system
EPOCH_spawnLimits = [0, 1, 0, 0, 1, 0, 1];
execVM "addons\drag_body\H8_dragBody.sqf";