Question With None AI Vehicles Dissappearing

Sunhawk

New Member
Hi SARGE, been running your mod on our server for a few months now and the people really love it - great work. But something strange has been happening since updating to 177 and 1771.

When AI steal a vehicle that is part of the normal vehicle spawns for the map and not AI related, if they are shot out of the vehicle and the player gets in they tend to disappear and then reappear on a server restart.

I've double checked my installation files and the scripts a couple of times and don't see any option around this (most of the options remain as default). Is there a reason this is happening?

Many thanks in advance.
 
If they don't despawn at the server restart you would have 123465 vehicles in 3 dayz (see what I did there?) imploding your server.
 
That makes little sense, these aren't static vehicles spawns created by the AI scripts, they are existing vehicles that have always been on the map... They are disappearing which was not the case before the update.
 
I think it's has to do with the 1771 server calls to clean up. The AI gets in the non hive vehicle, the hive is updating the vehicle but now it is owned by a NON UID and is considered not safe. Then the clean up deletes it. Then when the server restarts, it's pulls the object ui again and spawns it. Just a hunch. Let me know. This is an interesting topic to see if anyone else has the issue with a vanilla server pbo.
 
keep me posted as well.

didnt look into the cleanup conditions for 1771, but might be a reason

Sarge
 
Yeah Sarge this still appears to be a problem on my Overwatch server which is based on the 177 DayZ code. Any fix or workaround if possible would be greatly appreciated.
 
Confirmed it is not related to the 1771 server clean up. I've noticed that if a group steals a hive vehicle, then if they are all killed after getting out of said vehicle, it is removed. Then on server reboot, it is spawned again. This is preventing the stealing of helis :(
 
I'm going to bump this up because I just came here to ask the same question. I've got players saying that AI got into the player's vehicle, which was NOT an AI spawned vehicle, and it caused the vehicle to vanish.

I wonder if this has anything to do with it. In my log, I am seeing this:

3:03:23 Error in expression <ehicle _x getVariable ["Sarge",0] != 1) ) then {
diag_log ("CLEANUP: KILLING A H>
3:03:23 Error position: <) then {
diag_log ("CLEANUP: KILLING A H>
3:03:23 Error Missing ;
3:03:23 Error in expression <ehicle _x getVariable ["Sarge",0] != 1) ) then {
diag_log ("CLEANUP: KILLING A H>
3:03:23 Error position: <) then {
diag_log ("CLEANUP: KILLING A H>
3:03:23 Error Missing ;

So maybe the disappearing vehicle has something to do with the server cleanup file. Here's the relevant sections that were modified for Sarge's AI:

Code:
      name = "group_cleanup";
      init = /*%FSM<STATEINIT""">*/"//Clean groups" \n
      "{" \n
      "// diag_log (""CLEANUP: CHECKING GROUP WITH "" + str(count units _x) + "" UNITS"");" \n
      "if ((count units _x==0) && !(_x getVariable[""SAR_protect"",false])) then {" \n
      "deleteGroup _x;" \n
      "// diag_log (""CLEANUP: DELETING A GROUP"");" \n
      "};" \n
      "} forEach allGroups;" \n

Code:
      "//Check for hackers" \n
      " {" \n
      "if(vehicle _x != _x && !(vehicle _x in _safety) && (isPlayer _x)  && (typeOf vehicle _x) != ""ParachuteWest"") && (vehicle _x getVariable [""Sarge"",0] != 1) ) then {" \n
      "diag_log (""CLEANUP: KILLING A HACKER "" + (name _x) + "" "" + str(_x) + "" IN "" + (typeOf vehicle _x));" \n
      "(vehicle _x) setDamage 1;" \n
      "_x setDamage 1;" \n
      "};" \n
      " } forEach allUnits;" \n
      "" \n

I am running Dayz Epoch 1.0.2.1
 
I'm curious about this too. I actually have the option for AI to steal vehicles disabled but for some reason they still do it. The other day they stole our car when we were raiding an airfield, my friend shot the driver and the others in the car jumped out then our car disappeared.
I checked the database and it was still there so we did a mission restart and it was back in game. Kind of irritating though as normal players can't do a mission restart if an admin isn't on.
 
I'm curious about this too. I actually have the option for AI to steal vehicles disabled but for some reason they still do it. The other day they stole our car when we were raiding an airfield, my friend shot the driver and the others in the car jumped out then our car disappeared.
I checked the database and it was still there so we did a mission restart and it was back in game. Kind of irritating though as normal players can't do a mission restart if an admin isn't on.


I'm pretty sure that's happening on my server too. That option is off, but yet people say they've had AI driving vehicles.
 
Managed to fix this.
Open your server.pbo\compile\server_updateObject.sqf
Find
Code:
if (!_parachuteWest) then {
    if (_objectID == "0" && _uid == "0") then
    {
        _object_position = getPosATL _object;
            diag_log(format["Deleting object %1 with invalid ID at pos [%2,%3,%4]",
            typeOf _object,
            _object_position select 0,
            _object_position select 1,
            _object_position select 2]);
            _isNotOk = true;
    };
};

And change it to
Code:
if (!_parachuteWest) then {
    if (_objectID == "0" && _uid == "0" && (vehicle _object getVariable ["Sarge",0] != 1)) then
    {
        _object_position = getPosATL _object;
            diag_log format ["DEBUG: Deleting object %1 with invalid ID at [%2,%3,%4]",
            typeOf _object,
            _object_position select 0,
            _object_position select 1,
            _object_position select 2];
            _isNotOk = true;
    };
};

Can't take credit for the code, found it via BluePhoenix' github and he actually credited Sarge for it...
This stops AI vehicles disappearing when they leave them which means players can now steal AI vehicles (they'll still get removed at the next server restart). It also stops the server removing map vehicles which the AI have stolen.
 
You're welcome. :)
It was something that had been bugging me for a few weeks so I'm just glad it's sorted haha.
 
Back
Top