hambeast
Well-Known Member
So there is no way to go off the 'instance' table in the database for the starting loadout?
Well I wouldn't say "no way" but not without doing a bit of work.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
So there is no way to go off the 'instance' table in the database for the starting loadout?
Have you changed the dayz code config of the starting gear and get it to work yet?Well I wouldn't say "no way" but not without doing a bit of work.
no still working on thatHave you changed the dayz code config of the starting gear and get it to work yet?
Could you tell me what you've tried so I can try different things instead of trying stuff that won't work?no still working on that
Could you tell me what you've tried so I can try different things instead of trying stuff that won't work?
OK, so I tried just a simple "remove the default spawn gear" test. I overrode the config.cpp (and associated files) by placing them into a folder named "fixes" in my mission file.
called the config.cpp through the init.sqf
And that was a no-go? That sounds like it should work..
Mine doesn't work. Care to share how you fixed it?Custom loadouts aren’t functioning for several reasons; current Overwatch server files don’t contain the required code in server_playerLogin.sqf, and a suitable HiveEXT.dll to accompany. All the required changes to get custom loadouts working are server side. Using the “instance†table to set starting gear, for everyone, is possible and working fine.
private["_botActive","_int","_newModel","_doLoop","_wait","_hiveVer","_isHiveOk","_playerID","_playerObj","_randomSpot","_publishTo","_primary","_secondary","_key","_result","_charID","_playerObj","_playerName","_finished","_spawnPos","_spawnDir","_items","_counter","_magazines","_weapons","_group","_backpack","_worldspace","_direction","_newUnit","_score","_position","_isNew","_inventory","_backpack","_medical","_survival","_stats","_state"];
//Set Variables
#include "\z\addons\dayz_server\compile\server_toggle_debug.hpp"
#ifdef LOGIN_DEBUG
diag_log ("STARTING LOGIN: " + str(_this));
#endif
_playerID = _this select 0;
_playerObj = _this select 1;
_playerName = name _playerObj;
_worldspace = [];
if (_playerName == '__SERVER__' || _playerID == '' || local player) exitWith {};
// Cancel any login until server_monitor terminates.
// This is mandatory since all vehicles must be spawned before the first players spawn on the map.
// Otherwise, all vehicle event handlers won't be created on players' client side.
if (isNil "sm_done") exitWith { diag_log ("Login cancelled, server is not ready. " + str(_playerObj)); };
if (count _this > 2) then {
dayz_players = dayz_players - [_this select 2];
};
//Variables
_inventory = [];
_backpack = [];
_items = [];
_magazines = [];
_weapons = [];
_medicalStats = [];
_survival = [0,0,0];
_tent = [];
_state = [];
_direction = 0;
_model = "";
_newUnit = objNull;
_botActive = false;
if (_playerID == "") then {
_playerID = getPlayerUID _playerObj;
};
if ((_playerID == "") or (isNil "_playerID")) exitWith {
diag_log ("LOGIN FAILED: Player [" + _playerName + "] has no login ID");
};
//??? endLoadingScreen;
#ifdef LOGIN_DEBUG
diag_log ("LOGIN ATTEMPT: " + str(_playerID) + " " + _playerName);
#endif
//Do Connection Attempt
_doLoop = 0;
while {_doLoop < 5} do {
_key = format["CHILD:101:%1:%2:%3:",_playerID,dayZ_instance,_playerName];
_primary = _key call server_hiveReadWrite;
if (count _primary > 0) then {
if ((_primary select 0) != "ERROR") then {
_doLoop = 9;
};
};
_doLoop = _doLoop + 1;
};
if (isNull _playerObj or !isPlayer _playerObj) exitWith {
diag_log ("LOGIN RESULT: Exiting, player object null: " + str(_playerObj));
};
if ((_primary select 0) == "ERROR") exitWith {
diag_log format ["LOGIN RESULT: Exiting, failed to load _primary: %1 for player: %2 ",_primary,_playerID];
};
//Process request
_newPlayer = _primary select 1;
_isNew = count _primary < 6; //_result select 1;
_charID = _primary select 2;
_randomSpot = false;
//diag_log ("LOGIN RESULT: " + str(_primary));
/* PROCESS */
_hiveVer = 0;
if (!_isNew) then {
//RETURNING CHARACTER
_inventory = _primary select 4;
_backpack = _primary select 5;
_survival = _primary select 6;
_model = _primary select 7;
_hiveVer = _primary select 8;
if (_model == "") then {
_key = format["CHILD:999:select replace(cl.`inventory`, '""', '""""') inventory, replace(cl.`backpack`, '""', '""""') backpack, replace(coalesce(cl.`model`, 'Survivor2_DZ'), '""', '""""') model from `cust_loadout` cl join `cust_loadout_profile` clp on clp.`cust_loadout_id` = cl.`id` where clp.`unique_id` = '?':[%1]:",str(_playerID)];
_data = "HiveEXT" callExtension _key;
//Process result
_result = call compile format ["%1", _data];
_status = _result select 0;
if (_status == "CustomStreamStart") then {
if ((_result select 1) > 0) then {
_data = "HiveEXT" callExtension _key;
_result = call compile format ["%1", _data];
_inventory = call compile (_result select 0);
_backpack = call compile (_result select 1);
_model = call compile (_result select 2);
};
};
};
if (!(_model in ["SurvivorW2_DZ","Survivor2_DZ","Sniper1_DZ","Soldier1_DZ","Camo1_DZ","BanditW1_DZ","Bandit1_DZ","Survivor3_DZ"])) then {
_model = "Survivor2_DZ";
};
} else {
_model = _primary select 3;
_hiveVer = _primary select 4;
if (isNil "_model") then {
_model = "Survivor2_DZ";
} else {
if (_model == "") then {
_model = "Survivor2_DZ";
};
};
//Record initial inventory
_config = (configFile >> "CfgSurvival" >> "Inventory" >> "Default");
_mags = getArray (_config >> "magazines");
_wpns = getArray (_config >> "weapons");
_bcpk = getText (_config >> "backpack");
_randomSpot = true;
//Wait for HIVE to be free
_key = format["CHILD:203:%1:%2:%3:",_charID,[_wpns,_mags],[_bcpk,[],[]]];
_key call server_hiveWrite;
};
#ifdef LOGIN_DEBUG
diag_log ("LOGIN LOADED: " + str(_playerObj) + " Type: " + (typeOf _playerObj));
#endif
_isHiveOk = false; //EDITED
if (_hiveVer >= dayz_hiveVersionNo) then {
_isHiveOk = true;
};
//diag_log ("SERVER RESULT: " + str("X") + " " + str(dayz_hiveVersionNo));
//Server publishes variable to clients and WAITS
//_playerObj setVariable ["publish",[_charID,_inventory,_backpack,_survival,_isNew,dayz_versionNo,_model,_isHiveOk,_newPlayer],true];
dayzPlayerLogin = [_charID,_inventory,_backpack,_survival,_isNew,dayz_versionNo,_model,_isHiveOk,_newPlayer];
(owner _playerObj) publicVariableClient "dayzPlayerLogin";
What all files did you fix robzervos? can you file share please?
FIXED IT!!!
Hambeast, I re-did your fix with the player_login snippets of code.. I'll copy my exact code and you can use it.
Code:private["_botActive","_int","_newModel","_doLoop","_wait","_hiveVer","_isHiveOk","_playerID","_playerObj","_randomSpot","_publishTo","_primary","_secondary","_key","_result","_charID","_playerObj","_playerName","_finished","_spawnPos","_spawnDir","_items","_counter","_magazines","_weapons","_group","_backpack","_worldspace","_direction","_newUnit","_score","_position","_isNew","_inventory","_backpack","_medical","_survival","_stats","_state"]; //Set Variables #include "\z\addons\dayz_server\compile\server_toggle_debug.hpp" #ifdef LOGIN_DEBUG diag_log ("STARTING LOGIN: " + str(_this)); #endif _playerID = _this select 0; _playerObj = _this select 1; _playerName = name _playerObj; _worldspace = []; if (_playerName == '__SERVER__' || _playerID == '' || local player) exitWith {}; // Cancel any login until server_monitor terminates. // This is mandatory since all vehicles must be spawned before the first players spawn on the map. // Otherwise, all vehicle event handlers won't be created on players' client side. if (isNil "sm_done") exitWith { diag_log ("Login cancelled, server is not ready. " + str(_playerObj)); }; if (count _this > 2) then { dayz_players = dayz_players - [_this select 2]; }; //Variables _inventory = []; _backpack = []; _items = []; _magazines = []; _weapons = []; _medicalStats = []; _survival = [0,0,0]; _tent = []; _state = []; _direction = 0; _model = ""; _newUnit = objNull; _botActive = false; if (_playerID == "") then { _playerID = getPlayerUID _playerObj; }; if ((_playerID == "") or (isNil "_playerID")) exitWith { diag_log ("LOGIN FAILED: Player [" + _playerName + "] has no login ID"); }; //??? endLoadingScreen; #ifdef LOGIN_DEBUG diag_log ("LOGIN ATTEMPT: " + str(_playerID) + " " + _playerName); #endif //Do Connection Attempt _doLoop = 0; while {_doLoop < 5} do { _key = format["CHILD:101:%1:%2:%3:",_playerID,dayZ_instance,_playerName]; _primary = _key call server_hiveReadWrite; if (count _primary > 0) then { if ((_primary select 0) != "ERROR") then { _doLoop = 9; }; }; _doLoop = _doLoop + 1; }; if (isNull _playerObj or !isPlayer _playerObj) exitWith { diag_log ("LOGIN RESULT: Exiting, player object null: " + str(_playerObj)); }; if ((_primary select 0) == "ERROR") exitWith { diag_log format ["LOGIN RESULT: Exiting, failed to load _primary: %1 for player: %2 ",_primary,_playerID]; }; //Process request _newPlayer = _primary select 1; _isNew = count _primary < 6; //_result select 1; _charID = _primary select 2; _randomSpot = false; //diag_log ("LOGIN RESULT: " + str(_primary)); /* PROCESS */ _hiveVer = 0; if (!_isNew) then { //RETURNING CHARACTER _inventory = _primary select 4; _backpack = _primary select 5; _survival = _primary select 6; _model = _primary select 7; _hiveVer = _primary select 8; if (_model == "") then { _key = format["CHILD:999:select replace(cl.`inventory`, '""', '""""') inventory, replace(cl.`backpack`, '""', '""""') backpack, replace(coalesce(cl.`model`, 'Survivor2_DZ'), '""', '""""') model from `cust_loadout` cl join `cust_loadout_profile` clp on clp.`cust_loadout_id` = cl.`id` where clp.`unique_id` = '?':[%1]:",str(_playerID)]; _data = "HiveEXT" callExtension _key; //Process result _result = call compile format ["%1", _data]; _status = _result select 0; if (_status == "CustomStreamStart") then { if ((_result select 1) > 0) then { _data = "HiveEXT" callExtension _key; _result = call compile format ["%1", _data]; _inventory = call compile (_result select 0); _backpack = call compile (_result select 1); _model = call compile (_result select 2); }; }; }; if (!(_model in ["SurvivorW2_DZ","Survivor2_DZ","Sniper1_DZ","Soldier1_DZ","Camo1_DZ","BanditW1_DZ","Bandit1_DZ","Survivor3_DZ"])) then { _model = "Survivor2_DZ"; }; } else { _model = _primary select 3; _hiveVer = _primary select 4; if (isNil "_model") then { _model = "Survivor2_DZ"; } else { if (_model == "") then { _model = "Survivor2_DZ"; }; }; //Record initial inventory _config = (configFile >> "CfgSurvival" >> "Inventory" >> "Default"); _mags = getArray (_config >> "magazines"); _wpns = getArray (_config >> "weapons"); _bcpk = getText (_config >> "backpack"); _randomSpot = true; //Wait for HIVE to be free _key = format["CHILD:203:%1:%2:%3:",_charID,[_wpns,_mags],[_bcpk,[],[]]]; _key call server_hiveWrite; }; #ifdef LOGIN_DEBUG diag_log ("LOGIN LOADED: " + str(_playerObj) + " Type: " + (typeOf _playerObj)); #endif _isHiveOk = false; //EDITED if (_hiveVer >= dayz_hiveVersionNo) then { _isHiveOk = true; }; //diag_log ("SERVER RESULT: " + str("X") + " " + str(dayz_hiveVersionNo)); //Server publishes variable to clients and WAITS //_playerObj setVariable ["publish",[_charID,_inventory,_backpack,_survival,_isNew,dayz_versionNo,_model,_isHiveOk,_newPlayer],true]; dayzPlayerLogin = [_charID,_inventory,_backpack,_survival,_isNew,dayz_versionNo,_model,_isHiveOk,_newPlayer]; (owner _playerObj) publicVariableClient "dayzPlayerLogin";
Also, the main fix, was I replaced the HiveExt.dll with a hiveext.dll from my previous reality private server for DayZ 1.7.7.1. It is 1,407kb instead of 1,409kb, and it works like a charm.
Custom loadouts work, and instance table loadout works for players without custom loadouts.
If you have questions, just ask.
if (!(_model in ["SurvivorW2_DZ","Survivor2_DZ","Sniper1_DZ","Soldier1_DZ","Camo1_DZ","BanditW1_DZ","Bandit1_DZ","Survivor3_DZ"])) then {
_model = "Survivor2_DZ";
};
if (!(_model in ["SurvivorW2_DZ","Survivor2_DZ","Sniper1_DZ","Sniper2_DZ","Sniper3_DZ","Sniper4_DZ","Sniper5_DZ","Sniper6_DZ","Soldier1_DZ","Camo1_DZ","Camo2_DZ","Camo3_DZ","Camo4_DZ","Camo5_DZ","Camo6_DZ","Camo7_DZ","Camo8_DZ","Camo9_DZ","Camo10_DZ","Camo11_DZ","Camo12_DZ","Camo13_DZ","Camo14_DZ","Camo15_DZ","Camo16_DZ","Camo17_DZ","Camo18_DZ","Camo19_DZ","Camo20_DZ","Camo21_DZ","Camo22_DZ","Camo23_DZ","Camo24_DZ","BanditW1_DZ","Bandit1_DZ","SurvivorW2_DZ"])) then {
_model = "Survivor2_DZ";
};
Anyone have the .dll that was used to fix this??
Good work Rob! Mind sharing the hiveext.dll?
edit: just noticed that the new models are being overridden
Code:if (!(_model in ["SurvivorW2_DZ","Survivor2_DZ","Sniper1_DZ","Soldier1_DZ","Camo1_DZ","BanditW1_DZ","Bandit1_DZ","Survivor3_DZ"])) then { _model = "Survivor2_DZ"; };
should be
Code:if (!(_model in ["SurvivorW2_DZ","Survivor2_DZ","Sniper1_DZ","Sniper2_DZ","Sniper3_DZ","Sniper4_DZ","Sniper5_DZ","Sniper6_DZ","Soldier1_DZ","Camo1_DZ","Camo2_DZ","Camo3_DZ","Camo4_DZ","Camo5_DZ","Camo6_DZ","Camo7_DZ","Camo8_DZ","Camo9_DZ","Camo10_DZ","Camo11_DZ","Camo12_DZ","Camo13_DZ","Camo14_DZ","Camo15_DZ","Camo16_DZ","Camo17_DZ","Camo18_DZ","Camo19_DZ","Camo20_DZ","Camo21_DZ","Camo22_DZ","Camo23_DZ","Camo24_DZ","BanditW1_DZ","Bandit1_DZ","SurvivorW2_DZ"])) then { _model = "Survivor2_DZ"; };
do we have to do anything with the config.cpp that has there hardcoded stuff in it or no?