mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-04-19 10:46:40 +03:00
New building functions, vanilla building checks
DZE_RequiredItemsCheck returns bool, displays an error of all the tools the player is missing to build the item. DZE_BuildChecks returns array of bools, canBuild and if the item is a plotPole. Also has the ability to check if the player has required tools to build using DZE_RequiredItemsCheck. The vanilla build script still needs to be modified to work over water and allow players to place floating objects, but now uses plot checks. It would be easiest to just modify the configs to use the epoch building scripts instead. fnc_getSetPos now accepts a position as the second element of the input array. the object will be set to this position if it is used. This change requires no code updates Note: scripts with build and/or tool checks should be updated to use the new functions
This commit is contained in:
@@ -107,6 +107,10 @@ if (!_ok) exitWith {
|
||||
_msg call dayz_rollingMessages;
|
||||
};
|
||||
|
||||
_posReference = [player] call FNC_GetPos;
|
||||
|
||||
_canBuild = [_posReference, _item, false] call DZE_BuildChecks;
|
||||
if (!(_canBuild select 0)) exitWith {};
|
||||
|
||||
//localize "str_player_build_rotate" call dayz_rollingMessages;
|
||||
_msg = localize "str_player_build_rotate";
|
||||
@@ -288,7 +292,7 @@ _dir = getDir player;
|
||||
_object setDir _dir;
|
||||
Dayz_constructionContext = [_object, round (_dir/5)*5, cameraView, false, true, _keepOnSlope];
|
||||
// ghost, angle, previous camera, build view on/off, continue on/off, slope on/off
|
||||
_posReference = getPosATL player;
|
||||
//_posReference = getPosATL player;
|
||||
_objColliding = objNull;
|
||||
_best = [50,[0,0,0],[0,0,0]];
|
||||
_maxplanting = 10;
|
||||
|
||||
Reference in New Issue
Block a user