1.0.2.37 DEV

This commit is contained in:
[VB]AWOL
2013-09-28 21:46:51 -05:00
parent 2d65f9e950
commit ff256dd234
19 changed files with 214 additions and 86 deletions

View File

@@ -0,0 +1,4 @@
player removeAction s_player_showname;
player removeAction s_player_showname1;
s_player_showname = 1;
player setVariable["DZE_display_name",(_this select 3),true];

View File

@@ -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"];
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"];
if(TradeInprogress) exitWith { cutText ["\n\nBuilding already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
@@ -11,7 +11,7 @@ TradeInprogress = true;
if((count ((position player) nearObjects ["All",30])) >= DZE_BuildingLimit) exitWith {TradeInprogress = false; cutText ["\n\nCannot build, too many objects witin 30m.", "PLAIN DOWN"];};
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_isWater = (surfaceIsWater (getPosATL player)) or dayz_isSwimming;
_isWater = dayz_isSwimming;
_cancel = false;
_reason = "";
_canBuildOnPlot = false;
@@ -111,13 +111,9 @@ if (_hasrequireditem) then {
_counter = 0;
_isOk = true;
// get inital players position
_location1 = getPosATL player;
_dir = getDir player;
_position = player modeltoworld _offset;
_position = [(_position select 0),(_position select 1), (_position select 2)];
// hintSilent str (_position);
// if ghost preview available use that instead
if (_ghost == "") then {
@@ -127,28 +123,27 @@ if (_hasrequireditem) then {
_object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
};
_object setDir _dir;
_object setPos _position;
_object attachTo [player];
_object attachTo [player,_offset];
_position = getPosATL _object;
while {_isOk} do {
_zheightchanged = false;
_zheightdirection = "";
_rotate = false;
if (DZE_Q) then {
DZE_Q = false;
DZE_BuildingZ = DZE_BuildingZ + 0.1;
_zheightdirection = "up";
_zheightchanged = true;
};
if (DZE_Z) then {
DZE_Z = false;
DZE_BuildingZ = DZE_BuildingZ - 0.1;
_zheightdirection = "down";
_zheightchanged = true;
};
_rotate = false;
if (DZE_4) then {
_rotate = true;
DZE_4 = false;
@@ -161,21 +156,36 @@ if (_hasrequireditem) then {
};
if(_rotate) then {
_position = player modeltoworld _offset;
_position = [(_position select 0),(_position select 1), (_position select 2)+DZE_BuildingZ];
_object setDir _dir;
_object setPos _position;
_object setPosATL _position;
diag_log format["DEBUG Rotate BUILDING POS: %1", _position];
};
if(_zheightchanged) then {
detach _object;
_position = player modeltoworld _offset;
_position = [(_position select 0),(_position select 1), (_position select 2)+DZE_BuildingZ];
_position = getPosATL _object;
// make z height stick to ticks
_ztick = (round((_position select 2)*10)/10);
if(_zheightdirection == "up") then {
_position = [(_position select 0),(_position select 1), (_ztick+0.1)];
};
if(_zheightdirection == "down") then {
_position = [(_position select 0),(_position select 1), (_ztick-0.1)];
};
_object setDir (getDir _object);
_object setPos _position;
_object setPosATL _position;
diag_log format["DEBUG Change BUILDING POS: %1", _position];
_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"];
@@ -188,6 +198,8 @@ if (_hasrequireditem) then {
_isOk = false;
detach _object;
_dir = getDir _object;
_position = getPosATL _object;
diag_log format["DEBUG BUILDING POS: %1", _position];
deleteVehicle _object;
};
@@ -225,25 +237,6 @@ if (_hasrequireditem) then {
};
};
_classname = _classnametmp;
// Start Build
_tmpbuilt = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
_tmpbuilt setdir _dir;
// Get position based on player
_location = player modeltoworld _offset;
_location = [(_location select 0),(_location select 1),(_position select 2)];
//hintSilent str (_location);
_tmpbuilt setpos _location;
// No building on roads
if (isOnRoad _location) then { _cancel = true; _reason = "Cannot build on a road."; };
@@ -253,6 +246,19 @@ if (_hasrequireditem) then {
if(!_cancel) then {
_classname = _classnametmp;
// Start Build
_tmpbuilt = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
_tmpbuilt setdir _dir;
// Get position based on object
_location = _position;
_tmpbuilt setPosATL _location;
cutText [format["Placing %1, move to cancel.",_text], "PLAIN DOWN"];
_limit = 3;