Base Building DayZ 1.2 Released

hmmm I got another strange one:

I have 2 buildable objects, one recently created and one which has existed for a long time (before putting kikyo's improvements in). If I try to edit the code on the newer object, it works perfectly. However on the older object, it gets deleted from the db but when it tries to recreate it with the new code I get a hive error. Both object appear to be identical in the db. Here's the log from the rpt on the newer object:

Code:
13:41:14 "DELETE: Deleted by UID: 4114626757010"
13:41:17 "DEBUG: Checking if Object: 24439d00# 1056718: wf_hesco_10x.p3d REMOTE is allowed published by Server"
13:41:17 "DEBUG: Object: 24439d00# 1056718: wf_hesco_10x.p3d REMOTE published by Server is Safe"
13:41:17 "PUBLISH: Created Base_WarfareBBarrier10x with ID 4114626757010"

Now here's the entry for the one which doesn't work:

Code:
13:42:52 "DELETE: Deleted by UID: 4106826406097"
13:42:55 "DEBUG: Checking if Object: 22875d00# 1055911: wf_hesco_10x.p3d is allowed published by Server"
13:42:55 "DEBUG: Object: 22875d00# 1055911: wf_hesco_10x.p3d published by Server is Safe"
13:42:55 "PUBLISH: Created 0 with ID 4106826406097"

As you can see the only difference appears to be the reference to "REMOTE" in first object (I thought that was something to do with the isServer or isDedicated switch?), and that in the second object the _class variable doesn't appear to be being passed correctly to server_publishobject (it has the name of "o").

but both objects really do look the same in the db... it's very weird (to me anyway). where is the code which checks if an object is safe? I can't find it.

thanks
 
I believe that check makes sure the item is in the deployable table of the DB (if you use Reality, if not then it may be named something else like Object_classes).

I'm not sure why it would have that issue, as I've never used Kikyou's improvements myself.
 
Ok, in server_publishObject it calls a function from server_functions to do that check. Not sure where the REMOTE comes from as it's not listed in the diag_logs in that file. But yeah, it will pass that check anyway because it's in the allBuildables_class which you've added to the allowed objects inside that function.

It may be that it's trying to do it locally instead of contacting the server, but I'm really not too sure.
 
Ok it seems to be happening with all objects, post restart. Changing the code on an object created since the last restart seems to work fine. I wonder if its got something to do with this:

Code:
18:23:15 "Spawned: "13861241640180" TentStorage"
18:23:15 Error in expression < _damage;
_code = _fuel * 1000;
_object setVariable ["Code", _code,true]>
18:23:15   Error position: <_object setVariable ["Code", _code,true]>
18:23:15   Error Undefined variable in expression: _object
18:23:15 File z\addons\dayz_server\system\server_monitor.sqf, line 248

My rpt gets spammed with this every restart for every deployed object.
 
For some reason Overwatch stuck with the 1.8 server_monitor code format, even though DayZ itself changed back in version 1.8.0.2. No idea why Overwatch kept it as it's a pain for script additions, you'll need to check the BB additions as they natively use _object which is no longer a defined variable in the version you'll have.
 
hmm thanks, interesting. yes i see there are no other references to _object in my server_monitor. should it be using _entity instead? i'm just stumbling around in the dark here - i don't understand this code well enough :(
 
I'll have a look tomorrow and get back to you on that. Should just need to change it to _entity yes, but I can't recall off the top of my head if anything else needed changed.
 
Thanks. I've been playing about with it some more... changed the relevant section of server_monitor to this:

Code:
// ##### 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
        //the following is happening on every server restart
        _code = _fuel * 1000; //it is necessary cause we get only the converted fuel variable from the database, so we got to calculate back to code format
        _entity setVariable ["Code", _code,true]; //set Code to the Object
        _entity setVariable ["Classname", _type, true]; //set Classname to the Object
        _entity setVariable ["ObjectID", str(_ObjectID), true]; //set ObjectID to the Object
        //_entity setVariable ["ObjectID", _idKey, true]; //set ObjectID to the Object
        //_entity setVariable ["ObjectUID", _worldspace call dayz_objectUID2, true]; //set ObjectUID to the Object
        _entity setVariable ["ObjectUID", str(_ObjectID), true]; //set ObjectUID to the Object
        if ((_entity isKindOf "Static") && !(_entity isKindOf "TentStorage")) then {
            _entity setpos [(getposATL _entity select 0),(getposATL _entity select 1), 0];
        };
        //Set Variable
        if (_entity isKindOf "Infostand_2_EP1" && !(_entity isKindOf "Infostand_1_EP1")) then {
            _entity setVariable ["Code", _code, true]; //changed to _code instead of _worldspace call dayz_objectUID2
        };


        // Set whether or not buildable is destructable
        if (typeOf(_entity) in allbuildables_class) then {
            diag_log ("SERVER: in allbuildables_class:" + typeOf(_entity) + " !");
            for "_i" from 0 to ((count allbuildables) - 1) do
            {
                _classname = (allbuildables select _i) select _i - _i + 1;
                _result = [_classname,typeOf(_entity)] call BIS_fnc_areEqual;
                if (_result) then {
                    _requirements = (allbuildables select _i) select _i - _i + 2;

                    _isDestructable = _requirements select 13;
                    diag_log ("SERVER: " + typeOf(_entity) + " _isDestructable = " + str(_isDestructable));
                    if (!_isDestructable) then {
                        diag_log("Spawned: " + typeOf(_entity) + " Handle Damage False");
                        _entity addEventHandler ["HandleDamage", {false}];
                    };
                };
            };
            //gateKeypad = _entity addaction ["Defuse", "\z\addons\dayz_server\compile\enterCode.sqf"];
        };
// ##### BASE BUILDING 1.2 Server Side ##### - END

basically changed all the _object entries to _entity and also changed the way it sets objectID and objectUID. _objectUID doesn't exist anymore so I'm not sure what to set that to. Now when I change codes on objects it changes them to something else, seemingly at random:

Code:
23:24:00 "DELETE: Deleted by UID: "4113326641012""
23:24:02 "DEBUG: Checking if Object: 2228a400# 1055904: fort_bagfence_long.p3d is allowed published by Server"
23:24:02 "DEBUG: Object: 2228a400# 1055904: fort_bagfence_long.p3d published by Server is Safe"
23:24:02 "PUBLISH: Created Land_IndPipe2_Small_9 with ID 4113326641012"

No errors, but not being written back to the db anyway. Maybe cos the stuff its creating isn't stuff i've ever tried to build so maybe it's being blocked elsewhere, but still very weird.
 
You can't set the objectUID as the objectID, that will cause some pretty big problems.
Since we can't actually read the UID from the DB we have to recalculate it each startup (this is what lead to the breakdown of the original code system for base building, and why tents and other items sometimes don't get removed correctly). The object UID is calculated based on the worldspace coordinates of the item. That's what that line '_worldspace call dayz_objectUID2' is about, it sends it off to a function which then calculates it.
 
been playing with this on and off the last couple of days, not really any closer to sorting it out. Going to have to give up on it at some point I guess. Anyway the strangeness continues... at server start server_monitor seems to be deploying recently built objects with odd classnames:

Code:
11:12:27 "Spawned: "13861241640180" TentStorage"
11:12:27 "classname: TentStorage"
11:12:27 "Spawned: "41007264500308" TentStorage"
11:12:27 "classname: TentStorage"
11:12:27 "Spawned: "41016265070313" TentStorage"
11:12:27 "classname: TentStorage"
11:12:27 "Spawned: "4103726483092" TentStorage"
11:12:27 "classname: TentStorage"
11:12:27 "Spawned: "114672753750360" TentStorage"
11:12:27 "classname: Land_IndPipe2_Small_9"
11:12:27 "Spawned: "410552661745" Land_fort_bagfence_long"
11:12:27 "classname: Land_IndPipe2_Small_9"
11:12:27 "SERVER: in allbuildables_class:Land_fort_bagfence_long !"
11:12:27 "SERVER: Land_fort_bagfence_long _isDestructable = false"
11:12:27 "Spawned: Land_fort_bagfence_long Handle Damage False"

Land_IndPipe2_Small_9 isn't in my allbuildables list, I don't know where it's getting it from, or why just these 2 objects are being wrongly assigned when the original 4 tents are fine. I can see in server_monitor it's getting the value it assigns to Classname from _type, but I can't see where that variable is coming from because it's not referenced anywhere else in the file.
 
I have Land_Fire_barrel added to my base building, and for some reason it seems to be the only object that does not save after restart. Anyone else have this issue, or know what the fix might be?
 
been playing with this on and off the last couple of days, not really any closer to sorting it out. Going to have to give up on it at some point I guess. Anyway the strangeness continues... at server start server_monitor seems to be deploying recently built objects with odd classnames:

Code:
11:12:27 "Spawned: "13861241640180" TentStorage"
11:12:27 "classname: TentStorage"
11:12:27 "Spawned: "41007264500308" TentStorage"
11:12:27 "classname: TentStorage"
11:12:27 "Spawned: "41016265070313" TentStorage"
11:12:27 "classname: TentStorage"
11:12:27 "Spawned: "4103726483092" TentStorage"
11:12:27 "classname: TentStorage"
11:12:27 "Spawned: "114672753750360" TentStorage"
11:12:27 "classname: Land_IndPipe2_Small_9"
11:12:27 "Spawned: "410552661745" Land_fort_bagfence_long"
11:12:27 "classname: Land_IndPipe2_Small_9"
11:12:27 "SERVER: in allbuildables_class:Land_fort_bagfence_long !"
11:12:27 "SERVER: Land_fort_bagfence_long _isDestructable = false"
11:12:27 "Spawned: Land_fort_bagfence_long Handle Damage False"

Land_IndPipe2_Small_9 isn't in my allbuildables list, I don't know where it's getting it from, or why just these 2 objects are being wrongly assigned when the original 4 tents are fine. I can see in server_monitor it's getting the value it assigns to Classname from _type, but I can't see where that variable is coming from because it's not referenced anywhere else in the file.

Hmm that's strange. Though it seems to know what it's actually created as the "Spawned:" log is using the correct classname. What's the actual in game issue?

I have Land_Fire_barrel added to my base building, and for some reason it seems to be the only object that does not save after restart. Anyone else have this issue, or know what the fix might be?


If you add items to the build list, you also need to add them to the 'deployable' table in your DB or it doesn't know what to save it as.
 
Rosska, I just checked and it is, but there is a slight difference. Is the database case sensitive?

Build list: Land_Fire_barrel
DB: Land_Fire_Barrel
 
Hmm that's strange. Though it seems to know what it's actually created as the "Spawned:" log is using the correct classname. What's the actual in game issue?

yeah. Objects spawn as the correct objects - so, a bagfence spawns as a bagfence, and in the correct position. But after a restart I am unable to delete the object (as owner) - no errors in rpt or hive log, it removes ingame and refunds components, but does not remove from db. Also after restart i am unable to edit codes, it does not remove or recreate the object, again no errors reported.

If I try to remove an object just created (since last restart), or edit its code - both these actions work fine. It's just post-restart it all goes wrong.
 
I'd guess that you don't have the 'tent fix' installed on your server. Even though it's called a tent fix, it fixes the problem for all deployable items where they can't be updated or deleted after a restart.
 
Back
Top