Error in globalCompile.sqf after adding commits.

  • Offline LouD
  • Silent but deadly ;)
  • Moderator
  • Veteran
  • ******
  • Posts: 1415

Error in globalCompile.sqf after adding commits.

« posted: Aug 27, 2014, 06:15 PM »
I've run into a problem.
Since the files we use on our server weren't updated with commits in a while i thought it be best to do so.
So i have added all the most recent commits to our test server but the client is stuck on "please wait for your client to initialize".
In the RPT i get the following error:
Code: [Select]
18:06:46 Error in expression <ve = (_this select 1) select 1;
_player switchMove _move;
};
>
18:06:46   Error position: <switchMove _move;
};
>
18:06:46   Error Generic error in expression
18:06:46 File mpmissions\ArmA3_Wasteland_Revive.Altis\globalCompile.sqf, line 105
I tried getting the complete globalCompile from Github but that doesn't help. Even if i switch back to our old GlobalCompile i get this error. So the error must be coming from somewhere else.
Seeing as i am not that good in SQF coding i could use some help here :)
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2488

Re: Error in globalCompile.sqf after adding commits.

« Reply #1 posted: Aug 27, 2014, 06:25 PM »
Are you using a Linux server? Could you upload your full globalCompile.sqf please?
  • Offline LouD
  • Silent but deadly ;)
  • Moderator
  • Veteran
  • ******
  • Posts: 1415

Re: Error in globalCompile.sqf after adding commits.

« Reply #2 posted: Aug 27, 2014, 06:36 PM »
It's a Windows server.

Full file:
Code: [Select]
// @file Version: 1.0
// @file Name: globalCompile.sqf
// @file Author: AgentRev, MercyfulFate
// @file Created: 07/09/2013 15:06

// The purpose of this script is to compile certain functions both on client and server.

private ["_DEBUG", "_clientFunc", "_serverFunc"];
_DEBUG = format ["%1", _this select 0];

// Compile a function from a file.
// if in debug mode, the function will be dyncamically compiled every call.
// if not in debug mode, the function will be compileFinal'd
// example: my_fnc_name = ["path/to/folder", "my_fnc.sqf"] call mf_compile;
// example: my_fnc_name = ["path/to/folder/my_fnc.sqf"] call mf_compile;
// later in the code you can simply use call my_fnc_name;
// you can also pass raw code to get it compileFinal'd
// example: my_fnc_name = {diag_log "hey"} call mf_compile;
mf_compile = compileFinal
('
private ["_path", "_isDebug", "_code"];
_path = "";
_isDebug = ' + _DEBUG + ';

switch (toUpper typeName _this) do {
case "STRING": {
_path = _this;
};
case "ARRAY": {
_path = format["%1\%2", _this select 0, _this select 1];
};
case "CODE": {
_code = toArray str _this;
_code set [0, (toArray " ") select 0];
_code set [count _code - 1, (toArray " ") select 0];
};
};

if (isNil "_code") then {
if (_isDebug) then {
compile format ["call compile preProcessFileLineNumbers ""%1""", _path]
} else {
compileFinal preProcessFileLineNumbers _path
};
} else {
if (_isDebug) then {
compile toString _code
} else {
compileFinal toString _code
};
};
');

// Simple command I use to make initialization scripts clean and simple.
// uses mf_ namespace to avoid any issues.
mf_init =
{
private "_path";
_path = if (typeName _this == "STRING") then {
_this
} else {
format ["%1\%2", _this select 0, _this select 1]
};
_path call compile preProcessFileLineNumbers format ["%1\init.sqf", _path];
} call mf_compile;

_clientFunc = "client\functions";
_serverFunc = "server\functions";

allPlayers = [_serverFunc, "allPlayers.sqf"] call mf_compile;
cargoToPairs = [_serverFunc, "cargoToPairs.sqf"] call mf_compile;
detachTowedObject = [_serverFunc, "detachTowedObject.sqf"] call mf_compile;
findSafePos = [_serverFunc, "findSafePos.sqf"] call mf_compile;
fn_addToPairs = [_serverFunc, "fn_addToPairs.sqf"] call mf_compile;
fn_boundingBoxReal = [_serverFunc, "fn_boundingBoxReal.sqf"] call mf_compile;
fn_enableSimulationGlobal = [_serverFunc, "fn_enableSimulationGlobal.sqf"] call mf_compile;
fn_filterString = [_serverFunc, "fn_filterString.sqf"] call mf_compile;
fn_findString = [_serverFunc, "fn_findString.sqf"] call mf_compile;
fn_getFromPairs = [_serverFunc, "fn_getFromPairs.sqf"] call mf_compile;
fn_getPos3D = [_serverFunc, "fn_getPos3D.sqf"] call mf_compile;
fn_setToPairs = [_serverFunc, "fn_setToPairs.sqf"] call mf_compile;
fn_splitString = [_serverFunc, "fn_splitString.sqf"] call mf_compile;
fn_startsWith = [_serverFunc, "fn_startsWith.sqf"] call mf_compile;
fn_vehicleInit = [_serverFunc, "fn_vehicleInit.sqf"] call mf_compile;
generateKey = [_serverFunc, "network\generateKey.sqf"] call mf_compile;
getBallMagazine = [_serverFunc, "getBallMagazine.sqf"] call mf_compile;
getFwdVelocity = [_serverFunc, "getFwdVelocity.sqf"] call mf_compile;
getHitPoints = [_serverFunc, "getHitPoints.sqf"] call mf_compile;
getMagAmmoCount = [_serverFunc, "getMagAmmoCount.sqf"] call mf_compile;
getMoveWeapon = [_clientFunc, "getMoveWeapon.sqf"] call mf_compile;
getPublicVar = [_serverFunc, "getPublicVar.sqf"] call mf_compile;
getTeamMarkerColor = "territory\client\getTeamMarkerColor.sqf" call mf_compile;
isConfigOn = [_serverFunc, "isConfigOn.sqf"] call mf_compile;
pushVehicle = [_serverFunc, "pushVehicle.sqf"] call mf_compile;
relativePos = [_serverFunc, "relativePos.sqf"] call mf_compile;
removeNegativeScore = [_serverFunc, "removeNegativeScore.sqf"] call mf_compile;
splitWeaponItems = [_serverFunc, "splitWeaponItems.sqf"] call mf_compile;
switchMoveGlobal = [_clientFunc, "switchMoveGlobal.sqf"] call mf_compile;
vehicleHandleDamage = [_serverFunc, "vehicleHandleDamage.sqf"] call mf_compile;

"pvar_switchMoveGlobal" addPublicVariableEventHandler
{
_player = (_this select 1) select 0;
_move = (_this select 1) select 1;
_player switchMove _move;
};

"pvar_detachTowedObject" addPublicVariableEventHandler { (_this select 1) call detachTowedObject };
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2488

Re: Error in globalCompile.sqf after adding commits.

« Reply #3 posted: Aug 27, 2014, 06:58 PM »
Are you sure you're not getting any other error before that one? The first error is always the crucial one when there are many.
  • Offline LouD
  • Silent but deadly ;)
  • Moderator
  • Veteran
  • ******
  • Posts: 1415
  • Offline LouD
  • Silent but deadly ;)
  • Moderator
  • Veteran
  • ******
  • Posts: 1415

Re: Error in globalCompile.sqf after adding commits.

« Reply #5 posted: Aug 27, 2014, 07:40 PM »
When i move the following line more to the top in the globalCompile.sqf my error is different.
Code: [Select]
switchMoveGlobal = [_clientFunc, "switchMoveGlobal.sqf"] call mf_compile;
But still seems to have problems with _player switchMove _move;

Error:
Code: [Select]
19:35:49 Error in expression <ve = (_this select 1) select 1;
_player switchMove _move;
};

"pvar_detachTowedO>
19:35:49   Error position: <switchMove _move;
};

"pvar_detachTowedO>
19:35:49   Error Generic error in expression
19:35:49 File mpmissions\ArmA3_Wasteland_Revive.Altis\globalCompile.sqf, line 105
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2488

Re: Error in globalCompile.sqf after adding commits.

« Reply #6 posted: Aug 27, 2014, 08:15 PM »
Can you try adding the following just above "_player switchMove _move" :

Code: [Select]
diag_log format ["player = %1 - '$2', move = %3 - '$4'", _player, typeName _player, _move, typeName _move];
Then post the log again after you get the error
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2488

Re: Error in globalCompile.sqf after adding commits.

« Reply #8 posted: Aug 27, 2014, 08:42 PM »
Alright, now do it again with this line instead:

Code: [Select]
diag_log format ["move = %3 - $4", _move, isNil "_move"];
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2488

Re: Error in globalCompile.sqf after adding commits.

« Reply #10 posted: Aug 27, 2014, 09:34 PM »
Okay, it seems to be a bug inside my switchMoveGlobal function. I will correct it when I get home.

As a temporary workaround, you can put the following line before "_player switchMove _move":

Code: [Select]
if (isNil "_move") exitWith {};
  • Offline LouD
  • Silent but deadly ;)
  • Moderator
  • Veteran
  • ******
  • Posts: 1415

Re: Error in globalCompile.sqf after adding commits.

« Reply #11 posted: Aug 27, 2014, 09:50 PM »
Thanks AgenRev.
The error is gone but my client is still stuck on "please wait for your client to initialize".
Even when i choose respawn the client gets stuck on that message.
I can hear water, move and shoot.
  • Offline LouD
  • Silent but deadly ;)
  • Moderator
  • Veteran
  • ******
  • Posts: 1415

Re: Error in globalCompile.sqf after adding commits.

« Reply #12 posted: Aug 28, 2014, 10:59 AM »
Ok so as I am still having the problem that my client is stuck on "please wait for your client to initialize" I have temporarily removed the following line from the init.sqf:
Code: [Select]
9999 cutText ["Welcome to A3Wasteland, please wait for your client to initialize", "BLACK", 0.01];
This actually makes me first spawn on the little spawn island and then i get moved to my previous location saved.
Only my UI/Hud doesn't get loaded now.
For some reason the black screen doesn't get removed with the new commits?
  • Offline LouD
  • Silent but deadly ;)
  • Moderator
  • Veteran
  • ******
  • Posts: 1415

Re: Error in globalCompile.sqf after adding commits.

« Reply #13 posted: Aug 28, 2014, 11:31 AM »
Ok so the problem seems to reside inside the client/init.sqf.
I tried reverting client/init.sqf back to before this commit: https://github.com/A3Wasteland/ArmA3_Wasteland.Altis/commit/5e10e90ed6729e15e8268de1c01696d680f5fede
That didn't work.
The i tried undoing the changes in client/init.sqf in this commit: https://github.com/A3Wasteland/ArmA3_Wasteland.Altis/commit/b77267cfe5f1e728828b67758d786a34db4a1f1e
Also no succes.
  • Offline LouD
  • Silent but deadly ;)
  • Moderator
  • Veteran
  • ******
  • Posts: 1415

Re: Error in globalCompile.sqf after adding commits.

« Reply #14 posted: Aug 28, 2014, 12:08 PM »
Ok so now i completely used the client/init.sqf from https://github.com/A3Wasteland/ArmA3_Wasteland.Altis/blob/5e10e90ed6729e15e8268de1c01696d680f5fede/client/init.sqf
and still i get no hud, but no player items are loaded either. My character doesn't get a map etc.
I can't open the admin panel with U etc.