switchModel, jerry_fill, packTent changes/fixes (#1836)

* switchModel, jerry_fill, water_fill, drinkWater, packTent changes/fixes

player_packTent: Add private array since there was none. Make it match
player_packVault so a player can't pack the tent with others near (to
stop duping)

water_fill:
Fixed the massive lag issue with the check for ponds etc, Originally was
being done searching for all which is quite intensive, now only
searching for waterholeproxy which matches all the water holes on
chernarus I could try.
Fixed a few localizations. Thanks @schwanzkopfhegel

player_drinkWater: Same as above. Also removed a lot of unused private
variables.

jerry_fill:
Made the minimum fill level of fuel tanks 10% of
dayz_randomMaxFuelAmount so the tank will always have fuel
Fixed issue with ItemFuelBarrel only using 40 litres from a tank.
Thanks @schwanzkopfhegel
Display how much fuel was needed if the tank is empty
Fix issue if the tank was empty that dayz_actionInProgress was not reset

player_switchModel:
Fixed issue of coins dissapearing on gear change
Fixed old commented out code that was broken so now you will go back
into the camera view you were in before you changed clothes

* Revert drinkWater/water_fill changes

My previous commit can only be used on chernarus since it's the only map
that has the waterholeproxy we rely on.

* crafting localization fix

* Update german translations

* Rework

* Missed private variable

* Rework again

* Update german string
This commit is contained in:
oiad
2016-12-30 13:47:04 +13:00
committed by ebayShopper
parent b355ae6a61
commit 854c41cf8c
7 changed files with 53 additions and 45 deletions

View File

@@ -31,6 +31,7 @@
[FIXED] Hive connection error after the first and only online player disconnects during the object stream at server start up. #1822 @AirwavesMan @ebayShopper
[FIXED] Vanilla player_craftItem not exiting when action is already in progress. #1826 @schwanzkopfhegel
[FIXED] Fire barrel kit can be crafted with partially full matchboxes now. #1830 @AirwavesMan
[FIXED] Fuel barrels no longer use 40 litres of fuel from a tank. #1834 @schwanzkopfhegel @oiad
[NOTE] Updated server files were released with the four hotfixes below on December 11th, 2016 (http://dayzepoch.com/a2dayzepoch.php)
[FIXED] Hive child 309 errors that resulted in broken saving of newly built storage object inventory. @icomrade

View File

@@ -1,6 +1,6 @@
if (dayz_actionInProgress) exitWith {localize "str_epoch_player_34" call dayz_rollingMessages;};
dayz_actionInProgress = true;
private ["_qty","_dis","_sfx","_started","_finished","_animState","_isRefuel","_fuelcans","_qty20","_qty5","_qty40","_magazines","_cursorTarget","_fuelAmount"];
private ["_qty","_dis","_sfx","_started","_finished","_animState","_isRefuel","_fuelCans","_qty20","_qty5","_qty210","_magazines","_cursorTarget","_fuelAmount","_fuelNeeded"];
player removeAction s_player_fillfuel;
//s_player_fillfuel = -1;
@@ -11,22 +11,22 @@ _magazines = magazines player;
_fuelAmount = _cursorTarget getVariable "FuelAmount";
if (isNil "_fuelAmount") then {
_fuelAmount = floor(Random dayz_randomMaxFuelAmount);
_fuelAmount = floor(Random dayz_randomMaxFuelAmount) max (dayz_randomMaxFuelAmount * 0.10);
_cursorTarget setVariable ["FuelAmount",_fuelAmount,true];
};
if (_fuelAmount < 5) exitWith { format[localize "str_fill_notenough",typeOf _cursorTarget,_fuelAmount] call dayz_rollingMessages; };
_qty5 = {_x == "ItemFuelcanEmpty"} count _magazines;
_qty20 = {_x == "ItemJerrycanEmpty"} count _magazines;
_qty210 = {_x == "ItemFuelBarrelEmpty"} count _magazines;
diag_log format["Fill Jerry, %1 - %2",_cursorTarget,_fuelAmount];
_fuelNeeded = (_qty5 * 5) + (_qty20 * 20) + (_qty210 * 210);
_fuelcans = ["ItemFuelcanEmpty","ItemJerrycanEmpty","ItemFuelBarrelEmpty"];
if (_fuelAmount < _fuelNeeded) then {format[localize "str_fill_notenough",typeOf _cursorTarget,_fuelAmount,_fuelNeeded] call dayz_rollingMessages;};
_fuelCans = ["ItemFuelcanEmpty","ItemJerrycanEmpty","ItemFuelBarrelEmpty"];
_qty = 0;
_qty = {_x in _fuelcans} count _magazines;
_qty20 = {_x == "ItemJerrycanEmpty"} count _magazines;
_qty5 = {_x == "ItemFuelcanEmpty"} count _magazines;
_qty40 = {_x == "ItemFuelBarrelEmpty"} count _magazines;
_qty = {_x in _fuelCans} count _magazines;
if (("ItemJerrycanEmpty" in _magazines) or ("ItemFuelcanEmpty" in _magazines) or ("ItemFuelBarrelEmpty" in _magazines)) then {
player playActionNow "Medic";
@@ -58,18 +58,6 @@ if (("ItemJerrycanEmpty" in _magazines) or ("ItemFuelcanEmpty" in _magazines) or
r_doLoop = false;
if (_finished) then {
for "_x" from 1 to _qty20 do {
_fuelAmount = _cursorTarget getVariable "FuelAmount";
if (_fuelAmount >= 20) then {
_fuelAmount = _fuelAmount - 20;
_cursorTarget setVariable ["FuelAmount",_fuelAmount,true];
player removeMagazine "ItemJerrycanEmpty";
player addMagazine "ItemJerrycan";
} else {
_qty = _qty - 1;
};
};
for "_x" from 1 to _qty5 do {
_fuelAmount = _cursorTarget getVariable "FuelAmount";
@@ -82,11 +70,23 @@ if (("ItemJerrycanEmpty" in _magazines) or ("ItemFuelcanEmpty" in _magazines) or
_qty = _qty - 1;
};
};
for "_x" from 1 to _qty40 do {
for "_x" from 1 to _qty20 do {
_fuelAmount = _cursorTarget getVariable "FuelAmount";
if (_fuelAmount >= 40) then {
_fuelAmount = _fuelAmount - 40;
if (_fuelAmount >= 20) then {
_fuelAmount = _fuelAmount - 20;
_cursorTarget setVariable ["FuelAmount",_fuelAmount,true];
player removeMagazine "ItemJerrycanEmpty";
player addMagazine "ItemJerrycan";
} else {
_qty = _qty - 1;
};
};
for "_x" from 1 to _qty210 do {
_fuelAmount = _cursorTarget getVariable "FuelAmount";
if (_fuelAmount >= 210) then {
_fuelAmount = _fuelAmount - 210;
_cursorTarget setVariable ["FuelAmount",_fuelAmount,true];
player removeMagazine "ItemFuelBarrelEmpty";
player addMagazine "ItemFuelBarrel";
@@ -102,4 +102,4 @@ if (("ItemJerrycanEmpty" in _magazines) or ("ItemFuelcanEmpty" in _magazines) or
} else {
localize "str_player_10" call dayz_rollingMessages;
};
dayz_actionInProgress = false;
dayz_actionInProgress = false;

View File

@@ -1,4 +1,4 @@
private ["_charID","_newmodel","_old","_updates","_humanity","_medical","_worldspace","_zombieKills","_headShots","_humanKills","_combattimeout","_inCombat","_banditKills","_fractures","_wpnType","_ismelee"];
private ["_charID","_newmodel","_old","_updates","_humanity","_medical","_worldspace","_zombieKills","_headShots","_humanKills","_combattimeout","_inCombat","_banditKills","_fractures","_wpnType","_ismelee","_coins"];
//_playerUID = _this select 0;
_charID = _this select 1;
_model = _this select 2;
@@ -29,6 +29,7 @@ _ConfirmedHumanKills = player getVariable ["ConfirmedHumanKills",0];
_ConfirmedBanditKills = player getVariable ["ConfirmedBanditKills",0];
_friendlies = player getVariable ["friendlies",[]];
_tagSetting = player getVariable ["DZE_display_name",false];
if (Z_SingleCurrency) then {_coins = player getVariable [Z_moneyVariable,0];};
//Switch
_model call player_switchModel; //Already spawned thread, no need to spawn and waitUntil script is done
@@ -89,6 +90,7 @@ player setVariable ["ConfirmedHumanKills",_ConfirmedHumanKills,true];
player setVariable ["ConfirmedBanditKills",_ConfirmedBanditKills,true];
player setVariable ["friendlies",_friendlies,true];
player setVariable ["DZE_display_name",_tagSetting,true];
if (Z_SingleCurrency) then {player setVariable [Z_moneyVariable,_coins,true];};
//PVDZ_serverStoreVar = [player,"Achievements",_achievements];
//publicVariableServer "PVDZ_serverStoreVar";

View File

@@ -3,6 +3,9 @@
*/
if (dayz_actionInProgress) exitWith {localize "str_player_beingpacked" call dayz_rollingMessages;};
dayz_actionInProgress = true;
private ["_activatingPlayer","_alreadyPacking","_backpacks","_bag","_campItems","_countr","_dir","_holder","_magazines","_obj","_objWpnQty","_objWpnTypes","_objectID","_objectUID","_ownerID","_packobj","_playerNear","_pos","_weapons"];
_obj = _this;
_ownerID = _obj getVariable["CharacterID","0"];
_objectID = _obj getVariable["ObjectID","0"];
@@ -11,6 +14,9 @@ if (DZE_permanentPlot) then {
_ownerID = _obj getVariable["ownerPUID","0"];
};
_playerNear = _obj call dze_isnearest_player;
if (_playerNear) exitWith {dayz_actionInProgress = false; localize "str_epoch_player_16" call dayz_rollingMessages;};
_packobj = getText (configFile >> "CfgVehicles" >> typeOf _obj >> "pack");
_activatingPlayer = player;

View File

@@ -1,5 +1,4 @@
//private ["_class","_position","_dir","_group","_oldUnit","_newUnit","_currentWpn","_muzzles","_currentAnim","_playerUID","_weapons","_magazines","_primweapon","_secweapon","_newBackpackType","_backpackWpn","_backpackMag","_backpackWpnTypes","_backpackWpnQtys","_countr","_backpackmagTypes","_backpackmagQtys","_display","_wpnType","_ismelee","_rndx","_rndy"];
private ["_weapons","_backpackWpn","_backpackMag","_currentWpn","_isWeapon","_backpackWpnTypes","_backpackWpnQtys","_countr","_class","_position","_dir","_currentAnim","_playerUID","_countMags","_magazines","_primweapon","_secweapon","_newBackpackType","_muzzles","_oldUnit","_group","_newUnit","_oldGroup","_idc","_display","_switchUnit","_leader"];
private ["_weapons","_backpackWpn","_backpackMag","_currentWpn","_isWeapon","_backpackWpnTypes","_backpackWpnQtys","_countr","_class","_position","_dir","_currentAnim","_playerUID","_countMags","_magazines","_primweapon","_secweapon","_newBackpackType","_muzzles","_oldUnit","_group","_newUnit","_oldGroup","_idc","_display","_switchUnit","_leader","_currentCamera"];
_class = _this;
if (gear_done) then {disableUserInput true;disableUserInput true;};
disableSerialization;
@@ -9,7 +8,7 @@ disableSerialization;
_position = player modeltoWorld [0,0,0];
_dir = getDir player;
_currentAnim = animationState player;
//_currentCamera = cameraView;
_currentCamera = cameraView;
_playerUID = getPlayerUID player;
//BackUp Weapons and Mags
@@ -183,7 +182,7 @@ if (gear_done) then {disableUserInput false;disableUserInput false;disableUserIn
//diag_log format["Backpack weapons: %1",getWeaponCargo unitBackpack _newUnit];
//diag_log format["Backpack magazines: %1",getMagazineCargo unitBackpack _newUnit];
// player switchCamera = _currentCamera;
player switchCamera _currentCamera;
if (_currentWpn != "") then {_newUnit selectWeapon _currentWpn;};
[objNull, player, rSwitchMove, _currentAnim] call RE;
//dayz_originalPlayer attachTo [_newUnit];

View File

@@ -184,8 +184,8 @@
<Czech>Zabalit stan</Czech>
</Key>
<Key ID="str_actions_self_10">
<English>Fill FuelCan</English>
<German>Kraftstoffkanister füllen</German>
<English>Fill all fuel containers</English>
<German>Alle Kraftstoffbehälter füllen</German>
<Russian>Наполнить канистры</Russian>
<Spanish>Rellene FuelCan</Spanish>
<French>remplissez FuelCan</French>
@@ -1310,12 +1310,12 @@
<Dutch>Deze %1 heeft niet voldoende brandstof.</Dutch>
</Key>
<Key ID="str_fill_notenough">
<English>%1 does not have enough fuel to fill jerry can(s). (Estimated %2 Liters left)</English>
<German>%1 hat nicht genug Treibstoff, um einen Benzinkanister komplett zu füllen.(Ungefähr %2 Liter übrig)</German>
<English>%1 does not have enough fuel to fill all containers. Estimated %2 litres left (You needed %3 litres)</English>
<German>%1 hat nicht genug Kraftstoff, um alle Kraftstoffbehälter zu füllen. Es sind noch ungefähr %2 Liter übrig. (Du brauchst %3 Liter)</German>
</Key>
<Key ID="str_fill_success">
<English>You have filled %1 jerry can(s) with fuel. %2 has an estimated %3 Liters of fuel left.</English>
<German>%1 Benzinkanister wurde(n) erfolgreich mit Treibstoff befüllt. %2 hat noch ungefähr %3 Liter Treibstoff übrig.</German>
<English>You have filled %1 fuel container(s) with fuel. %2 has an estimated %3 litres of fuel left.</English>
<German>%1 Kraftstoffbehälter wurde(n) erfolgreich mit Kraftstoff befüllt. %2 hat noch ungefähr %3 Liter Kraftstoff übrig.</German>
</Key>
<Key ID="str_siphon_canceled">
<English>Canceled siphon</English>
@@ -6759,7 +6759,7 @@
<Czech>Naplnili jste převařenou vodou %1 láhve.</Czech>
</Key>
<Key ID="str_player_02">
<English>You have no empty water bottles</English>
<English>You have no empty water bottles.</English>
<German>Du hast keine leeren Wasserflaschen.</German>
<Russian>У вас нет пустых бутылок.</Russian>
<Spanish>No tienes cantimploras vacías</Spanish>
@@ -6808,8 +6808,8 @@
<Czech>Naplnili jste palivem %1 kanystry.</Czech>
</Key>
<Key ID="str_player_10">
<English>You have no empty jerry cans</English>
<German>Du hast keine leeren Kanister.</German>
<English>You have no empty fuel containers.</English>
<German>Du hast keinen leeren Kraftstoffbehälter.</German>
<Russian>У вас нет пустых канистр.</Russian>
<Spanish>No tienes bidones vacíos</Spanish>
<French>Vous n&apos;avez pas de jerrican vide.</French>
@@ -6993,7 +6993,7 @@
<German>Lese die Missionsdatei...</German>
</Key>
<Key ID="str_player_20">
<English>You must be near a water-source such as a pond, or well, or watering hole, to refill your water bottles</English>
<English>You must be near a water source such as a pond, well or watering hole to refill your water bottles.</English>
<German>Du musst dich in der Nähe einer Wasserquelle befinden, um Wasserflaschen zu füllen. Halte Ausschau nach einem Teich oder Brunnen!</German>
<Russian>Вы должны находиться возле водоема или источника воды, чтобы наполнить свои фляги.</Russian>
<Spanish>Necesitas estar cerca de una fuente de agua como un pozo para rellenar tu cantimplora</Spanish>
@@ -11395,8 +11395,8 @@
<German>Du hast es geschafft %1 aufzubrechen.</German>
</Key>
<Key ID="STR_EPOCH_PLAYER_34">
<English>Fill Jerry can is already in progress.</English>
<German>Befüllen des Kanisters bereits im Gange.</German>
<English>You are already filling a fuel container.</English>
<German>Befüllen des Kraftstoffbehälters bereits im Gange.</German>
<Russian>Канистра уже наполняется.</Russian>
<Dutch>Je bent al een jerrycan aan het vullen.</Dutch>
<French>Le remplissage du jerrycan est déjà en cours.</French>
@@ -11999,7 +11999,7 @@
</Key>
<Key ID="STR_EPOCH_PLAYER_149">
<English>Crafting needs a %1 within %2 meters</English>
<German>Zur Herstellung wird ein(e) %1 innerhalb von %2 benötigt.</German>
<German>Zur Herstellung wird ein(e) %1 innerhalb von %2 Meter(n) benötigt.</German>
<Russian>Для создания требуется %1 вблизи %2 метров</Russian>
<Dutch>Hiervoor heb je een %1 nodig binnen %2 meter</Dutch>
<Czech>Výroba potřebuje %1 v rámci %2 metrů</Czech>

View File

@@ -49,6 +49,6 @@
5 setViewDistance
5 showCommandingMenu !"\"showCommandingMenu\", \n\"globalChat\", " !="rshowCommandingMenu = 'showCommandingMenu'" !"rshowCommandingMenucode" !"\"showCommandingMenu\", \"sideChat\","
5 sideLogic !"{ \nBIS_MPF_ServerInitDone = true;\ncreatecenter sidelogic;\nBIS_MPF_dummygroup = createGroup sideLogic;" !"{ \nBIS_MPF_ServerInitDone = true;\ncreatecenter sidelogic;\n\n\nBIS_MPF_dummygroup = createGroup sideLogic;"
5 switchCamera !"\"switchCamera\", \n\n\n\"fadeMusic\"," !="rswitchCamera = 'switchCamera'" !"rswitchCameracode" !"\"switchCamera\", \"taskHint\"," !="player switchCamera (Dayz_constructionContext select 2);"
5 switchCamera !"\"switchCamera\", \n\n\n\"fadeMusic\"," !="rswitchCamera = 'switchCamera'" !"rswitchCameracode" !"\"switchCamera\", \"taskHint\"," !="player switchCamera (Dayz_constructionContext select 2);" !="player switchCamera _currentCamera;"
5 toString !="_skinToModel = toString (_finalArray);" !="{_textArrayTemp = _textArrayTemp + [tostring [_x]]} foreach _line;" !="_cmpt = toString _cmpt;" !="_objName = toLower(toString(_objName));" !"if (toString _hayArr != _needle) then {" !="_type = toString _typeA;" !="_anim4 = toString _anim4;" !"{(count _stance>17)}) then {toString [_stance select 17]}" !="lbAdd [7102, if (typeName _name == \"ARRAY\") then {toString _name} else {_name}];" !="lbAdd [7002, if (typeName _name == \"ARRAY\") then {toString _name} else {_name}];" !"if (isnil 'BIS_fnc_timeToString' || false) then {"
5 worldTo !"ect 1;\n_inside = false;\n_offset = 1; \n\n_relPos = _building worldToModel _point;\n_boundingBox = boundingBox _building;\n\n_min = _" !"\n\n_new = getPosATL _obj;\n\nif (_isPlayer) then {\n_x = _pos worldToModel _new;\n_dir = _dir + (if ((_x select 1)==0) then { 0 } else" !"_pondPos = (_x worldToModel _playerPos) select 2;\n" !"ts [_new, [], 100];\n{\nif (((typeOf(_x) == \"\")\nAND {((((_x worldToModel _new) select 2) < 0))\nAND {([_x, _new] call _checkPerimete" !"t = _this select 1;\n_inside = false;\n\n_relPos = _building worldToModel _point;\n_boundingBox = boundingBox _building;\n\n_min = _bou" !"fascl,getDir _x,\"\",1];if(_fash==_forEachIndex)then{_fapos2D=worldtoscreen _fapos;if(count _fapos2D>=2)then{_fasp ctrlsetposition" !"_pondPos = (_x worldToModel _playerPos) select 2;\nif (_pondPos < 0) then {\n_canFill" !"_w2m = _x worldToModel (getPosATL player);\n_bb = (boundingbox _x) select 1;" !"_bn == 1) then { \n_bb = boundingBox _o;\n_h = _offset + ((_o worldToModel (getPosATL _o)) select 2);\n_p = [ (_bb select 0) select" !"if (_distance > 1 && _distance < 2500) then {\n_pos set [2,(_pos select 2) + 1.5];\n_screen = worldToScreen _pos;\n_text = composeText [image"