Base Building DayZ 1.2 Released

Well i got some weird mofo shit , i deploy a watchtower it gets id-1 in instancedeployable , but if i remove it
after a restart also the id-1 of the instancevehicle gets removed ??? (notice only after a restart of the server)
At first i didnt noticed it , till i removed few building structures
Was funny coz also my old-bike (yesyes tour du jour - tour de dayz) was stolen by a bycicle freaking Z ( Dissapeard in thin air , was standing next to it)
Found out later more vehicles with same ID's were totaly removed from database

This on a 1771 dayz (selfbloodbag , SargeAI-152)

Any ideas whats the culprit
Tia
 
FYI people installing this on 1.7.7.1 your base built items built before the server has restarted will disappear if they take enough damage (hatchet for example will do the job, or satchel charges). I'm back on vanilla BB code without kikyou's improvements and I'm still seeing the exact same problems.
 
Code is the unique id for the object. Based on how bliss is written, I dont see away around this other than modifying the dayz_objectuid2 = { }; function in your server_functions.sqf

Then you must do the same algorithm in player_build.sqf where it factors the _uid.


I didnt thoroughly overlook 1.7.6.1 server side code.

EDIT FIX FOR NOT WRITING TO DB:

For those running Reality Build for 1.7.6.1

There is a function in "dayz_server\init\server_functions.sqf" called:

Code:
check_publishobject = {
private["_allowed","_allowedObjects","_object"];
 
_object = _this select 0;
_playername = _this select 1;
_allowedObjects = ["TentStorage", "Hedgehog_DZ", "Sandbag1_DZ","TrapBear","Wire_cat1"];
_allowed = false;
 
diag_log format ["DEBUG: Checking if Object: %1 is allowed published by %2", _object, _playername];
 
if ((typeOf _object) in _allowedObjects) then {
diag_log format ["DEBUG: Object: %1 published by %2 is Safe",_object, _playername];
_allowed = true;
};
 
_allowed
};

It looks like he added that in so hackers cant write things to database that are not default dayz objects.

Dont just remove it unless you know what your doing.

If you want it to still authorize default DayZ objects and also authorize the buildables in Base Building 1.2 (or ones u add in manually) replace with this:


Code:
check_publishobject = {
private["_allowed","_allowedObjects","_object"];
 
_object = _this select 0;
_playername = _this select 1;
_allowedObjects = ["TentStorage", "Hedgehog_DZ", "Sandbag1_DZ","TrapBear","Wire_cat1"];
_allowed = false;
 
diag_log format ["DEBUG: Checking if Object: %1 is allowed published by %2", _object, _playername];
 
if ((typeOf _object) in _allowedObjects || (typeOf _object) in allbuildables_class) then {
diag_log format ["DEBUG: Object: %1 published by %2 is Safe",_object, _playername];
_allowed = true;
};
 
_allowed
};


Basically all were doing is changing this line:

Code:
if ((typeOf _object) in _allowedObjects || (typeOf _object) in allbuildables_class) then {

So that it authorizes the custom buildables from the server side array.

Let me know if this solves the problem!

ALSO FOR REALITY BUILD 1.7.6.1 users, this may be very important. I noticed that Theyve made some minor changes with how deployables are publicly broadcasted to server.

In your player_build.sqf found in the "dayz_code\compile\" path


At the VERY BOTTOM Change this:


Code:
dayzPublishObj = [dayz_characterID,_object,[_dir,_location],_classname];
publicVariableServer "dayzPublishObj";
    if (isServer) then {
        dayzPublishObj call server_publishObj;
    };


to this:


Code:
dayzPublishObj = [dayz_characterID,_object,[_dir,_location],_classname];
publicVariableServer "dayzPublishObj";

And please report back to me that this still allows object to write to database and save after restart.

Else you may be writing duplicate objects to your Database and this is a big NO NO.

Thanks!


This did not work for me. ;(
 
I'm on Chernarus 1.7.7.1 with this script, all works well, but the objects won't write to the Database.

I have a feeling its because of this new line of code added to the server_functions.sqf.

Code:
#ifdef OBJECT_DEBUG
    diag_log format ["DEBUG: Checking if Object: %1 is allowed published by %2", _object, _playername];
#endif
 
    if ((typeOf _object) in _allowedObjects || (typeOf _object) in allbuildables_class) then {
#ifdef OBJECT_DEBUG
        diag_log format ["DEBUG: Object: %1 published by %2 is Safe",_object, _playername];
#endif
        _allowed = true;
    };
 
    _allowed
};

I added all the class names to the _allowedObjects = [" "] list, but they still don't save in the database.
 
Hi I have everything working perfect however for some reason i can not get items to remove from database once built.

I have tried the previous comments about fixing this issue but they do not seem to work any advice would be greatly appreciated.
 
I have added this to my hfbserver with dayz 1.7.7.1 I can see the build recipes and even build the objects just fine but like most of you I cant get the items to save to the db before a restart and they are gone after the restart. ANybody found a work around for this? Im using tavianacomrmod2 files if anyone knows what that is.. I have also tried the changes made at the beginning of the post but if I missed something please someone let me know lol this is the first server Ive ever messed with in Dayz and Im actually pretty proud I got basebuilding to even show up like it has.

On a side note and Im sure this is me just overwriting the code somewhere but when I added basebuilding my selfblood and swapseat scripts stopped working.

EDIT-----
Ok Ive done everything over and over again removing files and reading them. Wiping the server and starting over and followed step by step all of the readme files.. I can get this on the server and build the objects but my other scripts stop working and aren't visible anymore and the items I do build disappear after the server restarts.. I have spent almost a week on this reading multiple forums and going through the fixes.. Im begging for some help here...

What I need is someone who has this working on a taviana server with other scripts working on it as well to please for the love of god share your files with me.. Or help me figure out what Ive done wrong because I don't see it..

I thought maybe I was trying to call the compiles.sqf file from the wrong folder inside the init file so I added everything to the same compiles.sqf file and pointed to that but nothing worked.. so Im hoping maybe someone can lend a hand
 
Is this Right?(Server Monitor)
Code:
ayz_versionNo =        getText(configFile >> "CfgMods" >> "DayZ" >> "version");
dayz_hiveVersionNo =    getNumber(configFile >> "CfgMods" >> "DayZ" >> "hiveVersion");
_script = getText(missionConfigFile >> "onPauseScript");
 
if ((count playableUnits == 0) and !isDedicated) then {
    isSinglePlayer = true;
};
 
waitUntil{initialized};                  //means all the functions are now defined
 
call build_baseBuilding_arrays;
 
diag_log "HIVE: Starting";
 
//Set the Time
    //Send request
    _key = "CHILD:307:";
    _result = _key call server_hiveReadWrite;
    _outcome = _result select 0;
    if(_outcome == "PASS") then {
        _date = _result select 1;
       
        //date setup
        _year = _date select 0;
        _month = _date select 1;
        _day = _date select 2;
        _hour = _date select 3;
        _minute = _date select 4;
       
        //Force full moon nights
        _date = [2012,6,6,_hour,_minute];
       
        if(isDedicated) then {
            //["dayzSetDate",_date] call broadcastRpcCallAll;
            setDate _date;
            dayzSetDate = _date;
            publicVariable "dayzSetDate";
        };
        diag_log ("HIVE: Local Time set to " + str(_date));
    };
 
    //Send the key
    _key = format["CHILD:999:select payload, loop_interval, start_delay from message where instance_id = ?:[%1]:", dayZ_instance];
    _data = "HiveEXT" callExtension _key;
 
{Server Monitor}
Code:
    clearMagazineCargoGlobal  _object;
               
                if (_object isKindOf "TentStorage") then {
                    _pos set [2,0];
                    _object setpos _pos;
                    _object addMPEventHandler ["MPKilled",{_this call vehicle_handleServerKilled;}];
                };
                _object setdir _dir;
                _object setDamage _damage;\
               
                // ##### BASE BUILDING 1.2 Server Side ##### - START
// This sets objects to appear properly once server restarts
        //_object setVariable ["ObjectUID", _worldspace call dayz_objectUID2, true]; // Optional (REMOVE // lines before _object) May fix DayZ.ST issues, or issues related to Panel codes not working thanks nullpo
        if ((_object isKindOf "Static") && !(_object isKindOf "TentStorage")) then {
            _object setpos [(getposATL _object select 0),(getposATL _object select 1), 0];
        };
        //Set Variable
        if (_object isKindOf "Infostand_2_EP1" && !(_object isKindOf "Infostand_1_EP1")) then {
            _object setVariable ["ObjectUID", _worldspace call dayz_objectUID2, true];
        };
 
 
                // Set whether or not buildable is destructable
        if (typeOf(_object) in allbuildables_class) then {
            diag_log ("SERVER: in allbuildables_class:" + typeOf(_object) + " !");
            for "_i" from 0 to ((count allbuildables) - 1) do
            {
                _classname = (allbuildables select _i) select _i - _i + 1;
                _result = [_classname,typeOf(_object)] call BIS_fnc_areEqual;
                if (_result) then {
                    _requirements = (allbuildables select _i) select _i - _i + 2;
 
                    _isDestructable = _requirements select 13;
                    diag_log ("SERVER: " + typeOf(_object) + " _isDestructable = " + str(_isDestructable));
                    if (!_isDestructable) then {
                        diag_log("Spawned: " + typeOf(_object) + " Handle Damage False");
                        _object addEventHandler ["HandleDamage", {false}];
                    };
                };
            };
            //gateKeypad = _object addaction ["Defuse", "\z\addons\dayz_server\compile\enterCode.sqf"];
        };
// ##### BASE BUILDING 1.2 Server Side ##### - END
 
---- Keypads don't save their access codes after server restart ----

Does anyone have there keypad codes working after a server restart? also all players can remove the buildables after you build them. Looked through all 46 pages still have not found a solution. If anyone could or would be willing to help, all would be greatly appreciated, I would even post a fix on a posted thread for you. Good day and hope to get a reply soon.
Running base building on Tavi 2.0
 
Is anyone using the Vilayer install version of this? It's listed as "Currently broken" It's doing the classic "not saving to the DB" thing... Anyone know a way around it?
 
---- Keypads don't save their access codes after server restart ----

Does anyone have there keypad codes working after a server restart? also all players can remove the buildables after you build them. Looked through all 46 pages still have not found a solution. If anyone could or would be willing to help, all would be greatly appreciated, I would even post a fix on a posted thread for you. Good day and hope to get a reply soon.
Running base building on Tavi 2.0


Same problem! :(
 
Back
Top