Stuff and Junk
Well-Known Member
Well....I guess i should share my progress lol 
If you have DayZ Mod 1.8.1 you can use my method to make base building 1.3 work, mostly. This will diable the need for flags, glag checks and anything flag related. Personally idm because i dont like authorized building in an open world game but, meh. Ok so here goes:
Step 1
Follow the install guide for this addon. Easy enough
Step 2
In the server publish object server file you need to have this at the top:
Not sure if the invenotry - []; block in this position matters but it seems to matter since the whole select _this 1, 2, 3... should be in order right? Idk maybe i am just OCD rofl. The only thing different here is i placed this block last before the #include line. Anyways...
Step 2
Same file you should have this:
Instead of the one in the tutorial. The change here is we need to preprare the key to save a proper array and not a string which the tutorial creates. Keep in mind this is a new sql database style, different but new 
So the whole publish objects should look like this now:
Check? Check...
Step 3
Open your update object file in the server pbo and you should have this:
Now this may be the exact same but better safe than sorry right? Sweet 
Now you can build anything, even a flagpole if ya wanna lol. When you restart you will get 0 errors from the base building for loading objects right? Maybe not, if you have not already done so please paste this in your dayz_code variables:
This is slightly different in this update so we need to make it use the right variable 
Use this playerbuild2 and playerremove.sqf file instead of the ones from the tutorial
https://www.dropbox.com/sh/hgell0cdspx88zs/AADmOrW7H_XruYTiGvMRznPza
If you have DayZ Mod 1.8.1 you can use my method to make base building 1.3 work, mostly. This will diable the need for flags, glag checks and anything flag related. Personally idm because i dont like authorized building in an open world game but, meh. Ok so here goes:
Step 1
Follow the install guide for this addon. Easy enough
Step 2
In the server publish object server file you need to have this at the top:
Code:
private ["_class","_uid","_charID","_object","_worldspace","_key"];
//[dayz_characterID,_tent,[_dir,_location],"TentStorage"]
_charID = _this select 0;
_object = _this select 1;
_worldspace = _this select 2;
_class = _this select 3;
_failed = false;
if (count _this > 3) then {
_player = _this select 4;
if (_player distance _object > 10) then {
_failed = true;
diag_log format["Player: %1 is too far from object: %2, Distance: %3",_player,_object,(_player distance _object)];
};
};
_inventory = [];
_fuel = [];
if (count _this > 4) then {
_fuel = _this select 4;
if (count _fuel > 0) then {
_inventory = _fuel;
} else {
_inventory = [];
};
};
Step 2
Same file you should have this:
Code:
//Send request
if (_object isKindOf "TrapItems") then {
_key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, 0 , _charID, _worldspace, [_object getVariable ["armed", false]], [], 0,_uid];
} else {
if (typeOf(_object) in allbuildables_class) then {
_key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, 0 , _charID, _worldspace, [[[_uid]],[_inventory]], [], 0,_uid];
} else {
_key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, 0 , _charID, _worldspace, [], [], 0,_uid];
};
};
//diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;
if (typeOf(_object) in allbuildables_class) then { //Forces the variable to be updated so server doesn't need to be restarted to allow interaction
_updatedAuthorizedUID = [[[_uid]],[_inventory]];
_object setVariable ["AuthorizedUID", _updatedAuthorizedUID, true]; //sets variable with full useable array
};
So the whole publish objects should look like this now:
Code:
private ["_class","_uid","_charID","_object","_worldspace","_key"];
//[dayz_characterID,_tent,[_dir,_location],"TentStorage"]
_charID = _this select 0;
_object = _this select 1;
_worldspace = _this select 2;
_class = _this select 3;
_failed = false;
if (count _this > 3) then {
_player = _this select 4;
if (_player distance _object > 10) then {
_failed = true;
diag_log format["Player: %1 is too far from object: %2, Distance: %3",_player,_object,(_player distance _object)];
};
};
_inventory = [];
_fuel = [];
if (count _this > 4) then {
_fuel = _this select 4;
if (count _fuel > 0) then {
_inventory = _fuel;
} else {
_inventory = [];
};
};
#include "\z\addons\dayz_server\compile\server_toggle_debug.hpp"
//if (!(_object isKindOf "Building")) exitWith {
// deleteVehicle _object;
//};
_allowed = [_object, "Server"] call check_publishobject;
if (_allowed) then {
//diag_log ("PUBLISH: Attempt " + str(_object));
//get UID
_uid = _worldspace call dayz_objectUID2;
//Send request
if (_object isKindOf "TrapItems") then {
_key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, 0 , _charID, _worldspace, [_object getVariable ["armed", false]], [], 0,_uid];
} else {
if (typeOf(_object) in allbuildables_class) then {
_key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, 0 , _charID, _worldspace, [[[_uid]],[_inventory]], [], 0,_uid];
} else {
_key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, 0 , _charID, _worldspace, [], [], 0,_uid];
};
};
//diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;
if (typeOf(_object) in allbuildables_class) then { //Forces the variable to be updated so server doesn't need to be restarted to allow interaction
_updatedAuthorizedUID = [[[_uid]],[_inventory]];
_object setVariable ["AuthorizedUID", _updatedAuthorizedUID, true]; //sets variable with full useable array
};
_object setVariable ["ObjectUID", _uid,true];
if (_object isKindOf "TentStorage" || _object isKindOf "CamoNet_DZ" || _object isKindOf "Land_A_tent") then {
_object addMPEventHandler ["MPKilled",{_this call vehicle_handleServerKilled;}];
};
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];
#ifdef OBJECT_DEBUG
diag_log ("PUBLISH: Created " + (_class) + " with ID " + _uid);
#endif
};
Step 3
Open your update object file in the server pbo and you should have this:
Code:
//####----####----####---- Base Building 1.3 Start ----####----####----####
_object_inventory = {
private["_inventory","_previous","_key"];
if (_object isKindOf "TrapItems") then {
_inventory = [_object getVariable ["armed", false]];
} else {
if (typeOf(_object) in allbuildables_class) then {
_inventory = _object getVariable ["AuthorizedUID", []]; //Shouldn't need to specify which array since it's all being updated here
_authorizedOUID = (_inventory select 0) select 0;
_key = format["CHILD:309:%1:%2:",_authorizedOUID,_inventory]; //was _uid,_inventory
diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;
} else {
_inventory = [
getWeaponCargo _object,
getMagazineCargo _object,
getBackpackCargo _object
];
_previous = str(_object getVariable["lastInventory",[]]);
if (str(_inventory) != _previous) then {
_object setVariable["lastInventory",_inventory];
if (_objectID == "0") then {
_key = format["CHILD:309:%1:%2:",_uid,_inventory];
} else {
_key = format["CHILD:303:%1:%2:",_objectID,_inventory];
};
diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;
};
};
};
};
//####----####----####---- Base Building 1.3 End ----####----####----####
Now you can build anything, even a flagpole if ya wanna lol. When you restart you will get 0 errors from the base building for loading objects right? Maybe not, if you have not already done so please paste this in your dayz_code variables:
Code:
DayZ_SafeObjects = ["Land_Fire_DZ", "TentStorage","TentStorage0","TentStorage1","TentStorage2","TentStorage3","TentStorage4","StashSmall","StashSmall1","StashSmall2","StashSmall3","StashSmall4","StashMedium","StashMedium1","StashMedium2","StashMedium3", "StashMedium4", "Wire_cat1", "Sandbag1_DZ", "Fence_DZ", "Generator_DZ", "Hedgehog_DZ", "BearTrap_DZ", "DomeTentStorage", "DomeTentStorage0", "DomeTentStorage1", "DomeTentStorage2", "DomeTentStorag3", "DomeTentStorage4", "CamoNet_DZ", "Trap_Cans", "TrapTripwireFlare", "TrapBearTrapSmoke", "TrapTripwireGrenade", "TrapTripwireSmoke", "TrapBearTrapFlare", "Grave", "Concrete_Wall_EP1", "Infostand_2_EP1", "WarfareBDepot", "Base_WarfareBBarrier10xTall", "WarfareBCamp", "Base_WarfareBBarrier10x", "Land_fortified_nest_big", "Land_Fort_Watchtower", "Land_fort_rampart_EP1", "Land_HBarrier_large", "Land_fortified_nest_small", "Land_BagFenceRound", "Land_fort_bagfence_long", "Land_Misc_Cargo2E", "Misc_Cargo1Bo_military", "Ins_WarfareBContructionSite", "Land_pumpa", "Land_CncBlock", "Hhedgehog_concrete", "Misc_cargo_cont_small_EP1", "Land_prebehlavka", "Fence_corrugated_plate", "ZavoraAnim", "Land_tent_east", "Land_CamoNetB_EAST", "Land_CamoNetB_NATO", "Land_CamoNetVar_EAST", "Land_CamoNetVar_NATO", "Land_CamoNet_EAST", "Land_CamoNet_NATO", "Fence_Ind_long", "Fort_RazorWire", "Fence_Ind","Land_sara_hasic_zbroj","Land_Shed_wooden","Land_Barrack2","Land_vez","FlagCarrierBAF","FlagCarrierBIS_EP1","FlagCarrierBLUFOR_EP1","FlagCarrierCDF_EP1","FlagCarrierCDFEnsign_EP1","FlagCarrierCzechRepublic_EP1","FlagCarrierGermany_EP1","FlagCarrierINDFOR_EP1","FlagCarrierUSA_EP1","Land_Ind_Shed_01_main","Land_Fire_barrel","Land_WoodenRamp","Land_Ind_TankSmall2_EP1","PowerGenerator_EP1","Land_Ind_IlluminantTower","Land_A_Castle_Stairs_A","Land_A_Castle_Bergfrit","Land_A_Castle_Bastion","Land_A_Castle_Wall1_20","Land_A_Castle_Wall1_20_Turn","Land_A_Castle_Wall2_30","Land_A_Castle_Gate","Land_House_L_1_EP1","Land_ConcreteRamp","RampConcrete","HeliH","HeliHCivil","Land_ladder","Land_ladder_half","Land_Misc_Scaffolding","CDF_WarfareBUAVterminal","Land_Ind_Shed_01_end","Land_Ind_SawMillPen"];
Use this playerbuild2 and playerremove.sqf file instead of the ones from the tutorial
https://www.dropbox.com/sh/hgell0cdspx88zs/AADmOrW7H_XruYTiGvMRznPza
Last edited: