mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-22 20:12:20 +03:00
1.0.2.38 Dev
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
DayZ Base Building
|
||||
Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
|
||||
*/
|
||||
private ["_location","_dir","_classname","_item","_hasrequireditem","_missing","_hastoolweapon","_cancel","_reason","_started","_finished","_animState","_isMedic","_dis","_sfx","_hasbuilditem","_tmpbuilt","_onLadder","_isWater","_require","_text","_offset","_IsNearPlot","_isOk","_location1","_location2","_counter","_limit","_proceed","_num_removed","_position","_object","_canBuildOnPlot","_friendlies","_nearestPole","_ownerID","_findNearestPoles","_findNearestPole","_distance","_classnametmp","_ghost","_isPole","_needText","_lockable","_zheightchanged","_rotate","_combination_1","_combination_2","_combination_3","_combination_4","_combination","_combination_1_Display","_combinationDisplay","_zheightdirection","_ztick"];
|
||||
private ["_location","_dir","_classname","_item","_hasrequireditem","_missing","_hastoolweapon","_cancel","_reason","_started","_finished","_animState","_isMedic","_dis","_sfx","_hasbuilditem","_tmpbuilt","_onLadder","_isWater","_require","_text","_offset","_IsNearPlot","_isOk","_location1","_location2","_counter","_limit","_proceed","_num_removed","_position","_object","_canBuildOnPlot","_friendlies","_nearestPole","_ownerID","_findNearestPoles","_findNearestPole","_distance","_classnametmp","_ghost","_isPole","_needText","_lockable","_zheightchanged","_rotate","_combination_1","_combination_2","_combination_3","_combination_4","_combination","_combination_1_Display","_combinationDisplay","_zheightdirection","_tick"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["\n\nBuilding already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
@@ -15,11 +15,21 @@ _isWater = dayz_isSwimming;
|
||||
_cancel = false;
|
||||
_reason = "";
|
||||
_canBuildOnPlot = false;
|
||||
DZE_BuildingZ = 0;
|
||||
|
||||
DZE_cancelBuilding = false;
|
||||
DZE_Q = false;
|
||||
DZE_Z = false;
|
||||
|
||||
DZE_Q_alt = false;
|
||||
DZE_Z_alt = false;
|
||||
|
||||
DZE_Q_ctrl = false;
|
||||
DZE_Z_ctrl = false;
|
||||
|
||||
DZE_5 = false;
|
||||
DZE_4 = false;
|
||||
DZE_6 = false;
|
||||
|
||||
DZE_cancelBuilding = false;
|
||||
|
||||
call gear_ui_init;
|
||||
closeDialog 1;
|
||||
@@ -42,6 +52,10 @@ if(isNumber (configFile >> "CfgVehicles" >> _classname >> "lockable")) then {
|
||||
|
||||
_offset = getArray (configFile >> "CfgVehicles" >> _classname >> "offset");
|
||||
|
||||
if((count _offset) <= 0) then {
|
||||
_offset = [0,1.5,0];
|
||||
};
|
||||
|
||||
_isPole = (_classname == "Plastic_Pole_EP1_DZ");
|
||||
|
||||
_distance = 30;
|
||||
@@ -127,20 +141,51 @@ if (_hasrequireditem) then {
|
||||
|
||||
_position = getPosATL _object;
|
||||
|
||||
cutText ["Planning construction: PgUp = raise, PgDn = lower, Q or E = flip 180, and Space-Bar to build.", "PLAIN DOWN"];
|
||||
|
||||
while {_isOk} do {
|
||||
|
||||
_zheightchanged = false;
|
||||
_zheightdirection = "";
|
||||
_rotate = false;
|
||||
_tick = 1;
|
||||
|
||||
if (DZE_Q) then {
|
||||
DZE_Q = false;
|
||||
_zheightdirection = "up";
|
||||
_zheightchanged = true;
|
||||
_tick = 10;
|
||||
};
|
||||
if (DZE_Z) then {
|
||||
DZE_Z = false;
|
||||
_zheightdirection = "down";
|
||||
_zheightchanged = true;
|
||||
_tick = 10;
|
||||
};
|
||||
|
||||
|
||||
if (DZE_Q_alt) then {
|
||||
DZE_Q_alt = false;
|
||||
_zheightdirection = "up_alt";
|
||||
_zheightchanged = true;
|
||||
_tick = 100;
|
||||
};
|
||||
if (DZE_Z_alt) then {
|
||||
DZE_Z_alt = false;
|
||||
_zheightdirection = "down_alt";
|
||||
_zheightchanged = true;
|
||||
_tick = 100;
|
||||
};
|
||||
|
||||
|
||||
if (DZE_Q_ctrl) then {
|
||||
DZE_Q_ctrl = false;
|
||||
_zheightdirection = "up_ctrl";
|
||||
_zheightchanged = true;
|
||||
};
|
||||
if (DZE_Z_ctrl) then {
|
||||
DZE_Z_ctrl = false;
|
||||
_zheightdirection = "down_ctrl";
|
||||
_zheightchanged = true;
|
||||
};
|
||||
|
||||
@@ -167,13 +212,27 @@ if (_hasrequireditem) then {
|
||||
_position = getPosATL _object;
|
||||
|
||||
// make z height stick to ticks
|
||||
_ztick = (round((_position select 2)*10)/10);
|
||||
// _ztick = (round((_position select 2)*100)/100);
|
||||
|
||||
if(_zheightdirection == "up") then {
|
||||
_position = [(_position select 0),(_position select 1), (_ztick+0.1)];
|
||||
_position = [(_position select 0),(_position select 1), ((_position select 2)+0.1)];
|
||||
};
|
||||
if(_zheightdirection == "down") then {
|
||||
_position = [(_position select 0),(_position select 1), (_ztick-0.1)];
|
||||
_position = [(_position select 0),(_position select 1), ((_position select 2)-0.1)];
|
||||
};
|
||||
|
||||
if(_zheightdirection == "up_alt") then {
|
||||
_position = [(_position select 0),(_position select 1), ((_position select 2)+1)];
|
||||
};
|
||||
if(_zheightdirection == "down_alt") then {
|
||||
_position = [(_position select 0),(_position select 1), ((_position select 2)-1)];
|
||||
};
|
||||
|
||||
if(_zheightdirection == "up_ctrl") then {
|
||||
_position = [(_position select 0),(_position select 1), ((_position select 2)+0.01)];
|
||||
};
|
||||
if(_zheightdirection == "down_ctrl") then {
|
||||
_position = [(_position select 0),(_position select 1), ((_position select 2)-0.01)];
|
||||
};
|
||||
|
||||
_object setDir (getDir _object);
|
||||
@@ -184,11 +243,9 @@ if (_hasrequireditem) then {
|
||||
|
||||
_object attachTo [player];
|
||||
|
||||
diag_log format["DEBUG AChange BUILDING POS: %1", _position];
|
||||
|
||||
};
|
||||
|
||||
cutText ["Planning construction: PgUp = raise, PgDn = lower, Q or E = flip 180, and Space-Bar to build.", "PLAIN DOWN"];
|
||||
|
||||
|
||||
sleep 1;
|
||||
|
||||
@@ -211,14 +268,17 @@ if (_hasrequireditem) then {
|
||||
deleteVehicle _object;
|
||||
};
|
||||
|
||||
if(_counter >= 50) exitWith {
|
||||
if(_counter >= 500) exitWith {
|
||||
_isOk = false;
|
||||
_cancel = true;
|
||||
_reason = "Ran out of time to find position.";
|
||||
detach _object;
|
||||
deleteVehicle _object;
|
||||
};
|
||||
_counter = _counter + 1;
|
||||
|
||||
cutText [format["%1",(500-_counter)], "PLAIN DOWN"];
|
||||
|
||||
_counter = _counter + _tick;
|
||||
|
||||
if (player getVariable["combattimeout", 0] >= time) exitWith {
|
||||
_isOk = false;
|
||||
@@ -235,6 +295,8 @@ if (_hasrequireditem) then {
|
||||
detach _object;
|
||||
deleteVehicle _object;
|
||||
};
|
||||
|
||||
|
||||
};
|
||||
|
||||
// No building on roads
|
||||
@@ -388,8 +450,13 @@ if (_hasrequireditem) then {
|
||||
} else {
|
||||
_tmpbuilt setVariable ["CharacterID",dayz_characterID,true];
|
||||
|
||||
dayzPublishObj = [dayz_characterID,_tmpbuilt,[_dir,_location],_classname];
|
||||
publicVariableServer "dayzPublishObj";
|
||||
// fire?
|
||||
if(_tmpbuilt isKindOf "Land_Fire") then {
|
||||
_tmpbuilt spawn player_fireMonitor;
|
||||
} else {
|
||||
dayzPublishObj = [dayz_characterID,_tmpbuilt,[_dir,_location],_classname];
|
||||
publicVariableServer "dayzPublishObj";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user