mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-10 10:12:54 +03:00
Update object pickup actions
- pre-compile object_BackpackAction, object_pickupAction and the actionMonitor - switch from execVM to spawn - pickup actions are grouped under actions\pickupActions now
This commit is contained in:
@@ -15,7 +15,12 @@ if (!isDedicated) then {
|
||||
call compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_padlock.sqf";
|
||||
call compile preprocessFileLineNumbers "\z\addons\dayz_code\util\compile.sqf";
|
||||
call compile preprocessFileLineNumbers "\z\addons\dayz_code\loot\init.sqf";
|
||||
|
||||
|
||||
actionMonitor = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\pickupActions\actionMonitor.sqf";
|
||||
object_pickup = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\pickupActions\object_pickup.sqf";
|
||||
object_pickupAction = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\pickupActions\object_pickupAction.sqf";
|
||||
object_BackpackAction = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\pickupActions\object_BackpackAction.sqf";
|
||||
|
||||
fn_dropItem = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_dropItem.sqf";
|
||||
fn_dynamicTool = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_dynamicTool.sqf";
|
||||
fn_exitSwim = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_exitSwim.sqf";
|
||||
@@ -101,8 +106,7 @@ if (!isDedicated) then {
|
||||
|
||||
FNC_find_plots = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_find_plots.sqf";
|
||||
player_wearClothes = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_wearClothes.sqf";
|
||||
player_dropWeapon = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_dropWeapon.sqf";
|
||||
object_pickup = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\object_pickup.sqf";
|
||||
player_dropWeapon = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_dropWeapon.sqf";
|
||||
player_combineMag = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_combineMags.sqf";
|
||||
player_combineAntibiotics = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_combineAntibiotics.sqf";
|
||||
player_combinePainkiller = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_combinePainkiller.sqf";
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
if (player isKindOf "PZombie_VB") exitWith {};
|
||||
_holder = _this select 0;
|
||||
_type = _this select 1;
|
||||
_classname = _this select 2;
|
||||
|
||||
_name = getText (configFile >> _type >> _classname >> "displayName");
|
||||
|
||||
if ((!isNil "_holder") and {(!isNull _holder)}) then {
|
||||
_actionSet = _holder getVariable["actionSet", false];
|
||||
|
||||
if ((isNil "_actionSet") or {(!_actionSet)}) then {
|
||||
s_player_holderPickup = _holder addAction [format [localize "str_init_take", _name], "\z\addons\dayz_code\actions\object_pickup.sqf",[_type,_classname,_holder], 20, true, true];
|
||||
player reveal _holder;
|
||||
_holder setVariable["actionSet", true];
|
||||
};
|
||||
};
|
||||
@@ -1,71 +0,0 @@
|
||||
if (player isKindOf "PZombie_VB") exitWith {};
|
||||
/*
|
||||
Created exclusively for ArmA2:OA - DayZMod.
|
||||
Please request permission to use/alter from R4Z0R49.
|
||||
*/
|
||||
//private["_holder","_type","_classname","_name"];
|
||||
_holder = _this select 0;
|
||||
_type = _this select 1;
|
||||
_classname = _this select 2;
|
||||
|
||||
_name = getText (configFile >> _type >> _classname >> "displayName");
|
||||
|
||||
pickupInit = true;
|
||||
|
||||
actionMonitor = {
|
||||
private["_action","_run","_timeout"];
|
||||
_holder = _this select 0;
|
||||
_type = _this select 1;
|
||||
_classname = _this select 2;
|
||||
_name = _this select 3;
|
||||
|
||||
_action = -1;
|
||||
_distance = player distance _holder;
|
||||
_run = true;
|
||||
_timeout = 2;
|
||||
|
||||
//diag_log format["Holder: %1, Type: %2 Classname: %3, Name: %4",_holder, _type, _classname, _name];
|
||||
|
||||
while { _run } do {
|
||||
if (alive _holder) then {
|
||||
_distance = player distance _holder;
|
||||
// Add action to player
|
||||
if ((_distance < 1.75) && (_action == -1)) then {
|
||||
_action = player addAction [format[(localize "str_init_take"),_name], "\z\addons\dayz_code\actions\object_pickup.sqf",[_type,_classname,_holder], 20, true, true];
|
||||
player reveal _holder;
|
||||
_timeout = 0.3;
|
||||
};
|
||||
// Remove action from player
|
||||
if ((_distance >= 1.75) && (_action != -1)) then {
|
||||
player removeAction _action;
|
||||
pickupInit = true;
|
||||
_action = -1;
|
||||
_timeout = 2;
|
||||
};
|
||||
// Stop the loop and fall back to old code
|
||||
if (_distance > 100) then {
|
||||
null = _holder addAction [format[(localize "str_init_take"),_name], "\z\addons\dayz_code\actions\object_pickup.sqf",[_type,_classname,_holder], 20, true, true];
|
||||
player reveal _holder;
|
||||
_run = false;
|
||||
_timeout = 0;
|
||||
};
|
||||
} else {
|
||||
if (_action != -1) then {
|
||||
player removeAction _action;
|
||||
_action = -1;
|
||||
pickupInit = true;
|
||||
};
|
||||
_timeout = 0;
|
||||
_run = false;
|
||||
};
|
||||
uiSleep _timeout;
|
||||
};
|
||||
};
|
||||
|
||||
if (_classname == "1Rnd_Arrow_Wood") then {
|
||||
[_holder,_type,_classname,_name] spawn actionMonitor;
|
||||
} else {
|
||||
s_player_holderPickup = _holder addAction [format[(localize "str_init_take"),_name], "\z\addons\dayz_code\actions\object_pickup.sqf",[_type,_classname,_holder], 20, true, true];
|
||||
player reveal _holder;
|
||||
pickupInit = true;
|
||||
};
|
||||
Reference in New Issue
Block a user