First I'd like to say thanks to Tactical_Force for fixing this issue for 1.7.6.1 onwards. This is a modified version of his work to fix the same problems in 1.8 since the 1.8 code is different.
If you've noticed that after server restarts tents aren't updating their inventories to the database, and can't be removed when packed away or destroyed, then this is the fix you need.
First you're going to need to open up dayz_server\system\server_monitor.sqf
Now find
Change it to
Save and close.
For 1.8 and 1.8.0.3
Second, open up dayz_server\compile\server_updateObject.sqf
Now find
Change it to
Save and close.
That's all you need, you can now pack up your .pbo again and tents should function correctly.
For 1.8.0.3 only
In dayz_server\system\server_monitor.sqf
Change it to
If you run into any problems, please post here.
********
If you've noticed that after server restarts tents aren't updating their inventories to the database, and can't be removed when packed away or destroyed, then this is the fix you need.
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;
For 1.8 and 1.8.0.3
Second, open up dayz_server\compile\server_updateObject.sqf
Now find
Code:
_object_killed = {
_object setDamage 1;
call _object_damage;
};
Change it to
Code:
_object_killed = {
[_ObjectID,_UID] call server_deleteObj;
};
That's all you need, you can now pack up your .pbo again and tents should function correctly.
For 1.8.0.3 only
In dayz_server\system\server_monitor.sqf
Code:
if (_damage < 1) then {
//diag_log format["OBJ: %1 - %2,%3,%4,%5,%6,%7,%8", _idKey,_type,_ownerID,_worldspace,_inventory,_hitPoints,_fuel,_damage];
dayz_nonCollide = ["DomeTentStorage","TentStorage","CamoNet_DZ"];
//Create it
_object = createVehicle [_type, _pos, [], 0, if (_type in dayz_nonCollide) then {"NONE"} else {"CAN_COLLIDE"}];
_object setVariable ["lastUpdate",time];
_object setVariable ["ObjectID", _idKey, true];
_object setVariable ["CharacterID", _ownerID, true];
_object setdir _dir;
_object setDamage _damage;
Change it to
Code:
if (_damage < 1) then {
//diag_log format["OBJ: %1 - %2,%3,%4,%5,%6,%7,%8", _idKey,_type,_ownerID,_worldspace,_inventory,_hitPoints,_fuel,_damage];
dayz_nonCollide = ["DomeTentStorage","TentStorage","CamoNet_DZ"];
//Create it
_object = createVehicle [_type, _pos, [], 0, if (_type in dayz_nonCollide) then {"NONE"} else {"CAN_COLLIDE"}];
_object setVariable ["lastUpdate",time];
// Don't set objects for deployables to ensure proper inventory updates
if (_ownerID == "0") then {
_object setVariable ["ObjectID", str(_idKey), true];
} else {
_object setVariable ["ObjectUID", _worldspace call dayz_objectUID2, true];
};
_object setVariable ["CharacterID", _ownerID, true];
_object setdir _dir;
_object setDamage _damage;
If you run into any problems, please post here.