mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 12:12:34 +03:00
1.0.1.8 DEV TEST
This commit is contained in:
@@ -1654,7 +1654,7 @@ class CfgMagazines {
|
||||
neednearby[] = {"sawmil"};
|
||||
requiretools[] = {"ItemToolbox"};
|
||||
output[] = {{"bulk_empty",1}};
|
||||
input[] = {{"PartWoodLumber",4},{"PartGeneric",1}};
|
||||
input[] = {{"PartWoodLumber",2},{"PartGeneric",1}};
|
||||
|
||||
};
|
||||
class Crafting2
|
||||
@@ -2819,8 +2819,25 @@ class CfgMagazines {
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_can_unlabeled_clean_full_ca.paa";
|
||||
};
|
||||
|
||||
|
||||
|
||||
// new DZE harvested food
|
||||
class FoodPumpkin : FoodEdible {
|
||||
scope = public;
|
||||
count = 1;
|
||||
bloodRegen = 100;
|
||||
displayName = "Pumkin";
|
||||
descriptionShort = "Pumkin";
|
||||
model = "z\addons\dayz_communityassets\models\pistachio.p3d"; // TODO: model + icon
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_pistachios_CA.paa";
|
||||
};
|
||||
class FoodSunFlowerSeed : FoodEdible {
|
||||
scope = public;
|
||||
count = 1;
|
||||
bloodRegen = 100;
|
||||
displayName = "Bag of Sunflower Seeds";
|
||||
descriptionShort = "Bag of Sunflower Seeds";
|
||||
model = "z\addons\dayz_communityassets\models\pistachio.p3d"; // TODO: model + icon
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_pistachios_CA.paa";
|
||||
};
|
||||
|
||||
class TrashTinCan: HandGrenade
|
||||
{
|
||||
@@ -2997,6 +3014,18 @@ class CfgMagazines {
|
||||
type = 256;
|
||||
};
|
||||
|
||||
class ItemKiloHemp : CA_Magazine {
|
||||
scope = public;
|
||||
count = 1;
|
||||
displayName = "Kilo of Hemp";
|
||||
descriptionShort = "Kilo of Hemp";
|
||||
model = "z\addons\dayz_communityassets\models\toiletpaper.p3d"; // TODO: model + icon
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_toiletpaper_CA.paa";
|
||||
type = 256;
|
||||
};
|
||||
|
||||
|
||||
|
||||
class 8Rnd_B_Beneli_74Slug;
|
||||
class 8Rnd_B_Beneli_Pellets;
|
||||
|
||||
|
||||
@@ -20,6 +20,23 @@ class CfgWeapons {
|
||||
class GrenadeLauncher; // External class reference
|
||||
|
||||
class DMR; // External class reference
|
||||
|
||||
class ItemKnife: ItemCore
|
||||
{
|
||||
scope = 2;
|
||||
displayName = "$STR_EQUIP_NAME_4";
|
||||
model = "\dayz_equip\models\knife_gear.p3d";
|
||||
picture = "\dayz_equip\textures\equip_knife_ca.paa";
|
||||
descriptionShort = "$STR_EQUIP_DESC_4";
|
||||
class ItemActions
|
||||
{
|
||||
class Use
|
||||
{
|
||||
text="Harvest Plant";
|
||||
script="spawn player_harvestPlant;";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgWeapons\Loot.hpp"
|
||||
|
||||
|
||||
@@ -5,12 +5,11 @@ TradeInprogress = true;
|
||||
|
||||
_isVehicle = false;
|
||||
|
||||
_vehicleSrc = _this select 0;
|
||||
_vehicleSrc = _this select 3;
|
||||
|
||||
if(_vehicleSrc != objNull) then {
|
||||
if(!(isNull _vehicleSrc)) then {
|
||||
|
||||
_isVehicle = ((_vehicleSrc isKindOf "AllVehicles") and !(_vehicleSrc isKindOf "Man"));
|
||||
|
||||
// If fuel source is vehicle get actual capacity
|
||||
_configSrcVeh = configFile >> "cfgVehicles" >> TypeOf(_vehicleSrc);
|
||||
_capacitySrc = getNumber(_configVeh >> "fuelCapacity");
|
||||
@@ -21,7 +20,8 @@ if(_vehicleSrc != objNull) then {
|
||||
_findNearestVehicles = nearestObjects [player, ["AllVehicles"], 30];
|
||||
_findNearestVehicle = [];
|
||||
{
|
||||
if (alive _x and _vehicleSrc != _x and !(_x isKindOf "Man")) then {
|
||||
//diag_log ("FILL = " + str(_x) + " = " + str(_vehicleSrc));
|
||||
if (alive _x and !(_x == _vehicleSrc) and !(_x isKindOf "Man")) exitWith {
|
||||
_findNearestVehicle set [(count _findNearestVehicle),_x];
|
||||
};
|
||||
} foreach _findNearestVehicles;
|
||||
|
||||
@@ -27,6 +27,7 @@ _classname = getText (configFile >> "CfgMagazines" >> _item >> "ItemActions" >>
|
||||
_classnametmp = _classname;
|
||||
_require = getArray (configFile >> "cfgMagazines" >> _this >> "ItemActions" >> "Build" >> "require");
|
||||
_text = getText (configFile >> "CfgVehicles" >> _classname >> "displayName");
|
||||
_ghost = getText (configFile >> "CfgVehicles" >> _classname >> "ghostpreview");
|
||||
|
||||
_offset = getArray (configFile >> "CfgVehicles" >> _classname >> "offset");
|
||||
|
||||
@@ -150,7 +151,7 @@ if (_hasrequireditem) then {
|
||||
hintSilent str (_position);
|
||||
|
||||
// if ghost preview available use that instead
|
||||
_ghost = getText (configFile >> "CfgVehicles" >> _classname >> "ghostpreview");
|
||||
|
||||
if (_ghost == "") then {
|
||||
_object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
|
||||
} else {
|
||||
|
||||
@@ -20,20 +20,7 @@ _findNearestTree = [];
|
||||
|
||||
if (alive _x) then {
|
||||
|
||||
_objInfo = toArray(str(_x));
|
||||
_lenInfo = count _objInfo - 1;
|
||||
_objName = [];
|
||||
_i = 0;
|
||||
// determine where the object name starts
|
||||
{
|
||||
if (58 == _objInfo select _i) exitWith {};
|
||||
_i = _i + 1;
|
||||
} forEach _objInfo;
|
||||
_i = _i + 2; // skip the ": " part
|
||||
for "_k" from _i to _lenInfo do {
|
||||
_objName = _objName + [_objInfo select _k];
|
||||
};
|
||||
_objName = toLower(toString(_objName));
|
||||
_objName = _x call DZE_getModelName;
|
||||
|
||||
// Exit since we found a tree
|
||||
if (_objName in _trees) exitWith {
|
||||
|
||||
122
SQF/dayz_code/actions/player_harvestPlant.sqf
Normal file
122
SQF/dayz_code/actions/player_harvestPlant.sqf
Normal file
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
DayZ Harvest Plant
|
||||
Usage: spawn player_harvestPlant;
|
||||
Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
|
||||
*/
|
||||
private ["_isOk","_i","_objName","_objInfo","_lenInfo","_started","_finished","_animState","_isMedic","_proceed","_counter","_itemOut","_countOut","_tree","_distance2d","_distance3d","_trees","_findNearestTree"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Harvest already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
// allowed trees list move this later
|
||||
_trees = ["pumpkin.p3d","p_helianthus.p3d","p_fiberplant_ep1.p3d"];
|
||||
_treesOutput = ["FoodPumpkin","FoodSunFlowerSeed","ItemKiloHemp"];
|
||||
|
||||
//_item = _this;
|
||||
call gear_ui_init;
|
||||
|
||||
_countOut = 0;
|
||||
|
||||
_findNearestTree = [];
|
||||
{
|
||||
if("" == typeOf _x) then {
|
||||
|
||||
if (alive _x) then {
|
||||
|
||||
_objName = _x call DZE_getModelName;
|
||||
|
||||
// Exit since we found a tree
|
||||
if (_objName in _trees) exitWith {
|
||||
_findNearestTree set [(count _findNearestTree),_x];
|
||||
|
||||
_index = _trees find _objName;
|
||||
|
||||
_itemOut = _treesOutput select _index;
|
||||
|
||||
_countOut = 1;
|
||||
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
} foreach nearestObjects [getPos player, [], 20];
|
||||
|
||||
//diag_log format["DEBUG TREES: %1", _findNearestTree];
|
||||
|
||||
if (count(_findNearestTree) >= 1) then {
|
||||
|
||||
_tree = _findNearestTree select 0;
|
||||
|
||||
// Start chop tree loop
|
||||
_isOk = true;
|
||||
_proceed = false;
|
||||
while {_isOk} do {
|
||||
|
||||
player playActionNow "Medic";
|
||||
[player,20,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
r_interrupt = false;
|
||||
_animState = animationState player;
|
||||
r_doLoop = true;
|
||||
_started = false;
|
||||
_finished = false;
|
||||
|
||||
while {r_doLoop} do {
|
||||
_animState = animationState player;
|
||||
_isMedic = ["medic",_animState] call fnc_inString;
|
||||
if (_isMedic) then {
|
||||
_started = true;
|
||||
};
|
||||
if (_started and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
[player,"chopwood",0,false] call dayz_zombieSpeak;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
|
||||
sleep 0.1;
|
||||
|
||||
};
|
||||
|
||||
if(!_finished) exitWith {
|
||||
_isOk = false;
|
||||
_proceed = false;
|
||||
};
|
||||
|
||||
if(_finished) exitWith {
|
||||
_isOk = false;
|
||||
_proceed = true;
|
||||
};
|
||||
};
|
||||
|
||||
if (_proceed) then {
|
||||
|
||||
for "_x" from 1 to _countOut do {
|
||||
player addMagazine _itemOut;
|
||||
};
|
||||
|
||||
// chop down tree
|
||||
if("" == typeOf _tree) then {
|
||||
_tree setDamage 1;
|
||||
};
|
||||
//diag_log format["DEBUG TREE DAMAGE: %1", _tree];
|
||||
|
||||
cutText [format["%1 of %2 has been successfully added to your inventory.", _countOut,_itemOut], "PLAIN DOWN"];
|
||||
|
||||
} else {
|
||||
r_interrupt = false;
|
||||
if (vehicle player == player) then {
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
cutText ["Canceled Harvesting.", "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
cutText [localize "str_player_23", "PLAIN DOWN"];
|
||||
};
|
||||
TradeInprogress = false;
|
||||
@@ -17,7 +17,7 @@ hintSilent parseText format ["
|
||||
(player getVariable['humanKills', 0]),
|
||||
(player getVariable['banditKills', 0]),
|
||||
(player getVariable['humanity', 0]),
|
||||
(dayz_skilllevel)
|
||||
(dayz_Survived)
|
||||
];
|
||||
|
||||
/*
|
||||
|
||||
@@ -39,7 +39,7 @@ if(_removed == _countIn) then {
|
||||
_textRemoved = getText(configFile >> "CfgMagazines" >> _selected >> "displayName");
|
||||
|
||||
// add failure rate based on skill level variable (days alive)
|
||||
_chanceToFail = (((random 1) + (dayz_skilllevel/100)) > 0.5);
|
||||
_chanceToFail = (((random 1) + (dayz_Survived/100)) > 0.5);
|
||||
|
||||
if(!_chanceToFail) then {
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@ private ["_vehicle","_started","_finished","_animState","_isMedic","_abort","_co
|
||||
if(TradeInprogress) exitWith { cutText ["Already in progress." , "PLAIN DOWN"] };
|
||||
TradeInprogress = true;
|
||||
|
||||
player removeAction s_player_towing;
|
||||
s_player_towing = 1;
|
||||
|
||||
// Tow Truck
|
||||
_towTruck = _this select 3;
|
||||
_towTruckSize = (sizeOf typeOf _towTruck);
|
||||
@@ -10,7 +13,7 @@ _towTruckSize = (sizeOf typeOf _towTruck);
|
||||
_allowedSize = _towTruckSize-(_towTruckSize/3);
|
||||
|
||||
// Get all nearby vehicles within 10m
|
||||
_findNearestVehicles = nearestObjects [_towTruck, ["Car"], 10];
|
||||
_findNearestVehicles = nearestObjects [_towTruck, ["Car","Motorcycle"], 10];
|
||||
_findNearestVehicle = [];
|
||||
{
|
||||
if (alive _x and _towTruck != _x and (sizeOf typeOf _x) <= _allowedSize) then {
|
||||
@@ -92,4 +95,5 @@ if(_IsNearVehicle >= 1) then {
|
||||
} else {
|
||||
cutText ["No Vehicles Nearby.", "PLAIN DOWN"];
|
||||
};
|
||||
TradeInprogress = false;
|
||||
TradeInprogress = false;
|
||||
s_player_towing = -1;
|
||||
@@ -3,6 +3,9 @@ private ["_vehicle","_started","_finished","_animState","_isMedic","_configVeh",
|
||||
if(TradeInprogress) exitWith { cutText ["Already in progress." , "PLAIN DOWN"] };
|
||||
TradeInprogress = true;
|
||||
|
||||
player removeAction s_player_towing;
|
||||
s_player_towing = 1;
|
||||
|
||||
// Tow Truck
|
||||
_towTruck = _this select 3;
|
||||
|
||||
@@ -11,61 +14,67 @@ _inTow = _towTruck getVariable ["DZEinTow", false];
|
||||
|
||||
if(_inTow) then {
|
||||
|
||||
// select the nearest one
|
||||
_vehicle = _towTruck getVariable ["DZEvehicleInTow", false];
|
||||
// select vehicl in tow
|
||||
_vehicle = _towTruck getVariable ["DZEvehicleInTow", objNull];
|
||||
|
||||
// Static vehicle fuel information
|
||||
_configVeh = configFile >> "cfgVehicles" >> TypeOf(_vehicle);
|
||||
_nameText = getText(_configVeh >> "displayName");
|
||||
if(!(isNull _towTruck)) then {
|
||||
|
||||
// alert zombies
|
||||
[player,20,true,(getPosATL player)] spawn player_alertZombies;
|
||||
// Static vehicle fuel information
|
||||
_configVeh = configFile >> "cfgVehicles" >> TypeOf(_vehicle);
|
||||
_nameText = getText(_configVeh >> "displayName");
|
||||
|
||||
_finished = false;
|
||||
// alert zombies
|
||||
[player,20,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
// force animation
|
||||
player playActionNow "Medic";
|
||||
_finished = false;
|
||||
|
||||
r_interrupt = false;
|
||||
_animState = animationState player;
|
||||
r_doLoop = true;
|
||||
_started = false;
|
||||
// force animation
|
||||
player playActionNow "Medic";
|
||||
|
||||
while {r_doLoop} do {
|
||||
_animState = animationState player;
|
||||
_isMedic = ["medic",_animState] call fnc_inString;
|
||||
if (_isMedic) then {
|
||||
_started = true;
|
||||
};
|
||||
if (_started and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
if(!_finished) then {
|
||||
r_interrupt = false;
|
||||
|
||||
if (vehicle player == player) then {
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
_animState = animationState player;
|
||||
r_doLoop = true;
|
||||
_started = false;
|
||||
|
||||
while {r_doLoop} do {
|
||||
_animState = animationState player;
|
||||
_isMedic = ["medic",_animState] call fnc_inString;
|
||||
if (_isMedic) then {
|
||||
_started = true;
|
||||
};
|
||||
if (_started and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
if (_finished) then {
|
||||
if(!_finished) then {
|
||||
r_interrupt = false;
|
||||
|
||||
if (vehicle player == player) then {
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
};
|
||||
|
||||
if (_finished) then {
|
||||
|
||||
detach _vehicle;
|
||||
detach _vehicle;
|
||||
_towTruck setVariable ["DZEinTow", false, true];
|
||||
_towTruck setVariable ["DZEvehicleInTow", objNull, true];
|
||||
cutText [format["%1 has been detached from Tow Truck.",_nameText], "PLAIN DOWN"];
|
||||
};
|
||||
} else {
|
||||
_towTruck setVariable ["DZEinTow", false, true];
|
||||
_towTruck setVariable ["DZEvehicleInTow", objNull, true];
|
||||
cutText [format["%1 has been detached from Tow Truck.",_nameText], "PLAIN DOWN"];
|
||||
_towTruck setVariable ["DZEvehicleInTow", objNull, true];
|
||||
};
|
||||
|
||||
} else {
|
||||
cutText ["No Vehicles In Tow.", "PLAIN DOWN"];
|
||||
};
|
||||
TradeInprogress = false;
|
||||
TradeInprogress = false;
|
||||
s_player_towing = -1;
|
||||
@@ -90,6 +90,7 @@ if (!isDedicated) then {
|
||||
player_fillWater = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\water_fill.sqf";
|
||||
player_makeFire = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_makefire.sqf";
|
||||
player_chopWood = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_chopWood.sqf";
|
||||
player_harvestPlant = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_harvestPlant.sqf";
|
||||
player_goFishing = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_goFishing.sqf";
|
||||
player_build = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_build.sqf";
|
||||
player_wearClothes = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_wearClothes.sqf";
|
||||
@@ -411,6 +412,24 @@ if (!isDedicated) then {
|
||||
if (_vdir < 0) then {_vdir = 360 + _vdir};
|
||||
_vdir
|
||||
};
|
||||
|
||||
DZE_getModelName = {
|
||||
_objInfo = toArray(str(_this));
|
||||
_lenInfo = count _objInfo - 1;
|
||||
_objName = [];
|
||||
_i = 0;
|
||||
// determine where the object name starts
|
||||
{
|
||||
if (58 == _objInfo select _i) exitWith {};
|
||||
_i = _i + 1;
|
||||
} forEach _objInfo;
|
||||
_i = _i + 2; // skip the ": " part
|
||||
for "_k" from _i to _lenInfo do {
|
||||
_objName = _objName + [_objInfo select _k];
|
||||
};
|
||||
_objName = toLower(toString(_objName));
|
||||
_objName
|
||||
};
|
||||
|
||||
dayz_originalPlayer = player;
|
||||
};
|
||||
|
||||
@@ -161,6 +161,17 @@ while {true} do {
|
||||
r_player_blood = _result;
|
||||
};
|
||||
};
|
||||
|
||||
if (_foodVal >= 0.9 and _thirstVal >= 0.9) then {
|
||||
if (!r_player_infected and !r_player_inpain and !r_player_injured) then {
|
||||
_result = r_player_blood + 10;
|
||||
if (_result >= r_player_bloodTotal) then {
|
||||
r_player_blood = r_player_bloodTotal;
|
||||
} else {
|
||||
r_player_blood = _result;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
//Record low blood
|
||||
_lowBlood = player getVariable ["USEC_lowBlood", false];
|
||||
|
||||
@@ -258,9 +258,7 @@ _playerObj setVariable["friendlies",_friendlies,true];
|
||||
|
||||
dayzPlayerLogin2 = [_worldspace,_state];
|
||||
_clientID = owner _playerObj;
|
||||
if(!isNull _playerObj) then {
|
||||
_clientID publicVariableClient "dayzPlayerLogin2";
|
||||
};
|
||||
_clientID publicVariableClient "dayzPlayerLogin2";
|
||||
|
||||
//record time started
|
||||
_playerObj setVariable ["lastTime",time];
|
||||
|
||||
@@ -7,36 +7,46 @@ item2[] = {"waiting",2,250,-75.000000,-100.000000,25.000000,-50.000000,0.000000,
|
||||
item3[] = {"time_sync",4,218,-275.000000,-25.000000,-175.000000,25.000000,1.000000,"time" \n "sync"};
|
||||
item4[] = {"sync_the_time",2,250,-275.000000,50.000000,-175.000000,100.000000,0.000000,"sync" \n "the time"};
|
||||
item5[] = {"true",8,218,-75.000000,125.000000,25.000000,175.000000,0.000000,"true"};
|
||||
item6[] = {"general_cleanup",2,4346,-75.000000,200.000000,25.000000,250.000000,0.000000,"general" \n "cleanup"};
|
||||
item6[] = {"general_cleanup",2,250,-75.000000,200.000000,25.000000,250.000000,0.000000,"general" \n "cleanup" \n "loop"};
|
||||
item7[] = {"",7,210,-304.000000,220.999985,-296.000000,229.000015,0.000000,""};
|
||||
item8[] = {"",7,210,-304.000000,-154.000000,-296.000000,-146.000000,0.000000,""};
|
||||
item9[] = {"",7,210,221.000000,-79.000000,229.000000,-71.000000,0.000000,""};
|
||||
item10[] = {"",7,210,221.000000,146.000000,229.000000,154.000000,0.000000,""};
|
||||
item11[] = {"initialized",4,218,-75.000000,-325.000000,25.000000,-275.000000,0.000000,"initialized"};
|
||||
item12[] = {"prepare",2,250,-75.000000,-250.000000,25.000000,-200.000000,0.000000,"prepare"};
|
||||
item13[] = {"update_objects",2,250,100.000000,50.000000,200.000000,100.000000,0.000000,"update objects"};
|
||||
item13[] = {"update_objects",2,4346,100.000000,50.000000,200.000000,100.000000,0.000000,"update objects"};
|
||||
item14[] = {"need_update",4,218,100.000000,-25.000000,200.000000,25.000000,1.000000,"need update"};
|
||||
item15[] = {"",7,210,221.000000,-79.000000,229.000000,-71.000000,0.000000,""};
|
||||
item16[] = {"cleanup_groups",4,218,-150.000000,-25.000000,-50.000000,25.000000,1.000000,"cleanup" \n "groups"};
|
||||
item17[] = {"group_cleanup",2,250,-150.000000,50.000000,-50.000000,100.000000,0.000000,"group" \n "cleanup"};
|
||||
item18[] = {"cleanup_vehicles",4,218,-25.000000,-25.000000,75.000000,25.000000,1.000000,"cleanup" \n "vehicles"};
|
||||
item19[] = {"vehicle_cleanup",2,250,-25.000000,50.000000,75.000000,100.000000,0.000000,"vehicle" \n "cleanup"};
|
||||
link0[] = {0,11};
|
||||
link1[] = {1,2};
|
||||
link2[] = {2,3};
|
||||
link3[] = {2,9};
|
||||
link4[] = {2,14};
|
||||
link5[] = {3,4};
|
||||
link6[] = {4,5};
|
||||
link7[] = {5,6};
|
||||
link8[] = {6,7};
|
||||
link9[] = {7,8};
|
||||
link10[] = {8,1};
|
||||
link11[] = {9,10};
|
||||
link12[] = {9,15};
|
||||
link13[] = {10,5};
|
||||
link14[] = {11,12};
|
||||
link15[] = {12,1};
|
||||
link16[] = {13,5};
|
||||
link17[] = {14,13};
|
||||
globals[] = {25.000000,1,0,0,0,640,480,1,25,6316128,1,-419.782135,377.473389,303.547668,-419.297363,675,612,1};
|
||||
window[] = {0,-1,-1,-1,-1,900,1933,3211,142,1,693};
|
||||
link5[] = {2,16};
|
||||
link6[] = {2,18};
|
||||
link7[] = {3,4};
|
||||
link8[] = {4,5};
|
||||
link9[] = {5,6};
|
||||
link10[] = {6,7};
|
||||
link11[] = {7,8};
|
||||
link12[] = {8,1};
|
||||
link13[] = {9,10};
|
||||
link14[] = {9,15};
|
||||
link15[] = {10,5};
|
||||
link16[] = {11,12};
|
||||
link17[] = {12,1};
|
||||
link18[] = {13,5};
|
||||
link19[] = {14,13};
|
||||
link20[] = {16,17};
|
||||
link21[] = {17,5};
|
||||
link22[] = {18,19};
|
||||
link23[] = {19,5};
|
||||
globals[] = {25.000000,1,0,0,0,640,480,1,30,6316128,1,-419.782135,377.473389,510.243530,-212.601486,675,612,1};
|
||||
window[] = {0,-1,-1,-1,-1,888,130,1408,130,1,693};
|
||||
*//*%FSM</HEAD>*/
|
||||
class FSM
|
||||
{
|
||||
@@ -80,7 +90,27 @@ class FSM
|
||||
to="update_objects";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"( (count needUpdate_objects) > 0 && (diag_tickTime -_lastNeedUpdate>40) )"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/"_lastNeedUpdate = time;"/*%FSM</ACTION""">*/;
|
||||
action=/*%FSM<ACTION""">*/"_lastNeedUpdate = diag_tickTime;"/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "cleanup_groups">*/
|
||||
class cleanup_groups
|
||||
{
|
||||
priority = 1.000000;
|
||||
to="group_cleanup";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"((diag_tickTime - _lastCleanupGroups) > 10)"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/"_lastCleanupGroups = diag_tickTime;"/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "cleanup_vehicles">*/
|
||||
class cleanup_vehicles
|
||||
{
|
||||
priority = 1.000000;
|
||||
to="vehicle_cleanup";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"((diag_tickTime - _lastCleanupVehicles) > 5)"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/"_lastCleanupVehicles = diag_tickTime;"/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "time_sync">*/
|
||||
@@ -90,7 +120,7 @@ class FSM
|
||||
to="sync_the_time";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"((diag_tickTime - _lastUpdate) > 300)"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/"_lastUpdate = time;"/*%FSM</ACTION""">*/;
|
||||
action=/*%FSM<ACTION""">*/"_lastUpdate = diag_tickTime;"/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "true">*/
|
||||
@@ -111,7 +141,6 @@ class FSM
|
||||
{
|
||||
name = "sync_the_time";
|
||||
init = /*%FSM<STATEINIT""">*/"//Send request" \n
|
||||
"_lastUpdate = diag_tickTime;" \n
|
||||
"_key = ""CHILD:307:"";" \n
|
||||
"_result = _key call server_hiveReadWrite;" \n
|
||||
"_outcome = _result select 0;" \n
|
||||
@@ -156,32 +185,7 @@ class FSM
|
||||
class general_cleanup
|
||||
{
|
||||
name = "general_cleanup";
|
||||
init = /*%FSM<STATEINIT""">*/"if ((diag_tickTime - _lastCleanup) > 2) then {" \n
|
||||
" " \n
|
||||
" _safety = dayz_serverObjectMonitor;" \n
|
||||
"" \n
|
||||
" //Clean groups" \n
|
||||
" {" \n
|
||||
" diag_log (""CLEANUP: CHECKING GROUP WITH "" + str(count units _x) + "" UNITS"");" \n
|
||||
" if (count units _x==0) then {" \n
|
||||
" deleteGroup _x;" \n
|
||||
" diag_log (""CLEANUP: DELETING A GROUP"");" \n
|
||||
" };" \n
|
||||
" } forEach allGroups;" \n
|
||||
"" \n
|
||||
" //Check for hackers" \n
|
||||
" {" \n
|
||||
" if(vehicle _x != _x && !(vehicle _x in _safety) && (isPlayer _x) && (typeOf vehicle _x) != ""ParachuteWest"") then {" \n
|
||||
" diag_log (""CLEANUP: KILLING A HACKER "" + (name _x) + "" "" + str(_x) + "" IN "" + (typeOf vehicle _x));" \n
|
||||
" (vehicle _x) setDamage 1;" \n
|
||||
" _x setDamage 1;" \n
|
||||
" };" \n
|
||||
" } forEach allUnits;" \n
|
||||
"" \n
|
||||
" dayz_serverObjectMonitor = _safety;" \n
|
||||
"" \n
|
||||
" _lastCleanup = diag_tickTime;" \n
|
||||
"};"/*%FSM</STATEINIT""">*/;
|
||||
init = /*%FSM<STATEINIT""">*/"//diag_log ""CLEANUP: Starting loop for next task"";"/*%FSM</STATEINIT""">*/;
|
||||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
||||
class Links
|
||||
{
|
||||
@@ -209,7 +213,8 @@ class FSM
|
||||
"" \n
|
||||
"_lastUpdate = diag_tickTime;" \n
|
||||
"_lastNeedUpdate = diag_tickTime;" \n
|
||||
"_lastCleanup = diag_tickTime;" \n
|
||||
"_lastCleanupVehicles = diag_tickTime;" \n
|
||||
"_lastCleanupGroups = diag_tickTime;" \n
|
||||
""/*%FSM</STATEINIT""">*/;
|
||||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
||||
class Links
|
||||
@@ -233,12 +238,71 @@ class FSM
|
||||
name = "update_objects";
|
||||
init = /*%FSM<STATEINIT""">*/"//diag_log format[""DEBUG: needUpdate_objects=%1"",needUpdate_objects];" \n
|
||||
"{" \n
|
||||
"// _x setVariable [""needUpdate"",false,true];" \n
|
||||
" needUpdate_objects = needUpdate_objects - [_x];" \n
|
||||
" [_x,""all""] call server_updateObject;" \n
|
||||
"" \n
|
||||
"} forEach needUpdate_objects;" \n
|
||||
"_lastNeedUpdate = diag_tickTime;"/*%FSM</STATEINIT""">*/;
|
||||
"} forEach needUpdate_objects;"/*%FSM</STATEINIT""">*/;
|
||||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
||||
class Links
|
||||
{
|
||||
/*%FSM<LINK "true">*/
|
||||
class true
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="general_cleanup";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
};
|
||||
};
|
||||
/*%FSM</STATE>*/
|
||||
/*%FSM<STATE "group_cleanup">*/
|
||||
class group_cleanup
|
||||
{
|
||||
name = "group_cleanup";
|
||||
init = /*%FSM<STATEINIT""">*/"//Clean groups" \n
|
||||
"{" \n
|
||||
" // diag_log (""CLEANUP: CHECKING GROUP WITH "" + str(count units _x) + "" UNITS"");" \n
|
||||
" if (count units _x==0) then {" \n
|
||||
" deleteGroup _x;" \n
|
||||
" diag_log (""CLEANUP: DELETING A GROUP"");" \n
|
||||
" };" \n
|
||||
"} forEach allGroups;" \n
|
||||
""/*%FSM</STATEINIT""">*/;
|
||||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
||||
class Links
|
||||
{
|
||||
/*%FSM<LINK "true">*/
|
||||
class true
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="general_cleanup";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
};
|
||||
};
|
||||
/*%FSM</STATE>*/
|
||||
/*%FSM<STATE "vehicle_cleanup">*/
|
||||
class vehicle_cleanup
|
||||
{
|
||||
name = "vehicle_cleanup";
|
||||
init = /*%FSM<STATEINIT""">*/"_safety = dayz_serverObjectMonitor;" \n
|
||||
"" \n
|
||||
"//Check for hackers" \n
|
||||
" {" \n
|
||||
" if(vehicle _x != _x && !(vehicle _x in _safety) && (isPlayer _x) && (typeOf vehicle _x) != ""ParachuteWest"") then {" \n
|
||||
" diag_log (""CLEANUP: KILLING A HACKER "" + (name _x) + "" "" + str(_x) + "" IN "" + (typeOf vehicle _x));" \n
|
||||
" (vehicle _x) setDamage 1;" \n
|
||||
" _x setDamage 1;" \n
|
||||
" };" \n
|
||||
" } forEach allUnits;" \n
|
||||
"" \n
|
||||
"dayz_serverObjectMonitor = _safety;"/*%FSM</STATEINIT""">*/;
|
||||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
||||
class Links
|
||||
{
|
||||
|
||||
@@ -66,7 +66,7 @@ if (isServer and isNil "sm_done") then {
|
||||
diag_log "HIVE: trying to get objects";
|
||||
_key = format["CHILD:302:%1:", dayZ_instance];
|
||||
_hiveResponse = _key call server_hiveReadWrite;
|
||||
if ((((isnil "_hiveResponse") || {(typeName _hiveResponse != "ARRAY")}) || {((typeName (_hiveResponse select 1)) != "SCALAR")}) || {(_hiveResponse select 1 > 2000)}) then {
|
||||
if ((((isnil "_hiveResponse") || {(typeName _hiveResponse != "ARRAY")}) || {((typeName (_hiveResponse select 1)) != "SCALAR")})) then {
|
||||
diag_log ("HIVE: connection problem... HiveExt response:"+str(_hiveResponse));
|
||||
_hiveResponse = ["",0];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user