Jump to content
  • 0

"Error in expression <ivate.sqf" error out of nowhere?


Rocu

Question

So my Taviana OverPoch server was running great for a couple of days in a row. I've been updating it a lot lately but no major setbacks so far.

Until I discovered the following error in my RPT:

22:15:56 Error in expression <ivate.sqf"
if ((getPlayerUID player) in AdminList || (getPlayerUID player) in Mo>
22:15:56   Error position: <AdminList || (getPlayerUID player) in Mo>
22:15:56   Error Undefined variable in expression: adminlist
22:15:56 File mpmissions\DayZ_Overpoch_2.Tavi\admintools\Activate.sqf, line 1

This came literally out of nowhere. Yesterday I didn't have it, today since the first run I have it. I tried reverting the last couple of updates I did, didn't help. I reverted a whole day's worth of files, didn't help. Then I reverted the whole week's work and still getting the same error. How is this remotely possible? I very much doubt the error is in the files listed in the error. My theory is that it's a syntax error in some other file but activate.sqf is being called out because that's where the first conflict happens. I know you guys probably want to see my activate.sqf and adminList.sqf files anyway so here they are:

 

AdminList.sqf:

// Epoch Admin Tools
//Replace 111111111 with your ID. 
AdminList = [
"76561198046592472" // Rocu
];
ModList = [
];

/*
	Base deletion variable. Default true.
	Determines default true or false for deleting all vehicles
	inside the base delete dome. Can be changed in game.
*/
BD_vehicles = true;




// DO NOT MODIFY ANYTHING BEYOND THIS POINT
tempList = []; 

/*
	Determines default on or off for admin tools menu
	Set this to false if you want the menu to be off by default.
	F11 turns the tool off, F10 turns it on.
	Leave this as True for now, it is under construction.
*/
if (isNil "toolsAreActive") then {toolsAreActive = true;}; 

 

Activate.sqf:

if ((getPlayerUID player) in AdminList || (getPlayerUID player) in ModList) then {
	Sleep 5;
	private["_veh", "_idx"];
	_idx = -1;

	while {alive player} do
	{
		if(toolsAreActive) then
		{
			if (_idx == -1) then
			{
				[]execVM "admintools\KeyBindings\FunctionKeys.sqf";
				[]execVM "admintools\KeyBindings\NumberKeys.sqf";
				_idx = (vehicle player) addaction [("<t color=""#585858"">" + ("Admin Menu") +"</t>"),"admintools\AdminToolsMain.sqf","",7,false,true,"",""];
				_veh = vehicle player;
			};
			if (_veh != vehicle player) then
			{
				_veh removeAction _idx;
				_idx = -1;      
			};
		}else{
			if(_idx != -1) then {
				_veh removeAction _idx;
				_idx = -1;
			};
		};
		Sleep 2;
	};
	_veh removeAction _idx;
	_idx = -1;
}; 

 

So what really happens in game? Well, nothing. Everything works fine. Even admin tools with all it's functions. But this seems like an error I can't ignore. It's a matter of time until it finds something to break. 

To give you a little more insight of what my server includes, here's a list of major updates I've installed:

 

Mod: Taviana 2.0, Epoch 1.0.5.1, Overwatch

Scripts:

  • Admintools
  • Snap Building Pro
  • Plot Pole 4 Life
  • SafeZone script by Maca
  • Single Currency by Zupa

All scripts & mods are the latest version. When I tried reverting versions I also un-did the Single Currency one because I thought that might've been the cause.

 

Anyway, if someone has ever dealt with a similar problem or might have any insight of what's going on, any help would be much appreciated. Have worked around 8 hours on this error already without a result and will continue. 

 

Thanks in advance.

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

Yes. Here's 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 = 13;	//The instance
dayzHiveRequest = [];
initialized = false;
dayz_previousID = 0;

setViewDistance 1500;
setTerrainGrid 20;
bis_fog = 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 = 2500; // Default = 1500

MaxVehicleLimit = 50; // Default = 50
MaxDynamicDebris = 700; // Default = 100
dayz_MapArea = 20000; // Default = 10000

DZE_MissionLootTable = true;

EpochEvents = [["any","any","any","any",30,"crash_spawner"],["any","any","any","any",0,"crash_spawner"],["any","any","any","any",15,"supply_drop"]];
dayz_fullMoonNights = true;

dayz_minpos = -26000; 
dayz_maxpos = 26000;

dayz_sellDistance_vehicle = 10;
dayz_sellDistance_boat = 30;
dayz_sellDistance_air = 40;

dayz_paraSpawn = false;

dayz_maxAnimals = 1; // Default: 8
dayz_tameDogs = false;
DynamicVehicleDamageLow = 0; // Default: 0
DynamicVehicleDamageHigh = 100; // Default: 100

DZE_PlayerZed = false;
DZE_BuildOnRoads = false; // Default: False

// DZEdebug = true;

//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 "\z\addons\dayz_code\init\compiles.sqf";				// OLD VALUE BEFORE 'Plot For Life' MOD
call compile preprocessFileLineNumbers "custom\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_13.Tavi\dynamic_vehicle.sqf";				//Compile vehicle configs
	
	// Add trader citys
	_nil = [] execVM "\z\addons\dayz_server\missions\DayZ_Epoch_13.Tavi\mission.sqf";
	//_serverMonitor = 	[] execVM "\z\addons\dayz_code\system\server_monitor.sqf";
	
	diag_log text "APlotForLife";
	_serverMonitor = 	[] execVM "custom\APlotForLifev2.2.1\server_monitor.sqf";
	diag_log format["[_serverMonitor: %1]",_serverMonitor];
};

if (!isDedicated) then {
	//Conduct map operations
	0 fadeSound 0;
	waitUntil {!isNil "dayz_loadScreenMsg"};
	dayz_loadScreenMsg = (localize "STR_AUTHENTICATING");
	
	//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";
	};

	//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"
// Epoch Admin Tools
[] execVM "admintools\Activate.sqf";

Link to comment
Share on other sites

  • 0

It happens when that variable in the AdminTools is out of scope for the calling script, or in the rare instance where the adminList gets unset. Can easily be fixed by making amendments to check for a null/nil/objNull value. Doesn't matter what order you load Admin in. Actually, also setting the array to [""] may cause problems with some scripts as [""] is not an empty array.

 

Raise it on the GitHub of the AdminTools page and have the author resolve it :-)

Link to comment
Share on other sites

  • 0

The most important hint is the variable name that is being called "undefined" (AdminList). If you examine your files to see where AdminList defined and used, you will see that it is defined in AdminList.sqf and used in Activate.sqf.

 

You have AdminList.sqf inside an if (!isDedicated) block, and that is a good thing, because you only want to run client-sided admin tools on the client. The problem is that you have your other admin tool file (Activate.sqf) outside of the !isDedicated block, meaning that Activate.sqf is read by both the client and the server. Since the server never read AdminList.sqf due to the !isDedicated block, the server has no idea what the variable AdminList means and gives you the undefined variable message.

 

TL;DR solution: You need to move the line:

[] execVM "admintools\Activate.sqf";

right under the line where you call AdminList.sqf. This will prevent the server from ever reading Activate.sqf while the client continues to read it as normal.

Link to comment
Share on other sites

  • 0

The most important hint is the variable name that is being called "undefined" (AdminList). If you examine your files to see where AdminList defined and used, you will see that it is defined in AdminList.sqf and used in Activate.sqf.

 

You have AdminList.sqf inside an if (!isDedicated) block, and that is a good thing, because you only want to run client-sided admin tools on the client. The problem is that you have your other admin tool file (Activate.sqf) outside of the !isDedicated block, meaning that Activate.sqf is read by both the client and the server. Since the server never read AdminList.sqf due to the !isDedicated block, the server has no idea what the variable AdminList means and gives you the undefined variable message.

 

TL;DR solution: You need to move the line:

[] execVM "admintools\Activate.sqf";

right under the line where you call AdminList.sqf. This will prevent the server from ever reading Activate.sqf while the client continues to read it as normal.

 

That makes sense. I tried it and it worked. Thanks for the explanation and solution. 

I actually thought of that myself earlier. I tried things like actually merging those two files together or bringing the admintools\AdminList.sqf calling down instead of Activate.sqf up. But that was just trial & error because I don't have nearly enough knowledge about Arma 2 modding yet. But this makes sense and I appreciate it. Thanks!

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...