Base Building DayZ 1.2 Released

Where is the server build list? I only know of the build_list.sqf in the mission.pbo

That's likely your problem then. The server build list is in dayz_server\init\server_functions.sqf
It's near the bottom of the file, you can simply copy paste the section from '_buildList = [' right down to it's closing brace '];'
 
hmmm. I definitely had the tent fix working at one stage, possibly before i tried to add kikyou2's improvements. maybe i broke it again.
 
Actually I'm not sure your tent fix is working for overwatch... I mean it's working in the sense that tents and other objects are persistent across restart, in the section for 1.8 only (or overwatch 0.2.5) you say do this:

Code:
// Don't set objects for deployables to ensure proper inventory updates
                if (_CharacterID == "0") then {
                    _entity setVariable ["ObjectID", str(_ObjectID), true];
                } else {
                    _entity setVariable ["ObjectUID", str(_ObjectID), true];
                };

but as we've discussed, you can't set ObjectUID to _ObjectID. This gets set a few lines down as part of basebuilding code add-in anyway.

Here is the relevant section of my server_monitor.sqf:

Code:
if (_damage < 1) then { // create object
                diag_log("Spawned: " + str(_ObjectID) + " " + _class);
 
                // for tents: non colliding position
                _entity = createVehicle [_class, _point, [], 0,
                    if (_class=="TentStorage") then {"NONE"} else {"CAN_COLLIDE"}
                ];
                _entity setVariable ["lastUpdate",time];
                // Don't set objects for deployables to ensure proper inventory updates
                if (_CharacterID == "0") then {
                    _entity setVariable ["ObjectID", str(_ObjectID), true];
                } else {
                    _entity setVariable ["ObjectUID",_worldspace call dayz_objectUID2 , true];
                };
                _entity setVariable ["CharacterID", _CharacterID, true];
                
                if (_class == "TentStorage" || _class == "CamoNet_DZ") then {
                    _entity addMPEventHandler ["MPKilled",{_this call vehicle_handleServerKilled;}];
                };
 
                _entity setDamage _damage;
            
                //diag_log ("DW_DEBUG " + _class + " #" + str(_ObjectID) + " pos=" +      (_point call fa_coor2str) + ", damage=" + str(_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
                //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
                diag_log ("classname: " + _type);
                _entity setVariable ["ObjectID", str(_ObjectID), true]; //set ObjectID to the Object
                _entity setVariable ["ObjectUID", _worldspace call dayz_objectUID2, 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

sorry for the huge post.
 
Looking at that again, I'm wondering if

Code:
_entity setVariable ["Classname", _type, true]; //set Classname to the Object

should be

Code:
_entity setVariable ["Classname", _class, true]; //set Classname to the Object

and whether it would make a difference to me problem... I don't know.
 
I thought that was something you did for me already? Where is the info for this "tent fix"?

I was taling to BipolarBear about the tent fix. Your issue is that the server and client build lists don't match. :p

Looking at that again, I'm wondering if

Code:
_entity setVariable ["Classname", _type, true]; //set Classname to the Object

should be

Code:
_entity setVariable ["Classname", _class, true]; //set Classname to the Object

and whether it would make a difference to me problem... I don't know.

Sorry man, it's really hard to tell what a variable should be without seeing the entire file to see what they define as what. I know that some versions use _type as the variable for classname, some don't. If you can upload your entire server_monitor.sqf I'll try and take a look at it for you.
 
getting down to what i think the problem is. Here's server_deleteObj.sqf:

/*
[_objectID,_objectUID] call server_deleteObj;
*/
private["_id","_uid","_key"];
_id = _this select 0;
_uid = _this select 1;
diag_log format["objectID: %1",_id];
diag_log format["objectUID: %1",_uid];
if (isServer) then {
//remove from database​
if (parseNumber _id > 0) then {​
//Send request​
_key = format["CHILD:304:%1:",_id];​
_key call server_hiveWrite;​
diag_log format["DELETE: Deleted by ID: %1",_id];​
} else {​
//Send request​
_key = format["CHILD:310:%1:",_uid];​
_key call server_hiveWrite;​
diag_log format["DELETE: Deleted by UID: %1",_uid];​
};​
};

This is standard I think. At least I haven't modified it. Basically with a new object, _id=0, and if you send that _key array through to server_hiveWrite it works - and removes the item from the db. Anything else does not work, if there is non-zero _id no errors are generated - but the object is not removed from the db. Maybe this is specific to overwatch. I don't know how the hiveWrite format works, or the difference between 304 and 310. This is the code for server_hiveWrite in server_functions.sqf, and it doesn't mean much to me:

Code:
server_hiveWrite = {
    private["_data"];
    diag_log ("ATTEMPT WRITE: " + _this);
    _data = "HiveExt" callExtension _this;
    diag_log ("WRITE: " +str(_data));
};
 
I still say the problem is in your server_monitor.sqf.
That file doesn't set the ID as 0, it reads the ID from the file that launches it and _this select 0 means the first item in the array the file is passing is to be assigned as ID.

With the tent fix, we don't set an objectID for any items which have an owner, instead we set the objectUID because that is the reliable method for updating it in the DB and helps differentiate between owned and unowned items. I've installed both BB 1.2 and Kikyou's improvements onto Overwatch before so I know that file isn't at fault.

The numbers 304 and 310 refer to which table it's referencing I believe. Like 309 is instance_deployable, 308 I think is instance_vehicle or something and so on. I can't really remember them all off the top of my head, but you get the idea.

If you upload your server_monitor.sqf I'll take a look at it. It's possible there is one variable wrong in there which is causing the issues. In fact, just having another quick glance at the code you posted a few posts up, you're setting objectID and objectUID for base build items. One, you don't want to set it's objectID, and two, the objectUID was already set just above where base building edits are added. That's why we add them there. :)
 
I still say the problem is in your server_monitor.sqf.
That file doesn't set the ID as 0, it reads the ID from the file that launches it and _this select 0 means the first item in the array the file is passing is to be assigned as ID.

With the tent fix, we don't set an objectID for any items which have an owner, instead we set the objectUID because that is the reliable method for updating it in the DB and helps differentiate between owned and unowned items. I've installed both BB 1.2 and Kikyou's improvements onto Overwatch before so I know that file isn't at fault.

The numbers 304 and 310 refer to which table it's referencing I believe. Like 309 is instance_deployable, 308 I think is instance_vehicle or something and so on. I can't really remember them all off the top of my head, but you get the idea.

If you upload your server_monitor.sqf I'll take a look at it. It's possible there is one variable wrong in there which is causing the issues. In fact, just having another quick glance at the code you posted a few posts up, you're setting objectID and objectUID for base build items. One, you don't want to set it's objectID, and two, the objectUID was already set just above where base building edits are added. That's why we add them there. :)

Thanks. Do you mean in this bit:

Code:
if (_damage < 1) then { // create object
                diag_log("Spawned: " + str(_ObjectID) + " " + _class);
 
                // for tents: non colliding position
                _entity = createVehicle [_class, _point, [], 0,
                    if (_class=="TentStorage") then {"NONE"} else {"CAN_COLLIDE"}
                ];
                _entity setVariable ["lastUpdate",time];
                // Don't set objects for deployables to ensure proper inventory updates
                if (_CharacterID == "0") then {
                    _entity setVariable ["ObjectID", str(_ObjectID), true];
                } else {
                    _entity setVariable ["ObjectUID", str(_ObjectID), true];
                };
                _entity setVariable ["CharacterID", _CharacterID, true];
                
                if (_class == "TentStorage" || _class == "CamoNet_DZ") then {
                    _entity addMPEventHandler ["MPKilled",{_this call vehicle_handleServerKilled;}];
                };

I shouldn't be setting the objectID?

Sorry to sound like a n00b but how do I upload entire file? Do I need to link them from my public dropbox or something?
 
Not that bit, the bit just after where you set the code variable and classname variable. That section you just posted is where these variables are originally set. You can see that it first checks (part of the tent fix) to see if the item has an owner, if it returns as 0 (no owner) then it sets the ID, if it has an owner it sets the UID.

Yeah you'll have to upload it to dropbox or something similar and link it. :)
 
Ok, give this file a try. I've only changed where it sets the UID and commented out the other sections lower down where it set it again. Setting it again was very likely the cause of the problem as it totally undid what the tent fix was already meant to be doing.
 
Hi. Ok, interesting... editing the objects code is now adding a new object to the db with the updated code, but the old object is not being deleted. Similarly just deleting an object is not removing it from the db. server_deleteObj.sqf is being called, _id=0 so it's attempting to delete by _uid.
 
yeah. at least i think so. here's the bit from codeCheck.sqf which i changed:

Code:
PVDZ_obj_Delete = [_objectID,_objectUID]; //prepare global array to pass variables to the delete function
    publicVariableServer "PVDZ_obj_Delete";
    if (isServer) then {
        PVDZ_obj_Delete call server_deleteObj; //delete the object in the database to be able to recreate it
    };
 
Hmmm ok, then it's likely it's already miscalculated the objects UID and can't match it in the DB to delete the object. To confirm this, what you can do is in codeCheck.sqf, just under the PVDZ_obj_Delete = [_objectID, _objectUID];
Add this line
Code:
diag_log format ["_ObjectUID is %1",_objectUID];
That will then print whatever the _objectUID variable is currently set to into your RPT log. It may be in the client RPT and not the server RPT but either way it'll let you see what it has for it. You can then check to see if it matches the UID of the item as it is in the database.
 
Back
Top