Tent inventory updates after restart

ShootingBlanks

OpenDayZ Guru!
Am I the only person with 2.5 that doesn't have working tent inventory's after restart? I have installed the default server twice and tested several times and included the tent fix from http://opendayz.net/threads/fix-tent-saving-issues-for-1-8-reality-hive.14107/ and that may have made things worse.
Before the tent fix, the tent updateobects is inserting into intance_vehicle (child:303) instead of child:309 and after the tent fix there is an error in teh _worldspace variable that is passed to the server function to return the UniqueID. Therefore the hive sql doesn't contain the UID ...

I created a long and detailed post on the Overwatch site http://www.dayzoverwatch.com/forum/.../10011266-tents-updating-issue/post/last#last that shows all the errors.

Again, I started twice with a default install and the ONLY change made was the tent-fix. Either there is more to fix or there is something more sinister going on.
 
Fixed.

EDIT:
I am not a fan of overwatch but am forced to use it. I didn't post the fix I used out of frustration as I had posted on the actual Overwatch site and not only didn't I receive ANY response, but every time I checked I was the only one logged in.
 
Ignore the server_monitor.sqf file. Since Overwatch is using a mash-up of 1.77 and 1.801 the standard tent-fix code it doesn't work and creates more errors.

Looking at the logs I realized it was writing the correct information but it was writing it for instance_vehicles, not for instance_deployables. The difference is the hive writes child:303 and child:309

So in your dayz_server.pbo edit the compiles/server_updateobject.sqf file

Look for this part about line 93

Code:
if (_objectID == "0") then {
            _key = format["CHILD:309:%1:%2:",_uid,_inventory];
        } else {
            _key = format["CHILD:303:%1:%2:",_objectID,_inventory];
        };


replace it with this:

Code:
        if (_object isKindOf "AllVehicles") then {
 
        _key = format["CHILD:303:%1:%2:",_objectID,_inventory];
 
        } else {
        _key = format["CHILD:309:%1:%2:",_objectID,_inventory];
         
        };

What its doing originally is comparing the ObjectID to zero. Well its NEVER zero as its always passed the UniqueID of the object. What I did was just change the test so it checks directly if the object is a vehicle, if its not a vehicle it MUST be a tent or stash.
Seems to be working.
 
Thanks bro hopefully it works.. did u ignore the edit to updateobjects done by the other tent fix thread?
 
OK Guys Here is the fix for it. It works for Overwatch 0.25


You need to do BOTH of these fixe. Not one but Both in order for tents to work. See below.

Always remember to create backups before editing, in case anything goes wrong.
For 1.8 only (or Overwatch 0.2.5)
First you're going to need to open up dayz_server\system\server_monitor.sqf
Now find
Code:
if (_damage < 1) then { // create object
// for tents: non colliding position
_entity = createVehicle [_class, _point, [], 0,
if (_class=="TentStorage") then {"NONE"} else {"CAN_COLLIDE"}
];
_entity setVariable ["ObjectID", _ObjectID, true];
_entity setVariable ["CharacterID", _CharacterID, true];
_entity setVariable ["lastUpdate",time];
_entity setDamage _damage;

if (_class == "TentStorage" || _class == "CamoNet_DZ") then {
_entity addMPEventHandler ["MPKilled",{_this call vehicle_handleServerKilled;}];
};
Change it to
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;
Save and close.

AND you need to do this:

So in your dayz_server.pbo edit the compiles/server_updateobject.sqf file

Look for this part about line 93

Code:
if (_objectID == "0") then {
_key = format["CHILD:309:%1:%2:",_uid,_inventory];
} else {
_key = format["CHILD:303:%1:%2:",_objectID,_inventory];
};

replace it with this:

Code:
if (_object isKindOf "AllVehicles") then {

_key = format["CHILD:303:%1:%2:",_objectID,_inventory];

} else {
_key = format["CHILD:309:%1:%2:",_objectID,_inventory];

};


After doing both repack and it will now update tents.
 
Sadly no, seems tents don't connect to the database.. Also might be the fact they were spawned through admin tools and then deployed, no clue. I tested several times on my test server and after restarting stuff disappeared. If you know what I might be doing wrong please let me know it's been a huge issue on my server.
 
Noz it broke for me again. So I am going to dig back into the files to see if I can get it to work AND stick this time.
 
OK this is werid. Once I change the below code

Code:
if (_damage < 1) then { // create object
// for tents: non colliding position
_entity = createVehicle [_class, _point, [], 0,
if (_class=="TentStorage") then {"NONE"} else {"CAN_COLLIDE"}
];
_entity setVariable ["ObjectID", _ObjectID, true];
_entity setVariable ["CharacterID", _CharacterID, true];
_entity setVariable ["lastUpdate",time];
_entity setDamage _damage;

if (_class == "TentStorage" || _class == "CamoNet_DZ") then {
_entity addMPEventHandler ["MPKilled",{_this call vehicle_handleServerKilled;}];
};
Change it to
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;

Any changes to tents I make (taking items out or putting items in) They stick in. Meaning I change the items in the tent(s) then make the code change. Stop the server then RESTART the server and the changes stick. But any restarts after that and any tent changes dont stick.

Any ideas?
 
Ok the below works but for only 1 server restart

Code:
if (_damage < 1) then { // create object
// for tents: non colliding position
_entity = createVehicle [_class, _point, [], 0,
if (_class=="TentStorage") then {"NONE"} else {"CAN_COLLIDE"}
];
_entity setVariable ["ObjectID", _ObjectID, true];
_entity setVariable ["CharacterID", _CharacterID, true];
_entity setVariable ["lastUpdate",time];
_entity setDamage _damage;

if (_class == "TentStorage" || _class == "CamoNet_DZ") then {
_entity addMPEventHandler ["MPKilled",{_this call vehicle_handleServerKilled;}];
};
Change it to
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;


So if you say in game make whatever changes you need to make to the tents. Then shut the server down and change the code above. Then restart it will keep your changes. But it will only keep changes that one singluar restart. Any restarts after that dont keep tent changes. Anyhone know why?

So what i do is keep a copy unchanged copy of the server_Monitor.sqf file and put it back in the pbo when I want to make changes to the contents of tents. Then I do the above change all over again and repack.

So there must be something somewhere that gets reset after one change.
 
Fixed.

EDIT:
I am not a fan of overwatch but am forced to use it. I didn't post the fix I used out of frustration as I had posted on the actual Overwatch site and not only didn't I receive ANY response, but every time I checked I was the only one logged in.
How your original post "fix" working for you? Still saving items to tents and vehicles?
 
My original fix was to change the update objects or some such. it was checking for a UID which was not being created by the server_monitor.sqf, I changed it to actually check for a vehicle and if it wasnt a vehicle then it must be a tent.
After some review, I realized the actual problem was created because the overwatch devs updated all the files to 1.8.0.3 EXCEPT the server_monitor.sqf file (it must have been an oversight). So my fix since has been to simply update server_monitor.sqf to 1.8.0.3 which seems to work. After doing this, whenever you use scripts, follow the instructions for 1.8.0.3 NOT for Overwatch 2.5. Such as installing Base Building 1.3 which I did last week.

So the short answer is yes, its working perfectly. Update server_monitor.sqf to match 1.8.0.3
The Overwatch devs have completely ignored any requests for support from all users and I am willing to help anyone who asks ..
We have actually been wondering how hard it would be to 'take control' of overwatch and issue a new update.
 
Last edited:
Taking over Overwatch would be a grand idea. Becasue as of now doesnt look like 0.2.6 is ever going to come out.
 
My original fix was to change the update objects or some such. it was checking for a UID which was not being created by the server_monitor.sqf, I changed it to actually check for a vehicle and if it wasnt a vehicle then it must be a tent.
After some review, I realized the actual problem was created because the overwatch devs updated all the files to 1.8.0.3 EXCEPT the server_monitor.sqf file (it must have been an oversight). So my fix since has been to simply update server_monitor.sqf to 1.8.0.3 which seems to work. After doing this, whenever you use scripts, follow the instructions for 1.8.0.3 NOT for Overwatch 2.5. Such as installing Base Building 1.3 which I did last week.

So the short answer is yes, its working perfectly. Update server_monitor.sqf to match 1.8.0.3
The Overwatch devs have completely ignored any requests for support from all users and I am willing to help anyone who asks ..
We have actually been wondering how hard it would be to 'take control' of overwatch and issue a new update.

Can you share your server_monitor .sqf? I've gotten headache trying to sort through all my backups of this file and can't seem to locate a version for 1.8.0.3...Normally I can take careof most things myself, but this one has me out of my element for some reason.
 
I just tossed in the default 1.8.0.3 server_monitor.sqf file into my dayz_server.pbo and tested it as working with tents saving the inventory correctly. You will have to edit it to reflect any changes you have made to your server such as a calling the server_spawncrashsite.sqf file, or base building etc etc.
This is the default 1.8.0.3 file
http://killonsight.us/downloads/server_monitor.sqf

Also on my website also where the version with base building 1.3 is also available.
http://killonsight.us/index.php/kunena-forum?view=topic&catid=13&id=163#434
 
Last edited:
Back
Top