+ added 3d preview to placing vaults and well as a test to see if vaults
can be placed in buildings.
This commit is contained in:
vbawol
2013-02-12 06:36:26 -06:00
parent bf6d87514b
commit e0df9dca50
4 changed files with 93 additions and 37 deletions

View File

@@ -4,11 +4,16 @@ call gear_ui_init;
_playerPos = getPosATL player;
_item = _this;
_hastentitem = _this in magazines player;
_location = player modeltoworld [0,1,0];
_location set [2,0];
_building = nearestObject [(vehicle player), "HouseBase"];
_isOk = [(vehicle player),_building] call fnc_isInsideBuilding;
//_isOk = true;
_offset_x = 0;
_offset_y = 1.5;
_offset_z = 0;
_offset_z_attach = 0.5;
_location = player modeltoworld [_offset_x,_offset_y,_offset_z];
// Allow placement anywhere.
// _building = nearestObject [(vehicle player), "HouseBase"];
//_isOk = [(vehicle player),_building] call fnc_isInsideBuilding;
_isOk = true;
//diag_log ("Pitch Tent: " + str(_isok) );
@@ -17,8 +22,9 @@ _text = getText (_config >> "displayName");
if (!_hastentitem) exitWith {cutText [format[(localize "str_player_31"),_text,"pitch"] , "PLAIN DOWN"]};
//blocked
if (["concrete",dayz_surfaceType] call fnc_inString) then { _isOk = true; diag_log ("surface concrete"); };
// blocked
// Allow on concrete since we dont force to ground.
// if (["concrete",dayz_surfaceType] call fnc_inString) then { _isOk = true; diag_log ("surface concrete"); };
if (isOnRoad _playerPos) then { _isOk = true; diag_log ("surface is road"); };
if(!placevault) then { _isOk = true; diag_log ("is trader city"); };
@@ -36,34 +42,84 @@ _objectsPond = nearestObjects [_playerPos, [], 10];
//diag_log ("Pitch Tent: " + str(_isok) );
if (!_isOk) then {
//remove tentbag
player removeMagazine _item;
_dir = round(direction player);
//wait a bit
player playActionNow "Medic";
sleep 1;
[player,"tentunpack",0,false] call dayz_zombieSpeak;
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
sleep 5;
//place tent (local)
_tent = createVehicle ["VaultStorageLocked", _location, [], 0, "CAN_COLLIDE"];
_tent setdir _dir;
_location = getPosATL _tent;
_tent setpos _location;
player reveal _tent;
_tent setVariable ["characterID",dayz_playerUID,true];
_tent setVariable ["OEMPos",_location,true];
["dayzPublishObj",[dayz_playerUID,_tent,[_dir,_location],"VaultStorageLocked"]] call callRpcProcedure;
// Start Preview loop
_tmpvault = createVehicle ["VaultStorageLocked", _location, [], 0, "NONE"];
_tmpvault setdir _dir;
_tmpvault attachTo [player,[_offset_x,_offset_y,_offset_z_attach]];
_cancel = false;
_counter = 0;
while {_isOk} do {
cutText ["You have setup your vault", "PLAIN DOWN"];
} else {
cutText ["You cannot place a Vault here. The area must be flat, and free of other objects", "PLAIN DOWN"];
if(_counter == 0) then {
cutText ["Planning consruction stand still 5 seconds to build.", "PLAIN DOWN"];
sleep 5;
_location1 = player modeltoworld [_offset_x,_offset_y,_offset_z];
if(_location distance _location1 < 0.1) exitWith {
_isOk = false;
_location = _location1;
};
};
if(_counter == 1) then {
cutText ["Started consruction stand still 5 seconds to build.", "PLAIN DOWN"];
sleep 5;
_location2 = player modeltoworld [_offset_x,_offset_y,_offset_z];
if(_location1 distance _location2 < 0.1) exitWith {
_isOk = false;
_location = _location2;
};
};
if(_counter >= 2) exitWith {
_isOk = false;
_cancel = true;
};
_counter = _counter + 1;
};
detach _tmpvault;
deleteVehicle _tmpvault;
if(!_cancel) then {
if (!_isOk) then {
//remove tentbag
player removeMagazine _item;
_dir = round(direction player);
//wait a bit
player playActionNow "Medic";
sleep 1;
[player,"tentunpack",0,false] call dayz_zombieSpeak;
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
sleep 5;
//place tent (local)
_tent = createVehicle ["VaultStorageLocked", _location, [], 0, "CAN_COLLIDE"];
_tent setdir _dir;
_location = getPosATL _tent;
_tent setpos _location;
player reveal _tent;
_tent setVariable ["characterID",dayz_playerUID,true];
_tent setVariable ["OEMPos",_location,true];
["dayzPublishObj",[dayz_playerUID,_tent,[_dir,_location],"VaultStorageLocked"]] call callRpcProcedure;
cutText ["You have setup your vault", "PLAIN DOWN"];
} else {
cutText ["You cannot place a Vault here. The area must be flat, and free of other objects", "PLAIN DOWN"];
};
} else {
cutText ["Canceled construction of vault.", "PLAIN DOWN"];
};

View File

@@ -33,7 +33,7 @@ class CfgMods
hidePicture = 0;
hideName = 0;
action = "http://www.dayzepoch.com";
version = "0.94";
version = "0.941";
hiveVersion = 0.96; //0.93
};
};

View File

@@ -87,7 +87,7 @@ class RscDisplayMain : RscStandardDisplay
class DAYZ_Version : CA_Version
{
idc = -1;
text = "DayZ Epoch 0.94 (1.7.5.1)";
text = "DayZ Epoch 0.941 (1.7.5.1)";
y = "(SafeZoneH + SafeZoneY) - (1 - 0.95)";
};
class CA_TitleMainMenu;

View File

@@ -1393,7 +1393,7 @@ class CfgMagazines
scope = 2;
count = 1;
type = 256;
displayName = "Gold";
displayName = "10oz Gold";
model = "\dayz_equip\models\gold_bar_10oz.p3d";
picture = "\dayz_equip\textures\equip_bar_gold_CA.paa";
descriptionShort = "10oz Gold Bar";
@@ -1403,7 +1403,7 @@ class CfgMagazines
{
text = "Smelt 1oz bars";
script = "spawn player_craftItem;";
output[] = {"ItemGoldBar10oz"};
output[] = {"ItemGoldBar"};
};
};
};