1.0.0.7 Developer Build

+ [CHANGED] Build-ables now get deleted from database when killed.
+ [ADDED] Basic fishing on ocean using toolbelt item: ItemFishingPole.
TODO: add model
+ [ADDED] New way of chopping down trees that actually takes into
account the size of the tree for number of chops/output. For example
medium sized tree will typically require 3 animations and will yield 3
wood piles.
+ [ADDED] Airplane dealer to Namalsk and updated trader config.
+ [CHANGED] Can now remove park bench with refund.
+ [FIXED] dayz_maxGlobalZombies was not incrementing when other players
are within 400m. Also, variable was overwritten in player_spawncheck
code so a init variable was added dayz_maxGlobalZombiesInit (default=40)
as well as dayz_maxGlobalZombiesIncrease (default=10) to control the
amount of increase for each additional player within range.
+ [CHANGED] Any backpack placed on the ground will with gear will now
disappear to all other players.
+ [FIXED] Added 5 second sleep to swimming in ground fix, now it should
actually work without glitching. fixes #326
+ [CHANGED] To prevent lost primary weapons in backpacks, all backpacks
have been Upgraded. This requires that backpacks the weapon to magazines
ratio be within 1:10. http://dayzepoch.com/wiki/index.php/Backpacks
+ [CLEANUP] disable debug of player zombie vision.
+ [ADDED] ASC EU Lights Mod FROM
http://www.armaholic.com/page.php?id=12076
+ [ADDED] New Craft-able light_pole_kit and Build-able LightPole_DZ for
night lighting. RECIPE 4 lumber + 1 scrap + 1 Light Bulb
+ [ADDED] MAP Editorupgrade (EU) @MAP Mod FROM
http://www.armaholic.com/page.php?id=6194
+ [CHANGED] Picking up crowbar now gives toolbelt item instead of melee
weapon.
This commit is contained in:
vbawol
2013-05-04 15:21:57 -05:00
parent eeb6c3cddb
commit 3cbb79051e
32 changed files with 515 additions and 170 deletions

View File

@@ -0,0 +1,104 @@
private ["_vehicle","_curFuel","_newFuel","_started","_finished","_animState","_isMedic","_location1","_location2","_abort","_canName","_canSizeEmpty","_canTypeEmpty","_canName","_canSize","_configCan","_configVeh","_capacity","_nameText","_availableCansEmpty","_availableCans"];
if(TradeInprogress) exitWith { cutText ["Refuel already in progress." , "PLAIN DOWN"] };
TradeInprogress = true;
// Get all nearby vehicles within 10m
_findNearestVehicles = nearestObjects [player, ["AllVehicles"], 10];
_findNearestVehicle = [];
{
if (alive _x and !(_x isKindOf "Man")) then {
_findNearestVehicle set [(count _findNearestVehicle),_x];
};
} foreach _findNearestVehicles;
_IsNearVehicle = count (_findNearestVehicle);
if(_IsNearVehicle >= 1) then {
// select the nearest one
_vehicle = _findNearestVehicle select 0;
// Static vehicle fuel information
_configVeh = configFile >> "cfgVehicles" >> TypeOf(_vehicle);
_capacity = getNumber(_configVeh >> "fuelCapacity");
_nameText = getText(_configVeh >> "displayName");
_isOk = true;
// perform fuel up
while {_isOk} do {
// qty to add per loop
_canSize = 20;
cutText [format["Filling up %1, move to cancel.",_nameText], "PLAIN DOWN"];
// alert zombies
[player,20,true,(getPosATL player)] spawn player_alertZombies;
_finished = false;
// force animation
player playActionNow "Medic";
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt) then {
r_doLoop = false;
};
sleep 0.1;
};
r_doLoop = false;
if(!_finished) then {
r_interrupt = false;
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
_abort = true;
};
if (_finished) then {
// Get vehicle fuel levels again
_curFuel = ((fuel _vehicle) * _capacity);
_newFuel = (_curFuel + 20);
if (_newFuel > _capacity) then {_newFuel = _capacity; _abort = true; };
// calculate minimum needed fuel
_newFuel = (_newFuel / _capacity);
dayzSetFuel = [_vehicle,_newFuel];
if (local _vehicle) then {
dayzSetFuel spawn local_setFuel;
};
publicVariable "dayzSetFuel";
// Play sound
[player,"refuel",0,false] call dayz_zombieSpeak;
cutText [format["%1 filled to %2 percent capacity.",_nameText,round(_newFuel*100)], "PLAIN DOWN"];
};
if(_abort) exitWith {};
sleep 1;
};
} else {
cutText ["No Vehicles Nearby.", "PLAIN DOWN"];
};
TradeInprogress = false;

View File

@@ -4,7 +4,7 @@ if(TradeInprogress) exitWith { cutText ["Refuel already in progress." , "PLAIN D
TradeInprogress = true;
player removeAction s_player_fillgen;
s_player_fillgen = 1;
// Use target from addaction
_vehicle = _this select 3;

View File

@@ -5,5 +5,8 @@ _vehicle = _this select 3;
s_player_lockUnlock_crtl = -1;
_vehicle setVehicleInit "this lock true; this lockCargo true;";
processInitCommands;
//_vehicle lock true;
//dayzLockVehicle = [_vehicle,true];
//publicVariable "dayzLockVehicle";

View File

@@ -17,7 +17,7 @@ _text = getText (configFile >> _type >> _classname >> "displayName");
_claimedBy = _holder getVariable["claimed","0"];
// Check if any players are nearby if not allow player to claim item.
_playerNear = {isPlayer _x} count (player nearEntities ["Man", 6]) > 1;
_playerNear = {isPlayer _x} count (player nearEntities ["CAManBase", 6]) > 1;
// Only allow if not already claimed.
if (_claimedBy == "0" or !_playerNear) then {
@@ -57,7 +57,7 @@ if(_classname isKindOf "Bag_Base_EP1") then {
};
// test to see if item still exists just before adding and removing
if(_holder == objNull) exitWith {};
if(_holder == objNull) exitWith { TradeInprogress = false; };
_obj = nearestObjects [(getPosATL player), [(typeOf _holder)], 5];
_qty = count _obj;

View File

@@ -252,7 +252,8 @@ if (_hasrequireditem) then {
//["dayzPublishObj",[dayz_characterID,_tmpbuilt,[_dir,_location],_classname]] call callRpcProcedure;
dayzPublishObj = [dayz_characterID,_tmpbuilt,[_dir,_location],_classname];
publicVariableServer "dayzPublishObj";
publicVariableServer "dayzPublishObj";
} else {
deleteVehicle _tmpbuilt;
cutText ["Canceled building." , "PLAIN DOWN"];

View File

@@ -1,4 +1,4 @@
private["_item","_location","_isOk","_dir","_classname"];
private ["_item","_isOk","_i","_objName","_objInfo","_lenInfo","_started","_finished","_sfx","_dis","_animState","_isMedic","_proceed","_counter","_objType","_limit","_itemOut","_countOut","_tree","_distance2d","_distance3d","_trees","_findNearestTree"];
if(TradeInprogress) exitWith { cutText ["Harvest wood already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
@@ -9,95 +9,131 @@ _trees = ["t_picea3f.p3d","t_picea2s.p3d","t_picea1s.p3d","t_fagus2w.p3d","t_fag
_item = _this;
call gear_ui_init;
player playActionNow "Medic";
[player,20,false,(getPosATL player)] spawn player_alertZombies;
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt) then {
r_doLoop = false;
};
sleep 0.1;
};
r_doLoop = false;
if (_finished) then {
_nearByTrees = 0;
_findNearestTree = [];
{
if("" == typeOf _x) then {
_findNearestTree = [];
{
if("" == typeOf _x) then {
if (alive _x) then {
if (alive _x) then {
_objInfo = toArray(str(_x));
_lenInfo = count _objInfo - 1;
_objName = [];
_i = 0;
// determine where the object name starts
{
if (58 == _objInfo select _i) exitWith {};
_i = _i + 1;
} forEach _objInfo;
_i = _i + 2; // skip the ": " part
for "_k" from _i to _lenInfo do {
_objName = _objName + [_objInfo select _k];
};
_objName = toLower(toString(_objName));
_objInfo = toArray(str(_x));
_lenInfo = count _objInfo - 1;
_objName = [];
_i = 0;
// determine where the object name starts
{
if (58 == _objInfo select _i) exitWith {};
_i = _i + 1;
} forEach _objInfo;
_i = _i + 2; // skip the ": " part
for "_k" from _i to _lenInfo do {
_objName = _objName + [_objInfo select _k];
};
_objName = toLower(toString(_objName));
// Exit since we found a tree
if (_objName in _trees) exitWith {
_findNearestTree set [(count _findNearestTree),_x];
// Exit since we found a tree
if (_objName in _trees) exitWith {
_findNearestTree set [(count _findNearestTree),_x];
};
};
};
} foreach nearestObjects [getPos player, [], 20];
diag_log format["DEBUG TREES: %1", _findNearestTree];
if (count(_findNearestTree) >= 1) then {
_tree = _findNearestTree select 0;
// get 2d distance
_distance2d = [player, _tree] call BIS_fnc_distance2D;
_distance3d = player distance _tree;
if(_distance2d <= 5) then {
_countOut = ceil(_distance3d-_distance2d);
diag_log format["DEBUG TREE DISTANCE: %1 - %2 = %3", _distance3d,_distance2d,(_distance3d-_distance2d)];
// Start chop tree loop
_counter = 0;
_isOk = true;
_proceed = false;
while {_isOk} do {
player playActionNow "Medic";
[player,20,true,(getPosATL player)] spawn player_alertZombies;
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
r_doLoop = false;
_finished = true;
[player,"chopwood",0,false] call dayz_zombieSpeak;
};
if (r_interrupt) then {
r_doLoop = false;
};
sleep 0.1;
};
if(!_finished) exitWith {
_isOk = false;
_proceed = false;
};
if(_finished) then {
_counter = _counter + 1;
};
cutText ["Chopping down tree, walk away at anytime to cancel.", "PLAIN DOWN"];
if(_counter == _countOut) exitWith {
_isOk = false;
_proceed = true;
};
};
} foreach nearestObjects [getPos player, [], 5];
if (_proceed) then {
diag_log format["DEBUG TREES: %1", _findNearestTree];
if (count(_findNearestTree) >= 1) then {
_result = [player,"PartWoodPile"] call BIS_fnc_invAdd;
[player,"chopwood",0,false] call dayz_zombieSpeak;
if (_result) then {
cutText [localize "str_player_25", "PLAIN DOWN"];
_tree = _findNearestTree select 0;
_itemOut = "PartWoodPile";
for "_x" from 1 to _countOut do {
player addMagazine _itemOut;
};
// chop down tree
if("" == typeOf _tree) then {
_tree setDamage 1;
};
diag_log format["DEBUG TREE DAMAGE: %1", _tree];
cutText [format["%1 piles of wood has been successfully added to your inventory.", _countOut], "PLAIN DOWN"];
} else {
cutText [localize "str_player_24", "PLAIN DOWN"];
r_interrupt = false;
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
cutText ["Canceled Harvesting Wood.", "PLAIN DOWN"];
};
} else {
cutText [localize "str_player_23", "PLAIN DOWN"];
};
} else {
r_interrupt = false;
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
cutText ["Canceled Harvest Wood.", "PLAIN DOWN"];
cutText [localize "str_player_23", "PLAIN DOWN"];
};
TradeInprogress = false;

View File

@@ -0,0 +1,56 @@
private ["_item","_isOk","_i","_objName","_objInfo","_lenInfo","_started","_finished","_sfx","_dis","_animState","_isMedic","_proceed","_counter","_objType","_limit","_itemOut","_countOut","_tree","_distance2d","_distance3d","_trees","_findNearestTree"];
if(TradeInprogress) exitWith { cutText ["Fishing already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
_item = _this;
call gear_ui_init;
// find position in front of player
_position = player modeltoworld [0,5,0];
if(!(surfaceIsWater _position)) exitWith { TradeInprogress = false; cutText ["Must be near a shore or on a boat to fish." , "PLAIN DOWN"]; };
player playActionNow "Medic";
[player,20,true,(getPosATL player)] spawn player_alertZombies;
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
r_doLoop = false;
_finished = true;
[player,"fillwater",0,false] call dayz_zombieSpeak;
};
if (r_interrupt) then {
r_doLoop = false;
};
sleep 0.1;
};
if (_finished) then {
_itemOut = "FoodCanSardines"; // TODO replace with random raw fishes
_countOut = round(random 4);
for "_x" from 1 to _countOut do {
player addMagazine _itemOut;
};
cutText [format["You caught %1 fish.", _countOut], "PLAIN DOWN"];
} else {
r_interrupt = false;
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
cutText ["Canceled Fishing.", "PLAIN DOWN"];
};
TradeInprogress = false;

View File

@@ -117,13 +117,21 @@ if (_proceed) then {
if(!isNull(_obj)) then {
cutText [format["De-constructing %1.",_objType], "PLAIN DOWN"];
// TODO add hideobject to have it sink into ground then delete
dayzHideObject = _obj;
hideObject _obj; // local player
publicVariable "dayzHideObject"; // remote player
sleep 5;
//["dayzDeleteObj",[_objectID,_objectUID]] call callRpcProcedure;
dayzDeleteObj = [_objectID,_objectUID];
publicVariableServer "dayzDeleteObj";
_isWreck = (typeOf _obj) in ["SKODAWreck","HMMWVWreck","UralWreck","datsun01Wreck","hiluxWreck","datsun02Wreck","UAZWreck","Land_Misc_Garb_Heap_EP1","Fort_Barricade_EP1","Rubbish2"];
deleteVehicle _obj;
_selectedRemoveOutput = [];
if(_isWreck) then {
// Find one random part to give back

View File

@@ -4,7 +4,7 @@ if(TradeInprogress) exitWith { cutText ["Stop already in progress." , "PLAIN DOW
TradeInprogress = true;
player removeAction s_player_fillgen;
s_player_fillgen = 1;
// Use target from addaction
_vehicle = _this select 3;

View File

@@ -5,7 +5,9 @@ _vehicle = _this select 3;
s_player_lockUnlock_crtl = -1;
_vehicle setVehicleInit "this lock false; this lockCargo false;";
processInitCommands;
// Wiki states that lock is globally brodcast but the variable has to be local
//_vehicle lock false;
//dayzLockVehicle = [_vehicle,false];
//publicVariable "dayzLockVehicle";

View File

@@ -1,4 +0,0 @@
private["_hasKnife","_qty","_item","_text","_string","_type","_loop","_meat","_timer"];
_item = _this select 3;
player playMove "GestureSwing"