mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-18 09:32:02 +03:00
1.0.0.3 Developer Build
+ [FIXED] Battleye kick when calling dog. Thanks to @kikyou2 + [FIXED] Moved vehicle event handler to server side with a call to all connected clients. Before it was just set on only the owner and the server. This should fix issues with damage/repair handling of just purchased vehicles. + [FIXED] Fixed case sensitivity in building loot generation. This was only a problem on new maps that share the same buildings as others yet have differing case in the classnames. + [ADDED] New build-ables: Fence_corrugated_DZ, M240Nest_DZ, CanvasHut_DZ, ParkBench_DZ, MetalGate_DZ, OutHouse_DZ, Wooden_shed_DZ, WoodShack_DZ, StorageShed_DZ. + [ADDED] New crafting items: ItemCanvas, PartWoodLumber, PartWoodPlywood, ItemCorrugated, ItemPole + [ADDED] 55 gallon (210 liter) Fuel Barrel that can only be used on helicopters or fuel trucks. + [ADDED] All DayZ specific magazine items now only take one slot, this also makes it easier to become over burdened so be careful about blacking out. + [ADDED] More building loot spawn positions for Namalsk. + [FIXED] When packing tent get classname of new weapon_holder from config. + [CHANGED] Totally reworked player building system. Preview and placement accuracy has been significantly improved. Building now requires X number of stages to complete. Players cannot build while in combat. + [CHANGED] Added required tools array and is nearby checking for fire, etc. Also, each item can now have 5 separate crafting options. + [CHANGED] Reworked refuel and siphon code to support more can types. + [CHANGED] Removed all infinite fueling sources and added (KamazRefuel_DZ, UralRefuel_TK_EP1_DZ,MtvrRefuel_DES_EP1_DZ) variants of the fuel trucks to remove auto refuel and increase siphon-able fuel capacity to 10000. Old style refuel can still be used if the variable dayz_oldrefuel = true is set in the missions init.sqf. + [CHANGED] Remove object code now uses config variables instead of hard coded into sqf (default: constructioncount = 5) + [CHANGED] Moved most arrays for revealing objects, allowed objects, update objects, disallowed combat roll to arrays within variables.sqf. So that these arrays are unified and easier to change. + [CHANGED] New vehicle spawns now have a new fuel system using a random percent between min and max variables. Defaults: (DynamicVehicleFuelLow = 0; DynamicVehicleFuelHigh = 100;) + [CHANGED] New vehicle spawns now damage all parts and without a limiter on fuel and engine parts, this could cause a vehicle to be very close to blowing up. + [CHANGED] Disabled simulation server side of all road debris and crashes.
This commit is contained in:
@@ -1,127 +1,219 @@
|
||||
private["_location","_isOk","_dir","_classname","_item"];
|
||||
private ["_location","_dir","_classname","_item","_hasrequireditem","_missing","_hastoolweapon","_cancel","_reason","_isBuilding","_started","_finished","_animState","_isMedic","_startcombattimer","_dis","_sfx","_hasbuilditem","_tmpbuilt","_buildings","_onLadder","_isWater","_require","_text","_offset"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Building already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
||||
_isWater = (surfaceIsWater _location) or dayz_isSwimming;
|
||||
_bypass = false;
|
||||
_isWater = (surfaceIsWater (getPosATL player)) or dayz_isSwimming;
|
||||
_cancel = false;
|
||||
_reason = "";
|
||||
|
||||
// call gear_ui_init;
|
||||
call gear_ui_init;
|
||||
|
||||
if(_isWater) exitWith {cutText [localize "str_player_26", "PLAIN DOWN"];};
|
||||
if(_onLadder) exitWith {cutText [localize "str_player_21", "PLAIN DOWN"];};
|
||||
if(_isWater) exitWith {TradeInprogress = false; cutText [localize "str_player_26", "PLAIN DOWN"];};
|
||||
if(_onLadder) exitWith {TradeInprogress = false; cutText [localize "str_player_21", "PLAIN DOWN"];};
|
||||
if(player getVariable["combattimeout", 0] >= time) exitWith {TradeInprogress = false; cutText ["Cannot build while in combat.", "PLAIN DOWN"];};
|
||||
|
||||
_item = _this;
|
||||
_classname = getText (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Build" >> "create");
|
||||
_require = getText (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Build" >> "require");
|
||||
_require = getArray (configFile >> "cfgMagazines" >> _this >> "ItemActions" >> "Build" >> "require");
|
||||
|
||||
_text = getText (configFile >> "CfgVehicles" >> _classname >> "displayName");
|
||||
_attachToOffset = getArray (configFile >> "CfgVehicles" >> _classname >> "offset");
|
||||
_offset = getArray (configFile >> "CfgVehicles" >> _classname >> "offset");
|
||||
|
||||
_hasbuilditem = _this in magazines player;
|
||||
_hasrequireditem = _require in items player;
|
||||
_missing = "";
|
||||
_hasrequireditem = true;
|
||||
{
|
||||
_hastoolweapon = _x in weapons player;
|
||||
if(!_hastoolweapon) exitWith { _hasrequireditem = false; _missing = _x; }
|
||||
} forEach _require;
|
||||
|
||||
if (!_hasbuilditem) exitWith {cutText [format[(localize "str_player_31"),_text,"build"] , "PLAIN DOWN"]};
|
||||
if (_text == "TrapBear") then { _bypass = true; };
|
||||
_hasbuilditem = _this in magazines playwer;
|
||||
if (!_hasbuilditem) exitWith {TradeInprogress = false; cutText [format[(localize "str_player_31"),_text,"build"] , "PLAIN DOWN"]; };
|
||||
|
||||
if (_hasrequireditem or _bypass) then {
|
||||
|
||||
_dir = getDir player;
|
||||
if (!_hasrequireditem) exitWith {TradeInprogress = false; cutText [format["Missing tool %1",_missing] , "PLAIN DOWN"]; };
|
||||
if (_hasrequireditem) then {
|
||||
|
||||
_location = [0,0,0];
|
||||
_dir = getDir player;
|
||||
|
||||
// Start Preview loop
|
||||
_tmpbuilt = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
|
||||
_tmpbuilt setdir _dir;
|
||||
_tmpbuilt attachTo [player,_attachToOffset];
|
||||
player allowDamage false;
|
||||
|
||||
_position = player modeltoworld _offset;
|
||||
_position = [(_position select 0),(_position select 1), 0];
|
||||
|
||||
_object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
|
||||
|
||||
_object setDir _dir;
|
||||
|
||||
_object setPos _position;
|
||||
|
||||
_object allowDamage false;
|
||||
|
||||
_object attachTo [player];
|
||||
|
||||
_cancel = false;
|
||||
_counter = 0;
|
||||
_isOk = true;
|
||||
|
||||
|
||||
|
||||
while {_isOk} do {
|
||||
|
||||
if(_counter == 0) then {
|
||||
cutText ["Planning consruction stand still 5 seconds to build.", "PLAIN DOWN"];
|
||||
sleep 5;
|
||||
_location1 = getPosATL player;
|
||||
sleep 5;
|
||||
_location2 = getPosATL player;
|
||||
|
||||
if(_location1 distance _location2 < 0.1) exitWith {
|
||||
|
||||
cutText ["Started consruction move within 5 seconds to cancel.", "PLAIN DOWN"];
|
||||
_location3 = getPosATL player;
|
||||
sleep 5;
|
||||
_location4 = getPosATL player;
|
||||
|
||||
cutText ["Planning consruction stand still 5 seconds to build.", "PLAIN DOWN"];
|
||||
|
||||
_location1 = getPosATL player;
|
||||
sleep 5;
|
||||
_location2 = getPosATL player;
|
||||
|
||||
if(_location3 distance _location4 > 0.1) exitWith {
|
||||
_isOk = false;
|
||||
_cancel = true;
|
||||
};
|
||||
|
||||
_isOk = false;
|
||||
};
|
||||
if(_location1 distance _location2 < 0.1) exitWith {
|
||||
_isOk = false;
|
||||
};
|
||||
if(_counter >= 1) exitWith {
|
||||
|
||||
if(_location1 distance _location2 > 5) exitWith {
|
||||
_isOk = false;
|
||||
_cancel = true;
|
||||
_reason = "Moving to fast.";
|
||||
};
|
||||
|
||||
if(_counter >= 10) exitWith {
|
||||
_isOk = false;
|
||||
_cancel = true;
|
||||
_reason = "Ran out of time to find position.";
|
||||
};
|
||||
_counter = _counter + 1;
|
||||
};
|
||||
|
||||
detach _tmpbuilt;
|
||||
detach _object;
|
||||
deleteVehicle _object;
|
||||
|
||||
// Get location of detached tmp built
|
||||
_built_location = (getPosATL _tmpbuilt);
|
||||
|
||||
deleteVehicle _tmpbuilt;
|
||||
// Start Build
|
||||
_tmpbuilt = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
|
||||
|
||||
_dir = getDir player;
|
||||
_tmpbuilt setdir _dir;
|
||||
|
||||
// Get position based on player
|
||||
_location = player modeltoworld _offset;
|
||||
|
||||
// No building on roads
|
||||
if (isOnRoad _location) then { _cancel = true; _reason = "Cannot build on a road."; };
|
||||
|
||||
// set building with ground
|
||||
_location = [(_location select 0),(_location select 1), 0];
|
||||
_tmpbuilt setpos _location;
|
||||
|
||||
// set building with offset
|
||||
// _tmpbuilt setpos _location;
|
||||
|
||||
player allowDamage true;
|
||||
|
||||
|
||||
// testing new way of finding building
|
||||
_buildings = nearestObjects [(vehicle player), ["Building"], 100];
|
||||
{
|
||||
_isBuilding = [(vehicle player),_x] call fnc_isInsideBuilding;
|
||||
if(_isBuilding) exitWith {
|
||||
_cancel = true;
|
||||
_reason = "Cannot build inside another building.";
|
||||
};
|
||||
} forEach _buildings;
|
||||
|
||||
// No building in trader zones
|
||||
if(!placevault) then { _cancel = true; _reason = "Cannot build in a city."; };
|
||||
|
||||
if(!_cancel) then {
|
||||
|
||||
_dir = getDir player;
|
||||
player removeMagazine _item;
|
||||
|
||||
//disableSerialization;
|
||||
//call dayz_forceSave;
|
||||
|
||||
player playActionNow "Medic";
|
||||
sleep 1;
|
||||
|
||||
_dis=20;
|
||||
_sfx = "repair";
|
||||
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
|
||||
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
sleep 5;
|
||||
cutText [format["Placing %1, move to cancel.",_text], "PLAIN DOWN"];
|
||||
|
||||
_hasbuilditem = _this in magazines player;
|
||||
if (!_hasbuilditem) exitWith {cutText [format[(localize "str_player_31"),_text,"build"] , "PLAIN DOWN"]};
|
||||
_limit = 5;
|
||||
|
||||
player allowDamage false;
|
||||
_object = createVehicle [_classname, _built_location, [], 0, "CAN_COLLIDE"];
|
||||
_object setDir _dir;
|
||||
_object setpos _built_location;
|
||||
player reveal _object;
|
||||
if(isNumber (configFile >> "CfgVehicles" >> _objType >> "constructioncount")) then {
|
||||
_limit = getNumber(configFile >> "CfgVehicles" >> _objType >> "constructioncount");
|
||||
};
|
||||
|
||||
cutText [format[localize "str_build_01",_text], "PLAIN DOWN"];
|
||||
_isOk = true;
|
||||
_proceed = false;
|
||||
_counter = 0;
|
||||
|
||||
while {_isOk} do {
|
||||
|
||||
player playActionNow "Medic";
|
||||
|
||||
_dis=20;
|
||||
_sfx = "repair";
|
||||
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
|
||||
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
//["dayzPublishObj",[dayz_characterID,_object,[_dir,_location],_classname]] call callRpcProcedure;
|
||||
dayzPublishObj = [dayz_characterID,_object,[_dir,_location],_classname];
|
||||
publicVariableServer "dayzPublishObj";
|
||||
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;
|
||||
};
|
||||
if (r_interrupt or (player getVariable["combattimeout", 0] >= time)) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
sleep 2;
|
||||
player allowDamage true;
|
||||
|
||||
if(!_finished) exitWith {
|
||||
_isOk = false;
|
||||
_proceed = false;
|
||||
};
|
||||
|
||||
if(_finished) then {
|
||||
_counter = _counter + 1;
|
||||
};
|
||||
|
||||
cutText [format["Constructing %1 stage %2 of %3, move to cancel.",_text, _counter,_limit], "PLAIN DOWN"];
|
||||
|
||||
if(_counter == _limit) exitWith {
|
||||
_isOk = false;
|
||||
_proceed = true;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
if (_proceed) then {
|
||||
|
||||
_num_removed = ([player,_item] call BIS_fnc_invRemove);
|
||||
if(_num_removed == 1) then {
|
||||
|
||||
cutText [format[localize "str_build_01",_text], "PLAIN DOWN"];
|
||||
|
||||
//["dayzPublishObj",[dayz_characterID,_tmpbuilt,[_dir,_location],_classname]] call callRpcProcedure;
|
||||
dayzPublishObj = [dayz_characterID,_tmpbuilt,[_dir,_location],_classname];
|
||||
publicVariableServer "dayzPublishObj";
|
||||
} else {
|
||||
deleteVehicle _tmpbuilt;
|
||||
cutText ["Canceled building." , "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
} else {
|
||||
r_interrupt = false;
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
|
||||
deleteVehicle _tmpbuilt;
|
||||
|
||||
cutText ["Canceled building." , "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
} else {
|
||||
cutText [format["Canceled construction of %1.",_text], "PLAIN DOWN"];
|
||||
deleteVehicle _tmpbuilt;
|
||||
cutText [format["Canceled construction of %1 %2.",_text,_reason], "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
} else {
|
||||
cutText [format[localize "str_build_failed_01",_text], "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
TradeInprogress = false;
|
||||
Reference in New Issue
Block a user