Jump to content
Sign in to follow this  
Luft08

Error in expression but expression is a comment??

Recommended Posts

I'm debugging a mission. In the RPT file there is the following:

20:04:15 Error in expression <// Choose random city record>

 

The "offending code" is in a method called "spawnScienceGroup".

spawnScienceGroup.sqf:

if(!isServer) exitWith {};

scientist = objnull;

scientistDead = compileFinal preprocessfilelinenumbers (missionPath + "scientistDead.sqf");
checkForWin = compileFinal preprocessfilelinenumbers (missionPath + "checkForWin.sqf");
giveUnitsPistols = compileFinal preprocessfilelinenumbers ("scripts\common\giveUnitsPistols.sqf");
policeKnowsAbout = compileFinal preprocessfilelinenumbers (missionPath + "policeKnowsAbout.sqf");

[] execVM "scripts\common\eastGermanyGroundDefences.sqf";
[] execVM "scripts\common\eastGermanyAirDefences.sqf";

private _handle = [] execVM "scripts\common\addAirAssets_1.sqf";
waitUntil {scriptDone _handle};

private _bldgList = [];

// Choose random city record
targetCityRecord = selectRandom eastCityAreaArray; // [cityName:string, center:pos, radius:number]

// Choose building
private _pos = targetCityRecord select 1;
private _radius = (targetCityRecord select 2) / 2;

_bldgList = [_pos, _radius] call getHouseList; 

// Place victom
 _handle = [_bldgList] execVM (missionPath + "spawnScienceGroup.sqf");
 waitUntil {scriptDone _handle};

// Create task
[true, ["tskAssassination"], ["Assassinate the Scientist", "Assassination", "assassinationMarker"], scientist, "ASSIGNED", 1, true, "kill", true] call BIS_fnc_taskCreate;

["itemAdd", ["scientistDeadID", { [] call scientistDead; }, 1]] call BIS_fnc_loop;
["itemAdd", ["patrolKnowsAboutID", { [activeFootGroupArray] spawn patrolKnowsAbout; }, 2]] call BIS_fnc_loop;
["itemAdd", ["vehiclePatrolKnowsAboutID", { [activeVehicleGroupArray] spawn vehiclePatrolKnowsAbout; }, 2]] call BIS_fnc_loop;

I have no clue why I'm getting this error or how to trace the real problem down.

Share this post


Link to post
Share on other sites

Are you sure that eastCityAreaArray has been defined and is available before this script runs?

  • Like 1

Share this post


Link to post
Share on other sites
23 minutes ago, Harzach said:

Are you sure that eastCityAreaArray has been defined and is available before this script runs?

Yes, unless there is some weird scope issue. My initServer.sqf executes \scripts\common\initVariables.sqf which is where that array lives.

initServer.sqf:

if(!isServer) exitWith {};

setDate [1983, 6, 24, 13, 35];

private _handle = [] execVM "scripts\common\constants.sqf";
waitUntil { scriptDone _handle};

_handle = [] execVM "scripts\common\compileMethods.sqf";
waitUntil {scriptDone _handle};

_handle = [] execVM "scripts\common\initVariables.sqf"; // <<<-----------------------
waitUntil {scriptDone _handle};

_handle = [] execVM "scripts\initVariables.sqf";
waitUntil {scriptDone _handle};

_handle = [] execVM "LFT_ParkedCarManager\initParkedCarManager.sqf";
waitUntil {scriptDone _handle};

_handle = [] execVM "LFT_AmbientPatrols\initAmbientPatrols.sqf";
waitUntil {scriptDone _handle};

_handle = [] execVM "LFT_VehicleManagement\initVehicleManagement.sqf";
waitUntil {scriptDone _handle};

_handle = [] execVM "LFT_BuildingManagement\initBuildingManagement.sqf";
waitUntil {scriptDone _handle};

_handle = [] execVM "LFT_Weather\initWeather.sqf";
waitUntil {scriptDone _handle};

overCastValue = [] call genWeather;
86400 setOvercast overCastValue;
forceWeatherChange;
publicVariable "overCastValue";

_handle = [] execVM "scripts\pickMission.sqf";
waitUntil {scriptDone _handle};

_handle = [] exec (missionPath + "runMission.sqf");
//waitUntil {scriptDone _handle};

serverReady = true;
publicVariable "serverReady";

_handle = [] execVM (missionPath + "giveBriefing.sqf");
waitUntil {scriptDone _handle};

\scripts\common\initVariables.sqf:

if(!isServer) exitWith {};
//#include "scripts\common\defines.hpp"

eastVehicleArrays = []; // [[vehicleArray:Array, activityArray:Array],...] - used to register opfor vehicles.

[] call getSatReliability;

bluforBasePoly = [
	[10367.6,7325.03,0], [10409.1,7325.03,0], [10409.1,7305.14,0], [10503.5,7305.14,0],
	[10503.5,7169.95,0], [10367.6,7170.51,0]
];

eastCityAreaArray = [
	// [cityName:string, center:pos, radius:number]
	["Bartensleben",[18406.6,278.48], 250],
	["Beendorf",[15330.5,488.795], 400],
	["Behnsdorf",[19644,8443.07], 500],
	["Belsdorf",[19511.4,11319], 500],
	["Bosdorf",[14322.1,19653.8], 700],
	["Dohren",[10751.9,11344], 350],
	["Eickendorf",[19007.3,14235.1], 500],
	["Eschenrode",[17110.3,5041.21], 400],
	["Everingen",[15749,14234.3], 350],
	["Gehrendorf",[11256,17729.4], 450],
	["Gross Bartensleben",[16592.1,390.986], 250],
	["Hodingen",[16313.6,7187.1], 400],
	["Horsingen",[19804,4509.46], 600],
	["Kathendorf",[18344.7,17522.3], 500],
	["Klinze",[17641.9,12098.3], 350],
	["Lockstedt",[13776.5,16150.1], 350],
	["Ratzlingen",[16935.9,17960.7], 600],
	["Ribbensdorf",[16452.7,9704.5], 350],
	["Ribbenstedt", [15536.1,8802.84], 350],
	["Schwanefeld",[15477.9,2871.97], 400],
	["Seggerde",[14697.9,11969.4], 250],
	["Walbeck",[13743.7,4516.42], 600],
	["Weferlingen", [13104.4,8191.4], 1000]
];
<snip>

It's almost like there is some kind of weird file corruption going on.

Share this post


Link to post
Share on other sites

How is spawnScienceGroup.sqf being executed? If it's unscheduled, the waitUntil on lines 14 and 29 would throw the error "generic error in expression."

 

You might want to share a .rpt file.

  • Like 1

Share this post


Link to post
Share on other sites
3 hours ago, Harzach said:

How is spawnScienceGroup.sqf being executed? If it's unscheduled, the waitUntil on lines 14 and 29 would throw the error "generic error in expression."

 

You might want to share a .rpt file.

The spawnScienceGroup.sqf is being started via execVM from the (missionPath + "runMission.sqf") file:

if(!isServer) exitWith {};

scientist = objnull;

scientistDead = compileFinal preprocessfilelinenumbers (missionPath + "scientistDead.sqf");
checkForWin = compileFinal preprocessfilelinenumbers (missionPath + "checkForWin.sqf");
giveUnitsPistols = compileFinal preprocessfilelinenumbers ("scripts\common\giveUnitsPistols.sqf");
policeKnowsAbout = compileFinal preprocessfilelinenumbers (missionPath + "policeKnowsAbout.sqf");

[] execVM "scripts\common\eastGermanyGroundDefences.sqf";
[] execVM "scripts\common\eastGermanyAirDefences.sqf";

private _handle = [] execVM "scripts\common\addAirAssets_1.sqf";
waitUntil {scriptDone _handle};

private _bldgList = [];

// Choose random city record
targetCityRecord = selectRandom eastCityAreaArray; // [cityName:string, center:pos, radius:number]

// Choose building
private _pos = targetCityRecord select 1;
private _radius = (targetCityRecord select 2) / 2;

_bldgList = [_pos, _radius] call getHouseList; 

// Place victom
 _handle = [_bldgList] execVM (missionPath + "spawnScienceGroup.sqf"); // <<<---------------------------
 waitUntil {scriptDone _handle};

// Create task
[true, ["tskAssassination"], ["Assassinate the Scientist", "Assassination", "assassinationMarker"], scientist, "ASSIGNED", 1, true, "kill", true] call BIS_fnc_taskCreate;

["itemAdd", ["scientistDeadID", { [] call scientistDead; }, 1]] call BIS_fnc_loop;
["itemAdd", ["patrolKnowsAboutID", { [activeFootGroupArray] spawn patrolKnowsAbout; }, 2]] call BIS_fnc_loop;
["itemAdd", ["vehiclePatrolKnowsAboutID", { [activeVehicleGroupArray] spawn vehiclePatrolKnowsAbout; }, 2]] call BIS_fnc_loop;

I deleted the log files and started the mission fresh. It produced two files: mpStatistics_7736.log and Arma3_x64_2021-10-26_10-05-50.rpt

mpStatistics_7736.log:

AddInitAndRemoveOverridden  statistics ... total messages = 899
55 ... Type_10
186 ... Type_53
21 ... Type_54
7 ... Type_58
4 ... Type_59
75 ... Type_63
5 ... Type_64
19 ... Type_69
5 ... Type_269
5 ... Type_270
24 ... Type_288
4 ... Type_325
4 ... Type_326
4 ... Type_327
4 ... Type_328
406 ... Type_356
39 ... Type_360
1 ... Type_362
4 ... Type_380
27 ... Type_386


AddInitAndRemoveOverridden remoteExec statistics ... total messages = 2
2 ... Type_375

Arma3_x64_2021-10-26_10-05-50.rpt:

10:09:04 [CBA] (settings) INFO: Checking mission settings file ...
10:09:04 Client: Nonnetwork object 2053e940.
10:09:04 Client: Nonnetwork object e66f200.
10:09:04 Client: Nonnetwork object bac3da60.
10:09:04 Client: Nonnetwork object bac3dde0.
10:09:04 Client: Nonnetwork object bcc2fe40.
10:09:04 Client: Nonnetwork object 82bb040.
10:09:04 Client: Nonnetwork object 3ec5d520.
10:09:04 EPE manager release (0|9|0)
10:09:04 [CBA] (xeh) INFO: missionNamespace processed [false]
10:09:09 Starting mission:
10:09:09  Mission file: BlackOPs
10:09:09  Mission world: gm_weferlingen_summer
10:09:09  Mission directory: C:\Users\edamr\Documents\Arma 3\mpmissions\BlackOPs.gm_weferlingen_summer\
10:09:10 [CBA] (xeh) INFO: [20838,200.864,0] PreInit started. v3.15.6.211004
10:09:10 [CBA] (settings) INFO: Reading settings from settings file.
10:09:10 [CBA] (settings) INFO: Finished reading settings from settings file.
10:09:10 [CBA] (xeh) INFO: [20838,200.95,0] PreInit finished.
10:09:10 damagehide - unknown animation source damage
10:09:10 damagehide - unknown animation source damage
10:09:11 c:\bis\source\stable\futura\lib\network\networkserver.cpp NetworkServer::OnClientStateChanged:NOT IMPLEMENTED - briefing!
10:09:11 [CBA] (xeh) INFO: [20839,201.606,0] PostInit started. MISSIONINIT: missionName=BlackOPs, missionVersion=54, worldName=gm_weferlingen_summer, isMultiplayer=true, isServer=true, isDedicated=false, CBA_isHeadlessClient=false, hasInterface=true, didJIP=false
10:09:11 [CBA] (versioning) INFO: [20839,201.608,0] VERSIONING:cba=3.15.6.211004
10:09:11 [CBA] (xeh) INFO: [20839,201.608,0] PostInit finished.
10:09:12 Unknown task state: 
10:09:12 Unknown task state: 
10:09:12 Unknown task state: 
10:09:12 Attempt to override final function - deleteallwaypoints
10:09:12 Weather was forced to change
10:09:13 Error in expression <// Choose random city record>
10:09:13   Error position: <// Choose random city record>
10:09:13   Error Invalid number in expression
10:09:13 Error in expression <ecord = selectRandom eastCityAreaArray; // [cityName:string, center:pos, radius:>
10:09:13   Error position: <// [cityName:string, center:pos, radius:>
10:09:13   Error Invalid number in expression
10:09:13 Error in expression <// Choose building>
10:09:13   Error position: <// Choose building>
10:09:13   Error Invalid number in expression
10:09:13 Error in expression <// Place victom>
10:09:13   Error position: <// Place victom>
10:09:13   Error Invalid number in expression
10:09:13 Error in expression <// Create task>
10:09:13   Error position: <// Create task>
10:09:13   Error Invalid number in expression
10:09:13 Suspending not allowed in this context
10:09:13 Error in expression <waitUntil {scriptDone _handle};>
10:09:13   Error position: <scriptDone _handle};>
10:09:13   Error Generic error in expression
10:09:13 Suspending not allowed in this context
10:09:13 Error in expression <waitUntil {scriptDone _handle};>
10:09:13   Error position: <scriptDone _handle};>
10:09:13   Error Generic error in expression
10:09:19 Weather was forced to change
10:09:32 EPE manager release (34|84|0)
10:09:32 Number of actors in scene after release: 34
10:09:32 EPE manager release (0|34|0)
10:09:34 damagehide - unknown animation source damage
10:09:34 damagehide - unknown animation source damage
10:09:34 damagehide - unknown animation source damage
10:09:34 damagehide - unknown animation source damage
10:09:34 soldier[gm_ge_army_machinegunner_mg3_80_ols]:Some of magazines weren't stored in soldier Vest or Uniform?
10:09:35 [CBA] (xeh) INFO: missionNamespace processed [false]
10:09:35 [CBA] (xeh) INFO: [21915,224.968,0] PreInit started. v3.15.6.211004
10:09:35 [CBA] (settings) INFO: Reading settings from settings file.
10:09:35 [CBA] (settings) INFO: Finished reading settings from settings file.
10:09:35 [CBA] (xeh) INFO: [21915,225.049,0] PreInit finished.

 

Share this post


Link to post
Share on other sites
2 hours ago, Luft08 said:

The spawnScienceGroup.sqf is being started via execVM from the (missionPath + "runMission.sqf") file:

 

OK. Keep in mind that I am not a scripting genius or anything approaching such. The only thing that jumps out at me is that you are exec'ing (missionPath + "runMission.sqf") which, according to the Biki (sort of, it could be interpreted a couple of ways) will execute your script as SQS. You are then execVM'ing spawnScienceGroup.sqf from there, which again according to the Biki means it is running unscheduled (SQF run from SQS).

 

Try changing your initServer entry:

_handle = [] exec (missionPath + "runMission.sqf");

to

_handle = [] execVM (missionPath + "runMission.sqf");

I just jumbled together a mission file that would test this assertion and it did not fail, so I may be completely wrong. 

I don't see any corrupted characters in your pasted code, so it's probably not that.

 

Hoping someone smarter than me will chime in.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

OMG! Thank you Harzach, an extra set of eyeballs really helps.  I didn't realize that I exec rather than execVM.

 

I'll see if changing it helps.  Thanks again!

 

Yes! that was the problem! I looked and looked and looked but didn't notice that! 🤪

  • Like 2

Share this post


Link to post
Share on other sites

Great! I was a bit skeptical due to my interpretation of the exec Biki entry, but I'm glad your problem is solved.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×