|
|
|
@ -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";
|
|
|
|
|
};
|
|
|
|
|
/*
|