diff --git a/SQF/dayz_code/Configs/CfgExtra/snappoints.hpp b/SQF/dayz_code/Configs/CfgExtra/snappoints.hpp index 0cc12c0ca..320ad90a5 100644 --- a/SQF/dayz_code/Configs/CfgExtra/snappoints.hpp +++ b/SQF/dayz_code/Configs/CfgExtra/snappoints.hpp @@ -123,7 +123,7 @@ class SnapBuilding { "CinderWallDoorSmall_DZ", "MetalFloor_DZ" }; - radius = 5; + radius = 7; }; class WoodFloorQuarter_Preview_DZ: FloorsWallsStairs { //fix for broken offsets in ghost @@ -246,7 +246,7 @@ class SnapBuilding { {2.752, 0, 1.5,"Right"}, {0, 0, 3.37042,"Top"} }; - radius = 5; + radius = 10; }; class CinderWall_Preview_DZ: Cinder_DZE {}; class CinderWallDoorway_Preview_DZ: Cinder_DZE {}; @@ -283,7 +283,7 @@ class SnapBuilding { {-2.64, 0, 0.009,"Left"}, {2.64, 0, 0.009,"Right"} }; - radius = 10; + radius = 12; }; class MetalFloor_DZ: FloorsWallsStairs{ points[] = { @@ -293,7 +293,7 @@ class SnapBuilding { {-2.64, 0, 0.15,"Left"}, {2.64, 0, 0.15,"Right"} }; - radius = 10; + radius = 12; }; @@ -340,7 +340,7 @@ class SnapBuilding { snapTo[] = { "StickFence_DZ" }; - radius = 5; + radius = 10; points[] = { {0,0,0,"Pivot"}, {-2.95,0,0.3,"Left"}, @@ -352,7 +352,7 @@ class SnapBuilding { snapTo[] = { "Fence_corrugated_DZ" }; - radius = 5; + radius = 10; points[] = { {0,0,0,"Pivot"}, {-1.95,0,0.88,"Left"}, @@ -364,7 +364,7 @@ class SnapBuilding { snapTo[] = { "WoodRamp_DZ" }; - radius = 5; + radius = 7; points[] = { {0,0,0,"Pivot"}, {0.65,-1.7,1.2,"Back"}, diff --git a/SQF/dayz_code/Configs/CfgMagazines.hpp b/SQF/dayz_code/Configs/CfgMagazines.hpp index 684dcfdda..74ceb2488 100644 --- a/SQF/dayz_code/Configs/CfgMagazines.hpp +++ b/SQF/dayz_code/Configs/CfgMagazines.hpp @@ -1666,6 +1666,8 @@ class CfgMagazines { #include "CfgMagazines\MeleeSwing.hpp" + #include "CfgMagazines\Planting.hpp" + class HandGrenade_Stone; class ItemTrashToiletpaper : HandGrenade_Stone { scope = public; @@ -1707,6 +1709,15 @@ class CfgMagazines { output[] = {{"ItemCanvas",1}}; input[] = {{"ItemKiloHemp",1}}; }; + class Crafting1 + { + text = "Craft Hemp Seeds"; + script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; + neednearby[] = {""}; + requiretools[] = {"ItemKnife"}; + output[] = {{"ItemHempSeed",5}}; + input[] = {{"ItemKiloHemp",1}}; + }; }; }; }; diff --git a/SQF/dayz_code/Configs/CfgMagazines/DZE/Food.hpp b/SQF/dayz_code/Configs/CfgMagazines/DZE/Food.hpp index 923b0dc65..506303747 100644 --- a/SQF/dayz_code/Configs/CfgMagazines/DZE/Food.hpp +++ b/SQF/dayz_code/Configs/CfgMagazines/DZE/Food.hpp @@ -64,6 +64,18 @@ class FoodPumpkin : FoodEdible { weight = 1; model = "z\addons\dayz_communityassets\models\pistachio.p3d"; // TODO: model + icon picture = "\z\addons\dayz_communityassets\pictures\equip_pistachios_CA.paa"; + class ItemActions + { + class Crafting + { + text = "Craft Pumpkin Seeds"; + script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; + neednearby[] = {""}; + requiretools[] = {"ItemKnife"}; + output[] = {{"ItemPumpkinSeed",5}}; + input[] = {{"FoodPumpkin",1}}; + }; + }; }; class FoodSunFlowerSeed : FoodEdible { scope = public; diff --git a/SQF/dayz_code/Configs/CfgMagazines/Planting.hpp b/SQF/dayz_code/Configs/CfgMagazines/Planting.hpp new file mode 100644 index 000000000..cc5ec358e --- /dev/null +++ b/SQF/dayz_code/Configs/CfgMagazines/Planting.hpp @@ -0,0 +1,93 @@ +class ItemFertilizer: CA_Magazine { + scope = public; + count = 1; + displayName = "Fertilizer"; + descriptionShort = "Fertilizer"; + weight = 0.1; + model = "z\addons\dayz_communityassets\models\mre.p3d"; // TODO: model + icon + picture = "\z\addons\dayz_communityassets\pictures\equip_mre_CA.paa"; + type = 256; +}; + +class ItemPumpkinSeed: CA_Magazine { + scope = public; + count = 1; + displayName = "A Pumpkin Seed"; + descriptionShort = "A Pumpkin Seed"; + weight = 0.1; + model = "\z\addons\dayz_epoch\models\doc_child1.p3d"; // TODO: model + icon + picture = "\z\addons\dayz_epoch\pictures\equip_child1_ca.paa"; + type = 256; + class ItemActions { + class Crafting + { + text = "Craft Pumpkin Plant"; + script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; + neednearby[] = {""}; + requiretools[] = {"ItemKnife"}; + output[] = {{"ItemPumpkinPlant",1},{"ItemWaterbottleUnfilled",1}}; + input[] = {{"ItemPumpkinSeed",1},{"ItemFertilizer",1},{"ItemWaterbottle",1}}; + }; + }; +}; + +class ItemPumpkinPlant: CA_Magazine { + scope = public; + count = 1; + displayName = "A Pumpkin Plant"; + descriptionShort = "A Pumpkin Plant"; + weight = 0.1; + model = "\z\addons\dayz_epoch\models\doc_child1.p3d"; // TODO: model + icon + picture = "\z\addons\dayz_epoch\pictures\equip_child1_ca.paa"; + type = 256; + class ItemActions { + class Build { + text = "Plant Pumpkin"; + script = "spawn player_build;"; + require[] = {"ItemEtool"}; + create = "Grave"; // TODO: model for Pumpkin Stage 1 + }; + }; +}; + +class ItemHempSeed: CA_Magazine { + scope = public; + count = 1; + displayName = "A Hemp Seed"; + descriptionShort = "A Hemp Seed"; + weight = 0.1; + model = "\z\addons\dayz_epoch\models\doc_child2.p3d"; // TODO: model + icon + picture = "\z\addons\dayz_epoch\pictures\equip_child2_ca.paa"; + type = 256; + class ItemActions { + class Crafting + { + text = "Craft Hemp Plant"; + script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; + neednearby[] = {""}; + requiretools[] = {"ItemKnife"}; + output[] = {{"ItemHempPlant",1},{"ItemWaterbottleUnfilled",1}}; + input[] = {{"ItemHempSeed",1},{"ItemFertilizer",1},{"ItemWaterbottle",1}}; + }; + }; +}; + +class ItemHempPlant: CA_Magazine { + scope = public; + count = 1; + type = 256; + displayName = "A Hemp Plant"; + descriptionShort = "A Hemp Plant"; + weight = 0.1; + model = "\z\addons\dayz_epoch\models\doc_child2.p3d"; // TODO: model + icon + picture = "\z\addons\dayz_epoch\pictures\equip_child2_ca.paa"; + type = 256; + class ItemActions { + class Build { + text = "Plant Hemp"; + script = "spawn player_build;"; + require[] = {"ItemEtool"}; + create = "MAP_c_fern"; // TODO: model for Hemp Stage 1 + }; + }; +}; \ No newline at end of file diff --git a/SQF/dayz_code/Configs/CfgVehicles/AIR/AH6.hpp b/SQF/dayz_code/Configs/CfgVehicles/AIR/AH6.hpp index 82b334199..c413a3f3f 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/AIR/AH6.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/AIR/AH6.hpp @@ -42,7 +42,7 @@ class AH6J_EP1_DZE: AH6J_EP1_DZ scope = 2; side = 2; displayName = "AH6J_DZE"; - magazines[] = {}; + magazines[] = {"60Rnd_CMFlareMagazine"}; }; class AH6X_DZ: AH6_Base_EP1 { displayname = "AH6X Little Bird"; diff --git a/SQF/dayz_code/Configs/CfgVehicles/LAND/Offroad_DSHKM.hpp b/SQF/dayz_code/Configs/CfgVehicles/LAND/Offroad_DSHKM.hpp index 83a8a96a7..89eded99d 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/LAND/Offroad_DSHKM.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/LAND/Offroad_DSHKM.hpp @@ -333,25 +333,112 @@ class Offroad_DSHKM_Gue_DZE: Offroad_DSHKM_base gunnerCompartments = "Compartment2"; }; }; + class Upgrades + { + ItemORP[] = {"Offroad_DSHKM_Gue_DZE1", + { }, + { + { "ItemORP",1 }, + { "PartEngine",2 } }}; + }; }; // Performance 1 class Offroad_DSHKM_Gue_DZE1: Offroad_DSHKM_Gue_DZE { maxspeed = 170; // Offroad_DSHKM_base 150 | car 100 + class Upgrades + { + ItemLRK[] = {"Offroad_DSHKM_Gue_DZE2", + { }, + { + { "ItemLRK",1 }, + { "PartGeneric",2 }, + { "ItemTent",1 } }}; + }; }; // Armmor 2 class Offroad_DSHKM_Gue_DZE2: Offroad_DSHKM_Gue_DZE1 { armor = 50; // car 20 + class HitPoints: HitPoints + { + class HitLFWheel: HitLFWheel + { + armor = 0.3; + }; + class HitLBWheel: HitLBWheel + { + armor = 0.3; + }; + class HitRFWheel: HitRFWheel + { + armor = 0.3; + }; + class HitRBWheel: HitRBWheel + { + armor = 0.3; + }; + class HitFuel + { + armor = 0.28; + material = -1; + name = "palivo"; + visual = ""; + passThrough = 1; + }; + class HitEngine + { + armor = 1; + material = -1; + name = "motor"; + visual = ""; + passThrough = 1; + }; + class HitGlass1: HitGlass1 + { + armor = 0.1; + }; + class HitGlass2: HitGlass2 + { + armor = 0.1; + }; + class HitGlass3: HitGlass3 + { + armor = 0.1; + }; + class HitGlass4: HitGlass4 + { + armor = 0.1; + }; + }; + class Upgrades + { + ItemLRK[] = {"Offroad_DSHKM_Gue_DZE3", + { }, + { + { "ItemLRK",1 }, + { "PartGeneric",2 }, + { "ItemTent",1 } }}; + }; + }; // Cargo 3 class Offroad_DSHKM_Gue_DZE3: Offroad_DSHKM_Gue_DZE2 { transportMaxWeapons = 20; // car 10 transportMaxMagazines = 100; // car 50 - transportmaxbackpacks = 4; // car 2 + transportmaxbackpacks = 4; // car 2 + class Upgrades + { + ItemTNK[] = {"Offroad_DSHKM_Gue_DZE4", + { }, + { + { "ItemTNK",1 }, + { "PartFueltank",2 } }}; + }; }; + // Fuel 4 class Offroad_DSHKM_Gue_DZE4: Offroad_DSHKM_Gue_DZE3 { diff --git a/SQF/dayz_code/Configs/cfgVehicles.hpp b/SQF/dayz_code/Configs/cfgVehicles.hpp index 99319d543..6ce1ba6b0 100644 --- a/SQF/dayz_code/Configs/cfgVehicles.hpp +++ b/SQF/dayz_code/Configs/cfgVehicles.hpp @@ -204,6 +204,174 @@ class CfgVehicles { }; }; }; + class Tank: landvehicle { + class Sounds: Sounds { + class Engine; + class Movement; + }; + driverOpticsModel = "\ca\Tracked\optika_tank_driver"; + commanderCanSee = 31; + gunnerCanSee = 30; + getInAction = "GetInMedium"; + getOutAction = "GetOutMedium"; + cargoGetInAction[] = {"GetInLow"}; + cargoGetOutAction[] = {"GetOutLow"}; + audible = 18; + sensitivityEar = "0.0075 /3"; + armorStructural = 2; + class AnimationSources; + class HitPoints { + class HitHull { + armor = 1; + material = -1; + name = "NEtelo"; + visual = "telo"; + passThrough = 1; + }; + class HitLTrack { + armor = 0.15; + material = -1; + name = "pas_L"; + visual = "pas_L"; + passThrough = 0.3; + }; + class HitRTrack { + armor = 0.15; + material = -1; + name = "pas_P"; + visual = "pas_P"; + passThrough = 0.3; + }; + class HitEngine { + armor = 0.35; + material = -1; + name = "motor"; + visual = "motor"; + passThrough = 0.2; + minimalHit = 0.02; + }; + }; + weapons[] = {}; + magazines[] = {}; + class Turrets { + class MainTurret: NewTurret { + gunnerAction = "ManActTestDriverOut"; + gunnerOpticsModel = "\ca\Tracked\optika_tank_gunner"; + gunnerOutOpticsModel = "\ca\Weapons\optika_empty"; + gunBeg = "usti hlavne"; + gunEnd = "konec hlavne"; + memoryPointsGetInGunner = "pos gunner"; + memoryPointsGetInGunnerDir = "pos gunner dir"; + gunnerGetInAction = "GetInHigh"; + gunnerGetOutAction = "GetOutHigh"; + viewGunnerInExternal = 0; + primaryGunner = 1; + gunnerOpticsEffect[] = {"TankGunnerOptics2","OpticsBlur1","OpticsCHAbera1"}; + gunnerOutOpticsEffect[] = {}; + class HitPoints { + class HitTurret { + armor = 1; + material = -1; + name = "vez"; + visual = "vez"; + passThrough = 1; + }; + class HitGun { + armor = 0.3; + material = -1; + name = "zbran"; + visual = "zbran"; + passThrough = 0; + }; + }; + class Turrets { + class CommanderOptics: NewTurret { + proxyType = "CPCommander"; + proxyIndex = 1; + gunnerName = "$STR_POSITION_COMMANDER"; + primaryGunner = 0; + primaryObserver = 1; + stabilizedInAxes = "StabilizedInAxesNone"; + body = "obsTurret"; + gun = "obsGun"; + animationSourceBody = "obsTurret"; + animationSourceGun = "obsGun"; + animationSourceHatch = "hatchCommander"; + soundServo[] = {"\ca\sounds\vehicles\servos\turret-1",0.01,1,10}; + gunBeg = ""; + gunEnd = ""; + minElev = -4; + maxElev = 20; + initElev = 0; + minTurn = -360; + maxTurn = 360; + initTurn = 0; + commanding = 2; + outGunnerMayFire = 1; + inGunnerMayFire = 1; + viewGunnerInExternal = 0; + gunnerOpticsModel = "\ca\Tracked\optika_tank_driver"; + gunnerOutOpticsModel = "\ca\Weapons\optika_empty"; + gunnerOutOpticsColor[] = {0,0,0,1}; + gunnerOutForceOptics = 0; + gunnerOutOpticsShowCursor = 0; + gunnerOpticsEffect[] = {}; + gunnerOutOpticsEffect[] = {}; + memoryPointGunnerOutOptics = "commander_weapon_view"; + memoryPointGunnerOptics = "commanderview"; + memoryPointsGetInGunner = "pos commander"; + memoryPointsGetInGunnerDir = "pos commander dir"; + gunnerGetInAction = "GetInHigh"; + gunnerGetOutAction = "GetOutHigh"; + memoryPointGun = "gun_muzzle"; + selectionFireAnim = "zasleh_1"; + class ViewOptics { + initAngleX = 0; + minAngleX = -30; + maxAngleX = 30; + initAngleY = 0; + minAngleY = -100; + maxAngleY = 100; + initFov = 0.155; + minFov = 0.0625; + maxFov = 0.466; + }; + class ViewGunner { + initAngleX = 5; + minAngleX = -65; + maxAngleX = 85; + initAngleY = 0; + minAngleY = -150; + maxAngleY = 150; + initFov = 0.7; + minFov = 0.25; + maxFov = 1.1; + }; + }; + }; + }; + }; + soundDammage[] = {"\ca\Tracked\Data\Sound\alarm_loop1",0.000316228,1}; + supplyRadius = 1.5; + class ViewOptics: ViewOptics { + initAngleX = 0; + minAngleX = -30; + maxAngleX = 30; + initAngleY = 0; + minAngleY = -100; + maxAngleY = 100; + initFov = 0.466; + minFov = 0.466; + maxFov = 0.466; + }; + class DefaultEventhandlers; + class Eventhandlers: DefaultEventhandlers{}; + smokeLauncherGrenadeCount = 6; + smokeLauncherVelocity = 15; + smokeLauncherOnTurret = 1; + smokeLauncherAngle = 120; + }; + // AIR #include "CfgVehicles\AIR\AN2.hpp" diff --git a/SQF/dayz_code/actions/modular_build.sqf b/SQF/dayz_code/actions/modular_build.sqf index 210a5599c..c9f9b771f 100644 --- a/SQF/dayz_code/actions/modular_build.sqf +++ b/SQF/dayz_code/actions/modular_build.sqf @@ -55,31 +55,34 @@ _isLandFireDZ = _itemConfig select 10; //bool //Check for nearby plotpoles. Returns [_IsNearPlot,_nearestPole,_ownerID,_friendlies] [int,Obj,int,array] [_isPole, _requireplot, _isLandFireDZ] call player_build_plotCheck; +if (DZE_ActionInProgress) then { //needed otherwise _hasRequired gets RPT error + //Check for build requirements (missing tools and items). Returns [_hasrequireditem,_reason] [bool,string] _hasRequired = [_require, _text, true, true] call player_build_buildReq; //define item collected from function _hasrequireditem = _hasRequired select 0; //bool -if (_hasrequireditem and DZE_ActionInProgress) then { - - //Create object that is attached to a player (i.e Ghost preview if available) - _buildObject = [_classname, _ghost, _offset, true] call player_build_create; - - //define items collected from function - _location1 = _buildObject select 0; //array - _object = _buildObject select 1; //Obj - _position = _buildObject select 2; // array - _objectHelper = _buildObject select 3; //Obj - - _controls = [_object, _isAllowedUnderGround, _location1, _position, _objectHelper] call player_build_controls; + if (_hasrequireditem) then { + + //Create object that is attached to a player (i.e Ghost preview if available) + _buildObject = [_classname, _ghost, _offset, true] call player_build_create; + + //define items collected from function + _location1 = _buildObject select 0; //array + _object = _buildObject select 1; //Obj + _position = _buildObject select 2; // array + _objectHelper = _buildObject select 3; //Obj + + _controls = [_object, _isAllowedUnderGround, _location1, _position, _objectHelper] call player_build_controls; - //define items collected from function - _cancel = _controls select 0; //bool - _reason = _controls select 1; //string - _position = _controls select 2; //array - _dir = _controls select 3; //int - - //Publish item to a database - [_cancel, _position, _classnametmp,_isAllowedUnderGround, _text, _isPole, _lockable,_dir, _reason] call player_build_publish; -}; + //define items collected from function + _cancel = _controls select 0; //bool + _reason = _controls select 1; //string + _position = _controls select 2; //array + _dir = _controls select 3; //int + + //Publish item to a database + [_cancel, _position, _classnametmp,_isAllowedUnderGround, _text, _isPole, _lockable,_dir, _reason] call player_build_publish; + }; +}; \ No newline at end of file diff --git a/SQF/dayz_code/actions/player_build_buildReq.sqf b/SQF/dayz_code/actions/player_build_buildReq.sqf index 4364c1094..976a6dc79 100644 --- a/SQF/dayz_code/actions/player_build_buildReq.sqf +++ b/SQF/dayz_code/actions/player_build_buildReq.sqf @@ -1,3 +1,4 @@ +if(!DZE_ActionInProgress) exitWith {}; //Check for build requirements like tools and if item is in magazines (check args to disable checks) private ["_passArray","_missing","_hasrequireditem","_require","_hastoolweapon","_hasbuilditem","_checkMag","_checkTools","_reason"]; @@ -20,11 +21,14 @@ _passArray = []; _hasbuilditem = DZE_buildItem in magazines player; +_passArray = [_hasrequireditem,_reason]; + if (_checkMag) then { //passed argument if (!_hasbuilditem) exitWith { //End script if magazine was not found DZE_ActionInProgress = false; cutText [format[(localize "str_player_31"),_text,"build"] , "PLAIN DOWN"]; _reason = "missing item"; + _passArray }; }; @@ -33,9 +37,8 @@ if (_checkTools) then { //passed argument DZE_ActionInProgress = false; cutText [format[(localize "str_epoch_player_137"),_missing] , "PLAIN DOWN"]; _reason = "missing tools"; + _passArray }; }; - -_passArray = [_hasrequireditem,_reason]; _passArray //[bool,string] diff --git a/SQF/dayz_code/actions/player_build_controls.sqf b/SQF/dayz_code/actions/player_build_controls.sqf index 6757f61db..6a17c2169 100644 --- a/SQF/dayz_code/actions/player_build_controls.sqf +++ b/SQF/dayz_code/actions/player_build_controls.sqf @@ -1,4 +1,4 @@ -private ["_canDo","_passArray","_objHDiff","_isOk","_zheightchanged","_zheightdirection","_rotate","_dir","_object","_position","_isAllowedUnderGround","_location2","_cancel","_reason","_lastDir","_objectHelper","_objectHelperDir","_objectHelperPos"]; +private ["_canDo","_passArray","_objHDiff","_isOk","_zheightchanged","_zheightdirection","_rotate","_dir","_object","_position","_isAllowedUnderGround","_location1","_location2","_cancel","_reason","_lastDir","_objectHelper","_objectHelperDir","_objectHelperPos"]; _object = _this select 0; _isAllowedUnderGround = _this select 1; @@ -142,8 +142,6 @@ while {_isOk} do { _objectHelper setPosATL _position; - //diag_log format["DEBUG Change BUILDING POS: %1", _position]; - if (!helperDetach) then { _objectHelper attachTo [player]; }; @@ -153,13 +151,13 @@ while {_isOk} do { _location2 = getPosATL player; _objectHelperPos = getPosATL _objectHelper; - + if(DZE_5) exitWith { _isOk = false; detach _object; - _dir = getDir _object; _position = getPosATL _object; - //diag_log format["DEBUG BUILDING POS: %1", _position]; + _dir = getDir _object; + deleteVehicle _object; detach _objectHelper; deleteVehicle _objectHelper; diff --git a/SQF/dayz_code/actions/player_build_countNearby.sqf b/SQF/dayz_code/actions/player_build_countNearby.sqf index c4949068f..d91b20b8e 100644 --- a/SQF/dayz_code/actions/player_build_countNearby.sqf +++ b/SQF/dayz_code/actions/player_build_countNearby.sqf @@ -1,7 +1,7 @@ -// disallow building if too many objects are found within 30m +// disallow building if too many objects are found within 30m (by default) private ["_cnt"]; -_cnt = count ((getPosATL player) nearObjects ["All",30]); +_cnt = count ((getPosATL player) nearObjects ["All",DZE_checkNearbyRadius]); if (_cnt >= DZE_BuildingLimit) exitWith { //end script if too many objects nearby DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_41"), "PLAIN DOWN"]; diff --git a/SQF/dayz_code/actions/player_build_getConfig.sqf b/SQF/dayz_code/actions/player_build_getConfig.sqf index b27f01004..a626ddcf3 100644 --- a/SQF/dayz_code/actions/player_build_getConfig.sqf +++ b/SQF/dayz_code/actions/player_build_getConfig.sqf @@ -1,3 +1,4 @@ +if(!DZE_ActionInProgress) exitWith {}; //Build an array of various variables gathered about build object from config files, only applies to legit buildable objects private ["_passArray","_classname","_classnametmp","_require","_text","_ghost","_lockable","_requireplot","_isAllowedUnderGround","_offset","_isPole","_isLandFireDZ"]; diff --git a/SQF/dayz_code/actions/player_build_needNearby.sqf b/SQF/dayz_code/actions/player_build_needNearby.sqf index e6eb22bd1..d6dfb82da 100644 --- a/SQF/dayz_code/actions/player_build_needNearby.sqf +++ b/SQF/dayz_code/actions/player_build_needNearby.sqf @@ -1,3 +1,4 @@ +if(!DZE_ActionInProgress) exitWith {}; //disallow building if required items (defined in config) are not found nearby private ["_abort","_reason","_distance","_needNear","_isNear"]; @@ -41,5 +42,3 @@ if (_abort) exitWith { cutText [format[(localize "str_epoch_player_135"),_reason,_distance], "PLAIN DOWN"]; DZE_ActionInProgress = false; }; - -_reason //return string to a caller diff --git a/SQF/dayz_code/actions/player_build_plotCheck.sqf b/SQF/dayz_code/actions/player_build_plotCheck.sqf index 8dc87c45b..00117e6c8 100644 --- a/SQF/dayz_code/actions/player_build_plotCheck.sqf +++ b/SQF/dayz_code/actions/player_build_plotCheck.sqf @@ -1,3 +1,4 @@ +if(!DZE_ActionInProgress) exitWith {}; //Check if nearby plotpoles exists private ["_passArray","_isPole","_needText","_distance","_findNearestPoles","_findNearestPole","_IsNearPlot","_requireplot","_isLandFireDZ","_canBuildOnPlot","_nearestPole","_ownerID","_friendlies"]; @@ -11,7 +12,6 @@ _canBuildOnPlot = false; _nearestPole = objNull; _ownerID = 0; _friendlies = []; -_passArray = []; if(_isPole) then { //check if object is plotpole and adjust distance accordingly _distance = DZE_PlotPole select 1; @@ -31,12 +31,6 @@ _findNearestPole = []; //must define an empty array to avoid problems _IsNearPlot = count (_findNearestPole); //count our new array of non-destroyed plotpoles. Empty array will return 0 -// End script early if item is plot pole and another one exists within defined radius -if(_isPole && _IsNearPlot > 0) exitWith { - DZE_ActionInProgress = false; - cutText [(localize "str_epoch_player_44") , "PLAIN DOWN"]; -}; - if(_IsNearPlot == 0) then { //No live plotpoles were found nearby // Allow building of plot if(_requireplot == 0 || _isLandFireDZ) then { @@ -68,10 +62,18 @@ if(_IsNearPlot == 0) then { //No live plotpoles were found nearby }; }; +_passArray = [_IsNearPlot,_nearestPole,_ownerID,_friendlies]; //create new array and pass it to caller + +// End script if item is plot pole and another one exists within defined radius +if(_isPole && _IsNearPlot > 0) exitWith { + DZE_ActionInProgress = false; + cutText [(localize "str_epoch_player_44") , "PLAIN DOWN"]; + _passArray +}; + if(!_canBuildOnPlot) exitWith { //end script if requirements were not met DZE_ActionInProgress = false; cutText [format[(localize "STR_EPOCH_PLAYER_135"),_needText,_distance] , "PLAIN DOWN"]; + _passArray }; - -_passArray = [_IsNearPlot,_nearestPole,_ownerID,_friendlies]; //create new array and pass it to caller _passArray //[int,Obj,int,array] diff --git a/SQF/dayz_code/actions/player_build_states.sqf b/SQF/dayz_code/actions/player_build_states.sqf index b79b8e98a..d5f16221f 100644 --- a/SQF/dayz_code/actions/player_build_states.sqf +++ b/SQF/dayz_code/actions/player_build_states.sqf @@ -1,3 +1,4 @@ +if(!DZE_ActionInProgress) exitWith {}; //disallow building if these conditions are not met private ["_isFine","_onLadder","_vehicle","_inVehicle"]; @@ -10,24 +11,28 @@ if (dayz_isSwimming) exitWith { //end script if player is swimming DZE_ActionInProgress = false; cutText [localize "str_player_26", "PLAIN DOWN"]; _isFine = "Swimming"; + _isFine }; if (_inVehicle) exitWith { //end script if player is in vehicle DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_42"), "PLAIN DOWN"]; _isFine = "In vehicle"; + _isFine }; if (_onLadder) exitWith { //end script if player is climbing on ladder DZE_ActionInProgress = false; cutText [localize "str_player_21", "PLAIN DOWN"]; _isFine = "On ladder"; + _isFine }; if (player getVariable["combattimeout", 0] >= time) exitWith { //end script if player is in combat DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_43"), "PLAIN DOWN"]; _isFine = "In combat"; + _isFine }; _isFine //returns string to caller, default is "ok" if conditions were not met diff --git a/SQF/dayz_code/actions/snap_build.sqf b/SQF/dayz_code/actions/snap_build.sqf index ba3d8850a..087d9a0b4 100644 --- a/SQF/dayz_code/actions/snap_build.sqf +++ b/SQF/dayz_code/actions/snap_build.sqf @@ -3,7 +3,7 @@ // July 10 2014 // /*--------------------------------*/ -private ["_object","_objectSnapGizmo","_objColorActive","_objColorInactive","_classname","_whitelist","_points","_radius","_cfg","_cnt","_pos","_findWhitelisted","_nearbyObject","_posNearby","_selectedAction","_newPos","_pointsNearby","_onWater"]; +private ["_object","_objectSnapGizmo","_objColorActive","_objColorInactive","_classname","_whitelist","_points","_radius","_cfg","_cnt","_pos","_findWhitelisted","_nearbyObject","_posNearby","_selectedAction","_newPos","_pointsNearby","_onWater","_waterBase"]; //Args snapActionState = _this select 3 select 0; _object = _this select 3 select 1; @@ -58,8 +58,10 @@ fnc_initSnapPoints = { fnc_initSnapPointsNearby = { _pos = getPosATL _object; - _findWhitelisted = []; _pointsNearby = []; - _findWhitelisted = nearestObjects [_pos,_whitelist,(_radius + DZE_snapExtraRange)]-[_object]; + _findWhitelisted = []; _pointsNearby = []; _waterBase = 0; + _onWater = surfaceIsWater position player; + if (_onWater) then { _waterBase = (getPosATL player select 2);}; + _findWhitelisted = nearestObjects [_pos,_whitelist,(_radius + DZE_snapExtraRange + _waterBase)]-[_object]; snapGizmosNearby = []; { _nearbyObject = _x; diff --git a/SQF/dayz_code/compile/fn_damageActions.sqf b/SQF/dayz_code/compile/fn_damageActions.sqf index a0527ef99..cdfd897f7 100644 --- a/SQF/dayz_code/compile/fn_damageActions.sqf +++ b/SQF/dayz_code/compile/fn_damageActions.sqf @@ -76,7 +76,7 @@ if (_inVehicle) then { if (!isNull _menClose && _hasPatient && !r_drag_sqf && !r_action && !_inVehicle && !r_player_unconscious && _isClose) then { _unit = cursorTarget; - _isDisallowRefuel = typeOf _unit in ["M240Nest_DZ"]; + _isDisallowRefuel = typeOf _unit in ["M240Nest_DZ","MMT_Civ","MMT_USMC","Old_bike_TK_CIV_EP1","Old_bike_TK_INS_EP1"]; // player reveal _unit; _vehClose = (getPosATL player) nearEntities [["Car","Tank","Helicopter","Plane","StaticWeapon","Ship"],5]; //nearestObjects [player, ["Car","Tank","Helicopter","Plane","StaticWeapon","Ship"], 5]; _hasVehicle = ({alive _x} count _vehClose > 0); diff --git a/SQF/dayz_code/compile/fn_selfActions.sqf b/SQF/dayz_code/compile/fn_selfActions.sqf index 94665a745..956dc5ec5 100644 --- a/SQF/dayz_code/compile/fn_selfActions.sqf +++ b/SQF/dayz_code/compile/fn_selfActions.sqf @@ -866,6 +866,10 @@ if (!isNull cursorTarget && !_inVehicle && !_isPZombie && (player distance curso s_player_SurrenderedGear = -1; //Others + player removeAction s_player_maintain_area; + s_player_maintain_area = -1; + player removeAction s_player_maintain_area_preview; + s_player_maintain_area_preview = -1; player removeAction s_player_forceSave; s_player_forceSave = -1; player removeAction s_player_flipveh; diff --git a/SQF/dayz_code/init/variables.sqf b/SQF/dayz_code/init/variables.sqf index c345e790b..b383c0b53 100644 --- a/SQF/dayz_code/init/variables.sqf +++ b/SQF/dayz_code/init/variables.sqf @@ -551,6 +551,9 @@ if (isNil "DZE_modularBuild") then { if (isNil "DZE_snapExtraRange") then { DZE_snapExtraRange = 0; }; +if (isNil "DZE_checkNearbyRadius") then { + DZE_checkNearbyRadius = 30; +}; // needed on server if(isNil "DZE_PlotPole") then { diff --git a/SQF/dayz_server/init/server_functions.sqf b/SQF/dayz_server/init/server_functions.sqf index e86ec45a2..3eb13bea3 100644 --- a/SQF/dayz_server/init/server_functions.sqf +++ b/SQF/dayz_server/init/server_functions.sqf @@ -914,7 +914,7 @@ server_logUnlockLockEvent = { [_obj, "gear"] call server_updateObject; _statusText = "LOCKED"; }; - _PUID = [_killer] call FNC_GetPlayerUID; + _PUID = [_player] call FNC_GetPlayerUID; diag_log format["SAFE %5: ID:%1 UID:%2 BY %3(%4)", _objectID, _objectUID, (name _player), _PUID, _statusText]; }; };