Mission spawned vehicles and 1.8.3

HospitalChair

Well-Known Member
Does anyone have a fix for the exploding of mission spawned cars in vanilla dayz 1.8.3. You used to be able to comment out lines in server_updateobject like this:

//if (!_parachuteWest) then {
//diag_log format["Object: %1, ObjectID: %2, ObjectUID: %3",_object,_objectID,_objectUID];


//if (!(_objectID in dayz_serverIDMonitor) AND isNil {_objectUID}) then {
//force fail
//_objectID = nil;
//_objectUID = nil;
//};

//if ((isNil {_objectID}) AND (isNil {_objectUID})) then
//{
//_object_position = getPosATL _object;
//#ifdef OBJECT_DEBUG
//diag_log(format["Object %1 with invalid ID at pos [%2,%3,%4]",
//typeOf _object,
//_object_position select 0,
//_object_position select 1,
//_object_position select 2]);
//#endif
//_isNotOk = true;
//};

//};

//if (_isNotOk) exitWith {
//deleteVehicle _object;
//}; //uncomment to remove

and you used to have this section in server_cleanup.fsm but this section doesn't exist any more. Ideas?

name = "general_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) then {" \n
" deleteGroup _x;" \n
" //diag_log (""CLEANUP: DELETING A GROUP"");" \n
" };" \n
"} forEach allGroups;" \n
"" \n
"//Check for hackers" \n
"// {" \n
"// if(vehicle _x != _x && !(vehicle _x in _safety) && (typeOf vehicle _x) != ""ParachuteWest"") 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 would try this .. in your mission where the vehicles are created, add this line for each vehicle. The _this variable needs to refer to each vehicle that is created which SHOULD be _this but is probably _hummer, _heli or some other variable.
Code:
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_this];

I dont think anyone just commented out that code you mentioned, everyone added a variable like "sarge" to the vehicle and then checked to see if that was set. I am sure that will still fly as there is code in the cleanup destroying the vehicles and you could check for that.
Like where the vehicle is created
_this setvariable ["safeveh",1];


The "killed a hacker" code is now in D:\Arma\Server\@hive\AddOns\dayz_server\system\scheduler\sched_safetyVehicle.sqf
and you see it checks for dayz_serverObjectMonitor, so if we add the vehicle as above to that array it wont be destroyed.
Code:
sched_safetyVehicle = {
    {
        if (vehicle _x != _x && !(vehicle _x in dayz_serverObjectMonitor) && (typeOf vehicle _x) != "ParachuteWest") then {
            diag_log [ __FILE__, "KILLING A HACKER", name _x, " IN ", typeOf vehicle _x ];
            (vehicle _x) setDamage 1;
            _x setDamage 1;
        };
    } forEach allUnits;

    objNull
};
 
Hi Guys,
so what was the fix I am having the same issue have tried everything.
All my spawned in stuff is in the missions.sqm
this is one way I have done it but it still kills you after about 20 sec
presence=0.70015162;
position[]={13651.32,20.424719,3897.7615};
azimut=191.858;
id=340;
side="EMPTY";
vehicle="Old_bike_TK_CIV_EP1";
skill=0.60000002;
_this setVariable ["ObjectID", [getdir _this,getPos _this] call dayz_objectUID2, true];
_this setVariable ["Sarge",1,true];
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor ,_this];
[_this,"Old_bike_TK_CIV_EP1"] spawn server_updateObject;
I even tried with a sqf file in init.sqf same issue with this setup and still get killed

_vehicle_1 = objNull;
if (true) then
{
_this = createVehicle ["Old_bike_TK_CIV_EP1", [1716.1151, 2172.3013, -0.0092260204], [], 0, "CAN_COLLIDE"];
_vehicle_1 = _this;
_this setDir 98.040443;
_this setPos [1716.1151, 2172.3013, -0.0092260204];
_this setVariable ["ObjectID", [getdir _this,getPos _this] call dayz_objectUID2, true];
_this setVariable ["Sarge",1,true];
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor ,_this];
[_this,"Old_bike_TK_CIV_EP1"] spawn server_updateObject;
};
I would like to get the first one going if I could :)

what files do I need to edit eg server_updateObject.sqf
and what setup and I doing wrong.
anyhelp would greatly appreciated
Cheers
Reema
 
the first bit ... mission.sqm spawned vehicles are usually okay i thought, i always spawned mine in an sqf file though as in your second part.
dayz serverobjectmonitor is server-side variable when you spawn did you put the sqqf code inside of an
 
Thanks for your reply and help
One thing you may be able to help me with is I am using dayz 3d editor when adding bikes into it
when I only add 1 bike in there it spawns like 2 to 4 bikes in the server is there a way to stop this
I am using the sqf in the init.sqf file instead of the missions.sqm file.
your help in mostly appreciated
Cheers
Reema
 
when you create the sqf file in the editor and you put that file in your mission folder. then in your init.sqf you are doing
execvm "bikes.sqf";
BUT if that script is not in an isserver block then it will be executed every time a player joins and you end up with multiple bikes. So you need something like this in your init.sqf file

if (isserver) then {
execvm "bikes.sqf";
};
 
Back
Top