From d940614669915ab5126bf242ea999f8d87516aa3 Mon Sep 17 00:00:00 2001 From: HARLAN Date: Mon, 9 Dec 2013 11:37:53 -0500 Subject: [PATCH 1/8] plot pole radius preview --- SQF/dayz_code/init/variables.sqf | 1 + 1 file changed, 1 insertion(+) diff --git a/SQF/dayz_code/init/variables.sqf b/SQF/dayz_code/init/variables.sqf index 45638ea5a..483ec14b5 100644 --- a/SQF/dayz_code/init/variables.sqf +++ b/SQF/dayz_code/init/variables.sqf @@ -247,6 +247,7 @@ dayz_resetSelfActions = { s_player_SurrenderedGear = -1; s_player_maintain_area = -1; s_player_maintain_area_preview = -1; + s_player_plotpole_preview = -1; }; call dayz_resetSelfActions; From f3130d2e375bc62a44560cc7bd3f0e7650153543 Mon Sep 17 00:00:00 2001 From: HARLAN Date: Mon, 9 Dec 2013 11:38:38 -0500 Subject: [PATCH 2/8] plot pole radius preview --- .../compile/object_showPlotRadius.sqf | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 SQF/dayz_code/compile/object_showPlotRadius.sqf diff --git a/SQF/dayz_code/compile/object_showPlotRadius.sqf b/SQF/dayz_code/compile/object_showPlotRadius.sqf new file mode 100644 index 000000000..c13bf728f --- /dev/null +++ b/SQF/dayz_code/compile/object_showPlotRadius.sqf @@ -0,0 +1,47 @@ +//Build preview adopted from Axe Cop (@vos) Base Destruction Script + +private ["_location","_object","_objects","_i","_dir","_nearPlotPole"]; + +// global vars +_nearPlotPole = nearestObject [player, "Plastic_Pole_EP1_DZ", 3]; + + +//"privatized" center variable +_BD_radius = 30; +_BD_center = getPos _nearPlotPole; + +player removeAction s_player_plotpole_preview; +s_player_plotpole_preview = -1; + + _objects = []; + +// circle +for "_i" from 0 to 360 step (270 / _BD_radius) do { + _location = [(_BD_center select 0) + ((cos _i) * _BD_radius), (_BD_center select 1) + ((sin _i) * _BD_radius), _BD_center select 2]; + _object = createVehicleLocal ["WoodLargeWall_Preview_DZ", _location, [], 0, "CAN_COLLIDE"]; + _dir = ((_BD_center select 0) - (_location select 0)) atan2 ((_BD_center select 1) - (_location select 1)); + _object setDir _dir; + _objects set [count _objects, _object]; + }; + +// top + _location = [_BD_center select 0, _BD_center select 1, (_BD_center select 2) + _BD_radius]; + _object = createVehicleLocal ["WoodFloor_Preview_DZ", _location, [], 0, "CAN_COLLIDE"]; + _objects set [count _objects, _object]; + + +_previewCounter = 30; +while {_previewCounter > 0} do { + cutText [format["Radius preview active for %1 seconds", _previewCounter], "PLAIN DOWN"]; + _previewCounter = _previewCounter - 1; + sleep 1; + }; + +// sleep now done in the while loop +// sleep 30; + + { + deleteVehicle _x; + } forEach _objects; + +s_player_plotpole_preview = -1; From 339e77e8d96f40ea9a5173a38ab3c7847a382953 Mon Sep 17 00:00:00 2001 From: HARLAN Date: Mon, 9 Dec 2013 11:41:12 -0500 Subject: [PATCH 3/8] plot pole radius preview --- SQF/dayz_code/compile/fn_selfActions.sqf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SQF/dayz_code/compile/fn_selfActions.sqf b/SQF/dayz_code/compile/fn_selfActions.sqf index 2d566820a..528ce0d60 100644 --- a/SQF/dayz_code/compile/fn_selfActions.sqf +++ b/SQF/dayz_code/compile/fn_selfActions.sqf @@ -190,11 +190,14 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu _player_lockUnlock_crtl = false; if (_canDo && (speed player <= 1) && (_cursorTarget isKindOf "Plastic_Pole_EP1_DZ")) then { + s_player_plotpole_preview = player addAction ["Preview Plot Radius", "\z\addons\dayz_code\compile\object_showPlotRadius.sqf",[], 0, false, true, "", ""]; if (s_player_maintain_area < 0) then { s_player_maintain_area = player addAction ["Maintain Area", "\z\addons\dayz_code\actions\maintain_area.sqf", "maintain", 5, false]; s_player_maintain_area_preview = player addAction ["Maintain Area Preview", "\z\addons\dayz_code\actions\maintain_area.sqf", "preview", 5, false]; }; } else { + player removeAction s_player_plotpole_preview; + s_player_plotpole_preview = -1; player removeAction s_player_maintain_area; s_player_maintain_area = -1; player removeAction s_player_maintain_area_preview; From 82f475c7a54382ec4eede3ddcb865491d1c2cc87 Mon Sep 17 00:00:00 2001 From: HARLAN Date: Wed, 11 Dec 2013 13:34:25 -0500 Subject: [PATCH 4/8] changed plot preview to Plastic_Pole_EP1, removed it as an addaction #846 --- .../compile/object_showPlotRadius.sqf | 27 +------------------ 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/SQF/dayz_code/compile/object_showPlotRadius.sqf b/SQF/dayz_code/compile/object_showPlotRadius.sqf index c13bf728f..26db786b4 100644 --- a/SQF/dayz_code/compile/object_showPlotRadius.sqf +++ b/SQF/dayz_code/compile/object_showPlotRadius.sqf @@ -10,38 +10,13 @@ _nearPlotPole = nearestObject [player, "Plastic_Pole_EP1_DZ", 3]; _BD_radius = 30; _BD_center = getPos _nearPlotPole; -player removeAction s_player_plotpole_preview; -s_player_plotpole_preview = -1; - _objects = []; // circle for "_i" from 0 to 360 step (270 / _BD_radius) do { _location = [(_BD_center select 0) + ((cos _i) * _BD_radius), (_BD_center select 1) + ((sin _i) * _BD_radius), _BD_center select 2]; - _object = createVehicleLocal ["WoodLargeWall_Preview_DZ", _location, [], 0, "CAN_COLLIDE"]; + _object = createVehicleLocal ["Plastic_Pole_EP1", _location, [], 0, "CAN_COLLIDE"]; _dir = ((_BD_center select 0) - (_location select 0)) atan2 ((_BD_center select 1) - (_location select 1)); _object setDir _dir; _objects set [count _objects, _object]; }; - -// top - _location = [_BD_center select 0, _BD_center select 1, (_BD_center select 2) + _BD_radius]; - _object = createVehicleLocal ["WoodFloor_Preview_DZ", _location, [], 0, "CAN_COLLIDE"]; - _objects set [count _objects, _object]; - - -_previewCounter = 30; -while {_previewCounter > 0} do { - cutText [format["Radius preview active for %1 seconds", _previewCounter], "PLAIN DOWN"]; - _previewCounter = _previewCounter - 1; - sleep 1; - }; - -// sleep now done in the while loop -// sleep 30; - - { - deleteVehicle _x; - } forEach _objects; - -s_player_plotpole_preview = -1; From 1556dce15a53e74fa7696dd0bf39170164d88d2d Mon Sep 17 00:00:00 2001 From: HARLAN Date: Wed, 11 Dec 2013 13:35:45 -0500 Subject: [PATCH 5/8] changed plot preview to Plastic_Pole_EP1, removed it as an addaction #846 --- SQF/dayz_code/compile/fn_selfActions.sqf | 3 --- 1 file changed, 3 deletions(-) diff --git a/SQF/dayz_code/compile/fn_selfActions.sqf b/SQF/dayz_code/compile/fn_selfActions.sqf index 528ce0d60..2d566820a 100644 --- a/SQF/dayz_code/compile/fn_selfActions.sqf +++ b/SQF/dayz_code/compile/fn_selfActions.sqf @@ -190,14 +190,11 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu _player_lockUnlock_crtl = false; if (_canDo && (speed player <= 1) && (_cursorTarget isKindOf "Plastic_Pole_EP1_DZ")) then { - s_player_plotpole_preview = player addAction ["Preview Plot Radius", "\z\addons\dayz_code\compile\object_showPlotRadius.sqf",[], 0, false, true, "", ""]; if (s_player_maintain_area < 0) then { s_player_maintain_area = player addAction ["Maintain Area", "\z\addons\dayz_code\actions\maintain_area.sqf", "maintain", 5, false]; s_player_maintain_area_preview = player addAction ["Maintain Area Preview", "\z\addons\dayz_code\actions\maintain_area.sqf", "preview", 5, false]; }; } else { - player removeAction s_player_plotpole_preview; - s_player_plotpole_preview = -1; player removeAction s_player_maintain_area; s_player_maintain_area = -1; player removeAction s_player_maintain_area_preview; From 93568034ac9ffe6a8330a7d54a1f8281d46d63c3 Mon Sep 17 00:00:00 2001 From: HARLAN Date: Wed, 11 Dec 2013 13:36:05 -0500 Subject: [PATCH 6/8] changed plot preview to Plastic_Pole_EP1, removed it as an addaction #846 --- SQF/dayz_code/init/variables.sqf | 1 - 1 file changed, 1 deletion(-) diff --git a/SQF/dayz_code/init/variables.sqf b/SQF/dayz_code/init/variables.sqf index 483ec14b5..45638ea5a 100644 --- a/SQF/dayz_code/init/variables.sqf +++ b/SQF/dayz_code/init/variables.sqf @@ -247,7 +247,6 @@ dayz_resetSelfActions = { s_player_SurrenderedGear = -1; s_player_maintain_area = -1; s_player_maintain_area_preview = -1; - s_player_plotpole_preview = -1; }; call dayz_resetSelfActions; From b27836d2ee04885bdf737e84553745cbc44506c9 Mon Sep 17 00:00:00 2001 From: HARLAN Date: Fri, 13 Dec 2013 13:44:17 -0500 Subject: [PATCH 7/8] plot preview #846 --- SQF/dayz_code/init/compiles.sqf | 1 + 1 file changed, 1 insertion(+) diff --git a/SQF/dayz_code/init/compiles.sqf b/SQF/dayz_code/init/compiles.sqf index 7814123cc..ee9c3b66a 100644 --- a/SQF/dayz_code/init/compiles.sqf +++ b/SQF/dayz_code/init/compiles.sqf @@ -110,6 +110,7 @@ if (!isDedicated) then { player_antiWall = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_antiWall.sqf"; player_deathBoard = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\list_playerDeathsAlt.sqf"; + player_plotPreview = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_showPlotRadius.sqf"; player_upgradeVehicle = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_upgradeVehicle.sqf"; //ui From 920cdfba788c5d0ee00379ecfe2e8af17f0ae723 Mon Sep 17 00:00:00 2001 From: HARLAN Date: Fri, 13 Dec 2013 13:58:07 -0500 Subject: [PATCH 8/8] plot preview #846 only after plot placed --- SQF/dayz_code/actions/player_build.sqf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SQF/dayz_code/actions/player_build.sqf b/SQF/dayz_code/actions/player_build.sqf index 8118ea940..3014a3df6 100644 --- a/SQF/dayz_code/actions/player_build.sqf +++ b/SQF/dayz_code/actions/player_build.sqf @@ -471,6 +471,8 @@ if (_hasrequireditem) then { if(_num_removed == 1) then { cutText [format[localize "str_build_01",_text], "PLAIN DOWN"]; + + if (_isPole) then {spawn player_plotPreview;}; _tmpbuilt setVariable ["OEMPos",_location,true];