Jump to content
  • 0

test server on Overpoch. Error Spam from serverVehicleCounter


jon5353

Question

Hi guys. Playing around with my test server and for some reason it keeps spitting this error out (repetitively, literally 35K lines in 30 seconds) in my .rpt

 2:27:59 Error in expression <imit = _random select 1;

_qty = {_x == _vehicle} count serverVehicleCounter;


>
 2:27:59   Error position: <_vehicle} count serverVehicleCounter;


>
 2:27:59   Error Undefined variable in expression: _vehicle
 2:27:59 File z\addons\dayz_server\init\server_functions.sqf, line 248
 2:27:59 Error in expression <imit = _random select 1;

_qty = {_x == _vehicle} count serverVehicleCounter;


>

I don't know whats going on. Here is my init.sqf

/*	
	For DayZ Epoch
	Addons Credits: Jetski Yanahui by Kol9yN, Zakat, Gerasimow9, YuraPetrov, zGuba, A.Karagod, IceBreakr, Sahbazz
*/
startLoadingScreen ["","RscDisplayLoadCustom"];
cutText ["","BLACK OUT"];
enableSaving [false, false];

//REALLY IMPORTANT VALUES
dayZ_instance =	11;					//The instance
dayzHiveRequest = [];
initialized = false;
dayz_previousID = 0;

//disable greeting menu 
player setVariable ["BIS_noCoreConversations", true];
//disable radio messages to be heard and shown in the left lower corner of the screen
enableRadio false;
// May prevent "how are you civillian?" messages from NPC
enableSentences false;

// DayZ Epoch config
spawnShoremode = 1; // Default = 1 (on shore)
spawnArea= 1500; // Default = 1500
MaxVehicleLimit = 1000; // Default = 50
MaxDynamicDebris = 500; // Default = 100
dayz_MapArea = 14000; // Default = 10000
dayz_maxLocalZombies = 30; // Default = 30 
dayz_fullMoonNights = true;
DZE_vehicleAmmo = 1;
DZE_R3F_WEIGHT = false;
dayz_paraSpawn = false;
dayz_minpos = -1; 
dayz_maxpos = 16000;
dayz_sellDistance_vehicle = 50;
dayz_sellDistance_boat = 50;
dayz_sellDistance_air = 50;
dayz_maxAnimals = 5; // Default: 8
dayz_tameDogs = true;
DynamicVehicleDamageLow = 50; // Default: 0
DynamicVehicleDamageHigh = 100; // Default: 100
DynamicVehicleFuelLow = 25;
DynamicVehicleFuelHigh = 100;
DZE_requireplot = 0;
dayz_fullMoonNights = true;
DZE_GodModeBase = true;
DZE_BuildingLimit = 1000; 
DZE_MissionLootTable = true;

DZE_BuildOnRoads = false; // Default: False

DefaultMagazines = [
"ItemBandage",
"ItemBandage",
"17Rnd_9x19_glock17",
"17Rnd_9x19_glock17",
"ItemMorphine",
"ItemPainkiller",
"FoodRabbitCooked",
"FoodRabbitCooked",
"ItemSodaCoke",
"ItemSodaCoke"
]; 
DefaultWeapons = [
"glock17_EP1",
"ItemCompass",
"ItemMap",
"ItemMachete"
]; 
DefaultBackpack = "DZ_Assault_Pack_EP1"; 
DefaultBackpackWeapon = "";

EpochEvents = [
["any","any","any","any",0,"crash_spawner"],
["any","any","any","any",5,"crash_spawner"],
["any","any","any","any",10,"crash_spawner"],
["any","any","any","any",15,"crash_spawner"],
["any","any","any","any",20,"crash_spawner"],
["any","any","any","any",25,"crash_spawner"],
["any","any","any","any",30,"crash_spawner"],
["any","any","any","any",35,"crash_spawner"],
["any","any","any","any",40,"crash_spawner"],
["any","any","any","any",10,"crash_spawner"],
["any","any","any","any",45,"crash_spawner"],
["any","any","any","any",50,"crash_spawner"],
["any","any","any","any",55,"crash_spawner"],
["any","any","any","any",0,"supply_drop"],
["any","any","any","any",5,"supply_drop"],
["any","any","any","any",10,"supply_drop"],
["any","any","any","any",15,"supply_drop"],
["any","any","any","any",20,"supply_drop"],
["any","any","any","any",25,"supply_drop"],
["any","any","any","any",30,"supply_drop"],
["any","any","any","any",35,"supply_drop"],
["any","any","any","any",40,"supply_drop"],
["any","any","any","any",45,"supply_drop"],
["any","any","any","any",50,"supply_drop"],
["any","any","any","any",55,"supply_drop"]
];


//Load in compiled functions
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf";				//Initilize the Variables (IMPORTANT: Must happen very early)
progressLoadingScreen 0.1;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\publicEH.sqf";				//Initilize the publicVariable event handlers
progressLoadingScreen 0.2;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\setup_functions_med.sqf";	//Functions used by CLIENT for medical
progressLoadingScreen 0.4;
call compile preprocessFileLineNumbers "compiles.sqf";
progressLoadingScreen 0.5;
call compile preprocessFileLineNumbers "server_traders.sqf";				//Compile trader configs
progressLoadingScreen 1.0;

"filmic" setToneMappingParams [0.153, 0.357, 0.231, 0.1573, 0.011, 3.750, 6, 4]; setToneMapping "Filmic";

if (isServer) then {
	call compile preprocessFileLineNumbers "\z\addons\dayz_server\missions\DayZ_Epoch_11.Chernarus\dynamic_vehicle.sqf";
	//Compile vehicle configs
	
	// Add trader citys
	_nil = [] execVM "\z\addons\dayz_server\missions\DayZ_Epoch_11.Chernarus\mission.sqf";
	_serverMonitor = 	[] execVM "\z\addons\dayz_code\system\server_monitor.sqf";
};

endLoadingScreen; // Work around for 2nd Log in hang
if (!isDedicated) then {
    [] execVM "TradeFromVehicle\init.sqf";
    [] execVM "hotkeys.sqf";
	//Conduct map operations
	0 fadeSound 0;
	waitUntil {!isNil "dayz_loadScreenMsg"};
	dayz_loadScreenMsg = (localize "STR_AUTHENTICATING");
	execVM "service_point\service_point.sqf";
    
	//Run the player monitor
	_id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
	_playerMonitor = 	[] execVM "\z\addons\dayz_code\system\player_monitor.sqf";	

// Epoch Admin Tools
[] execVM "admintools\AdminList.sqf";
if ( !((getPlayerUID player) in AdminList) && !((getPlayerUID player) in ModList) && !((getPlayerUID player) in tempList)) then 
{
  [] execVM "\z\addons\dayz_code\system\antihack.sqf";
};
// Epoch Admin Tools
[] execVM "admintools\AdminList.sqf";
	//Lights
	//[false,12] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf";
	
};

#include "\z\addons\dayz_code\system\REsec.sqf"

//Start Dynamic Weather
execVM "\z\addons\dayz_code\external\DynamicWeatherEffects.sqf";


#include "\z\addons\dayz_code\system\BIS_Effects\init.sqf"
endLoadingScreen; // Work around for 2nd Log in hang

//buildings
[] execVM "buildings\balotar1.sqf";
[] execVM "buildings\basebor.sqf";
[] execVM "buildings\basedichina.sqf";
[] execVM "buildings\basenovy.sqf";
[] execVM "buildings\camp_rocket.sqf";
[] execVM "buildings\cqz.sqf";
[] execVM "buildings\fortstary.sqf";
[] execVM "buildings\neaf.sqf";
[] execVM "buildings\nwafbase.sqf";
[] execVM "buildings\nwaffull.sqf";
[] execVM "buildings\tikhaya.sqf";
[] execVM "buildings\zeleno.sqf";
[] execVM "buildings\excelsior.sqf";
[] execVM "buildings\skalistybase.sqf";

//actionmenu
[] execVM "ActionMenu\actionmenu_activate.sqf";
//admintools
[] execVM "admintools\Activate.sqf";
//debug stuff
//HotKey(F8)
waituntil {!IsNull (findDisplay 46)};
_SpecKeyDown = (findDisplay 46) displayAddEventHandler ["KeyDown", loadFile "hotkeys.sqf"];
//Debug Monitor	
[] execVM "custom_monitor.sqf";

 

And here is my server_functions.sqf (the chunk it is talking about)

spawn_vehicles = {
	private ["_random","_lastIndex","_weights","_index","_vehicle","_velimit","_qty","_isAir","_isShip","_position","_dir","_istoomany","_veh","_objPosition","_marker","_iClass","_itemTypes","_cntWeights","_itemType","_num","_allCfgLoots"];

	if (!isDedicated) exitWith { }; //Be sure the run this

	while {count AllowedVehiclesList > 0} do {
		// BIS_fnc_selectRandom replaced because the index may be needed to remove the element
		_index = floor random count AllowedVehiclesList;
		_random = AllowedVehiclesList select _index;

		_vehicle = _random select 0;
		_velimit = _random select 1;         //this is line 248

		_qty = {_x == _vehicle} count serverVehicleCounter;

		// If under limit allow to proceed
		if (_qty <= _velimit) exitWith {};

		// vehicle limit reached, remove vehicle from list
		// since elements cannot be removed from an array, overwrite it with the last element && cut the last element of (as long as order is not important)
		_lastIndex = (count AllowedVehiclesList) - 1;
		if (_lastIndex != _index) then {
			AllowedVehiclesList set [_index, AllowedVehiclesList select _lastIndex];
		};
		AllowedVehiclesList resize _lastIndex;
	};


	if (count AllowedVehiclesList == 0) then {
		diag_log("DEBUG: unable to find suitable vehicle to spawn");
	} else {

		// add vehicle to counter for next pass
		serverVehicleCounter set [count serverVehicleCounter,_vehicle];
	
		// Find Vehicle Type to better control spawns
		_isAir = _vehicle isKindOf "Air";
		_isShip = _vehicle isKindOf "Ship";
	
		if(_isShip || _isAir) then {
			if(_isShip) then {
				// Spawn anywhere on coast on water
				waitUntil{!isNil "BIS_fnc_findSafePos"};
				_position = [MarkerPosition,0,DynamicVehicleArea,10,1,2000,1] call BIS_fnc_findSafePos;
				//diag_log("DEBUG: spawning boat near coast " + str(_position));
			} else {
				// Spawn air anywhere that is flat
				waitUntil{!isNil "BIS_fnc_findSafePos"};
				_position = [MarkerPosition,0,DynamicVehicleArea,10,0,2000,0] call BIS_fnc_findSafePos;
				//diag_log("DEBUG: spawning air anywhere flat " + str(_position));
			};
		
		
		} else {
			// Spawn around buildings && 50% near roads
			if((random 1) > 0.5) then {
			
				waitUntil{!isNil "BIS_fnc_selectRandom"};
				_position = RoadList call BIS_fnc_selectRandom;
			
				_position = _position modelToWorld [0,0,0];
			
				waitUntil{!isNil "BIS_fnc_findSafePos"};
				_position = [_position,0,10,10,0,2000,0] call BIS_fnc_findSafePos;
			
				//diag_log("DEBUG: spawning near road " + str(_position));
			
			} else {
			
				waitUntil{!isNil "BIS_fnc_selectRandom"};
				_position = BuildingList call BIS_fnc_selectRandom;
			
				_position = _position modelToWorld [0,0,0];
			
				waitUntil{!isNil "BIS_fnc_findSafePos"};
				_position = [_position,0,40,5,0,2000,0] call BIS_fnc_findSafePos;
			
				//diag_log("DEBUG: spawning around buildings " + str(_position));
		
			};
		};
		// only proceed if two params otherwise BIS_fnc_findSafePos failed && may spawn in air
		if ((count _position) == 2) then { 
	
			_dir = round(random 180);
		
			_istoomany = _position nearObjects ["AllVehicles",50];
			if((count _istoomany) > 0) exitWith { diag_log("DEBUG: Too many vehicles at " + str(_position)); };
		
			//place vehicle 
			_veh = createVehicle [_vehicle, _position, [], 0, "CAN_COLLIDE"];
			_veh setdir _dir;
			_veh setpos _position;		
			
			if(DZEdebug) then {
				_marker = createMarker [str(_position) , _position];
				_marker setMarkerShape "ICON";
				_marker setMarkerType "DOT";
				_marker setMarkerText _vehicle;
			};	
		
			// Get position with ground
			_objPosition = getPosATL _veh;
		
			clearWeaponCargoGlobal  _veh;
			clearMagazineCargoGlobal  _veh;
			// _veh setVehicleAmmo DZE_vehicleAmmo;

			// Add 0-3 loots to vehicle using random cfgloots 
			_num = floor(random 4);
			_allCfgLoots = ["trash","civilian","food","generic","medical","military","policeman","hunter","worker","clothes","militaryclothes","specialclothes","trash"];
			
			for "_x" from 1 to _num do {
				_iClass = _allCfgLoots call BIS_fnc_selectRandom;

				_itemTypes = [];
				if (DZE_MissionLootTable) then{
					{
						_itemTypes set[count _itemTypes, _x select 0]
					} count getArray(missionConfigFile >> "cfgLoot" >> _iClass);
				}
				else {
					{
						_itemTypes set[count _itemTypes, _x select 0]
					} count getArray(configFile >> "cfgLoot" >> _iClass);
				};

				_index = dayz_CLBase find _iClass;
				_weights = dayz_CLChances select _index;
				_cntWeights = count _weights;
				
				_index = floor(random _cntWeights);
				_index = _weights select _index;
				_itemType = _itemTypes select _index;
				_veh addMagazineCargoGlobal [_itemType,1];
				//diag_log("DEBUG: spawed loot inside vehicle " + str(_itemType));
			};

			[_veh,[_dir,_objPosition],_vehicle,true,"0"] call server_publishVeh;
		};
	};
};

 

I haven't messed with it at all, and I even compared the cunk to the current one on github and there are no differences. I have no idea whats going on.

 

Any help would be greatly appreciated!

 

 

 

Oh and here is my dynamic_vehicle.sqf, since its related to vehicle count

AllowedVehiclesList = [
["AH6X_DZ",5],
["AN2_DZ",5],
["ArmoredSUV_PMC_DZE",5],
["ATV_CZ_EP1",5],
["ATV_US_EP1",5],
["C130J_US_EP1_DZ",5],
["CH_47F_EP1_DZE",5],
["CSJ_GyroC",5],
["CSJ_GyroCover",5],
["CSJ_GyroP",5],
["datsun1_civil_1_open",5],
["datsun1_civil_2_covered",5],
["datsun1_civil_3_open",5],
["Fishing_Boat",5],
["GAZ_Vodnik_DZE",5],
["GAZ_Vodnik_MedEvac",5],
["GNT_C185",5],
["GNT_C185C",5],
["GNT_C185R",5],
["GNT_C185U",5],
["hilux1_civil_1_open",5],
["hilux1_civil_2_covered",5],
["hilux1_civil_3_open_EP1",5],
["HMMWV_Ambulance",5],
["HMMWV_Ambulance_CZ_DES_EP1",5],
["HMMWV_DES_EP1",5],
["HMMWV_DZ",5],
["HMMWV_M1035_DES_EP1",5],
["HMMWV_M1151_M2_CZ_DES_EP1_DZE",5],
["HMMWV_M998A2_SOV_DES_EP1_DZE",5],
["JetSkiYanahui_Case_Blue",5],
["JetSkiYanahui_Case_Green",5],
["JetSkiYanahui_Case_Red",5],
["JetSkiYanahui_Case_Yellow",5],
["Kamaz",5],
["KamazRefuel_DZ",5],
["LandRover_CZ_EP1",5],
["LandRover_MG_TK_EP1_DZE",5],
["LandRover_Special_CZ_EP1_DZE",5],
["LandRover_TK_CIV_EP1",5],
["M1030_US_DES_EP1",5],
["MH6J_DZ",5],
["Mi17_Civilian_DZ",5],
["Mi17_DZ",5],
["MMT_Civ",30],
["MtvrRefuel_DES_EP1_DZ",5],
["MTVR_DES_EP1",5],
["MV22_DZ",5],
["Offroad_DSHKM_Gue_DZ",5],
["PBX",5],
["Pickup_PK_GUE_DZE",5],
["Pickup_PK_INS_DZE",5],
["Pickup_PK_TK_GUE_EP1_DZE",5],
["RHIB",5],
["SUV_Blue",5],
["SUV_Camo",5],
["SUV_Charcoal",5],
["SUV_Green",5],
["SUV_Orange",5],
["SUV_Pink",5],
["SUV_Red",5],
["SUV_Silver",5],
["SUV_TK_CIV_EP1",5],
["SUV_White",5],
["SUV_Yellow",5],
["UAZ_CDF",5],
["UAZ_INS",5],
["UAZ_MG_TK_EP1_DZE",5],
["UAZ_RU",5],
["UAZ_Unarmed_TK_CIV_EP1",5],
["UAZ_Unarmed_TK_EP1",5],
["UAZ_Unarmed_UN_EP1",5],
["UH1H_DZ",5],
["UH1Y_DZ",5],
["UH60M_EP1_DZ",5],
["UralRefuel_TK_EP1_DZ",5],
["Ural_CDF",5],
["Ural_TK_CIV_EP1",5],
["Ural_UN_EP1",5],
["V3S_Open_TK_CIV_EP1",5],
["V3S_Open_TK_EP1",5],
["V3S_Refuel_TK_GUE_EP1_DZ",5],
["CH53_DZE",5],
["CYBP_Camel_us",5],
["CYBP_Camel_rus",5],
["CYBP_Camel_civ",5],
["Civcar",5],
["Civcarbu",5],
["Civcarbl",5],
["Civcarre",5],
["Civcarge",5],
["Civcarwh",5],
["Civcarsl",5],
["350z",5],
["350z_red",5],
["350z_kiwi",5],
["350z_black",5],
["350z_silver",5],
["350z_green",5],
["350z_blue",5],
["350z_gold",5],
["350z_white",5],
["350z_pink",5],
["350z_mod",5],
["350z_ruben",5],
["350z_v",5],
["350z_yellow",5]
];
 

 

It might be one of these causing the error, but I should have all of the correct classnames...

 

Here are each of them on pastebin, in case you prefer that:

server_functions.sqf, dynamic_vehicle.sqf, and my init.sqf

(also, for future reference, what syntax should I use for pastebin? I normally use sql, but sqfs aren't sql... Would people prefer no highlighting at all?)

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0
  • MaxVehicleLimit = 1000; // Default = 50<=========== try increase this
  •  
  • MaxDynamicDebris = 500; // Default = 100        this might count as vehicles as well

i think also added map content counts as vehicles and also epoch buildables

 

you have 540 static cars /trucks spawning in

Link to comment
Share on other sites

  • 0

Looks as if you have your maxvehicle limit set to more then what your dynamic vehicle list will spawn. Change your maxvehicle to 500 instead of 1000. And give that a go. 

This worked! Thanks a lot. Didn't really occur to me that that could be a problem. I set it to 565, the exact amount of vehicles I have defined to be able to spawn. So far so good!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...