Jump to content
Sign in to follow this  
JanMasterson

Reported error that can't be found

Recommended Posts

Hello modders,

here is an error message that is displayed since I swapped the default units with custom addon's units in a mission (an Evolution version featuring OFrP's units on the Uhao island).

It seems obvious but I, and the tools I used, can't pinpoint the error.

So maybe that a seasoned scripter could take a look at it and tell me where my error is?

The error as seen in the "arma.RPT" file:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Error in expression <leader _unit);

};

switch (_Vehicle) do

{

case "DC3":

   {

if (score _dunit < _rank2) then {_handle = [_dunit,_rank2] execVM "scripts\req.sqf";[_unit] call EVO_Eject};

if(_unit == player and _vec in list AirportIn) then {wcam = _vec addaction ["Taxi to runway", "actions\taxi.sqf",0,1, false, true,"test2"]};

   };

case "FFAA_EA_EF_CAT":

>

 Error position: <

case "DC3":

{};

case "FFAA_EA_EF_CAT":

>

 Error Missing }

File mpmissions\__cur_mp.uhao\scripts\VecInit.sqf, line 34

And now, the file itself:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_unit = _this select 0;

_vec = _this select 1;

_Vehicle = typeOf _vec;

_rank1 = rank1;

_rank2 = rank2;

_rank3 = rank3;

_rank4 = rank4;

_rank5 = rank5;

_rank6 = rank6;

_dunit = _unit;

_warning = 0;

if (not (local _unit)) exitwith {};

EVO_Eject =

{

_unit = _this select 0;

_unit action ["ENGINEOFF", vehicle _unit];

_unit action ["Eject",vehicle _unit];

sleep 1;

_unit action ["Eject",vehicle _unit];

};

if (getdammage _vec == 0) then

{

_vec setdammage 0.01;

};

if (not (isPlayer _unit)) then

{

_dunit = (leader _unit);

};

switch (_Vehicle) do

{

   case "DC3":

   {

if (score _dunit < _rank2) then {_handle = [_dunit,_rank2] execVM "scripts\req.sqf";[_unit] call EVO_Eject};

if(_unit == player and _vec in list AirportIn) then {wcam = _vec addaction ["Taxi to runway", "actions\taxi.sqf",0,1, false, true,"test2"]};

   };

   case "FFAA_EA_EF_CAT":

   {

if (score _dunit < _rank6) then {_handle = [_dunit,_rank6] execVM "scripts\req.sqf";[_unit] call EVO_Eject};

if(_unit == player) then {wcam = _vec addaction [localize "EVO_025", "actions\wepcam.sqf",0,1, false, true,"test2"]};

   };

   case "FFAA_FAMET_TIGRE":

   {

if (score _dunit < _rank6) then {_handle = [_dunit,_rank6] execVM "scripts\req.sqf";[_unit] call EVO_Eject};

if(_unit == player) then {wcam = _vec addaction [localize "EVO_025", "actions\wepcam.sqf",0,1, false, true,"test2"]};

   };

   case "FFAA_ET_Leopard2E":

   {

if (score _dunit < _rank5) then {_handle = [_dunit,_rank5] execVM "scripts\req.sqf";[_unit] call EVO_Eject};

   };

   case "IkaR_M2M_5b":

   {

if (score _dunit < _rank6) then {_handle = [_dunit,_rank6] execVM "scripts\req.sqf";[_unit] call EVO_Eject};

if(_unit == player) then {wcam = _vec addaction [localize "EVO_025", "actions\wepcam.sqf",0,1, false, true,"test2"]};

   };

   case "Stryker_TOW":

   {

if (score _dunit < _rank3) then {_handle = [_dunit,_rank3] execVM "scripts\req.sqf";[_unit] call EVO_Eject};

   };

   case "IkaR_M2M_Dbgl1":

   {

if (score _dunit < _rank5) then {_handle = [_dunit,_rank5] execVM "scripts\req.sqf";[_unit] call EVO_Eject};

if(_unit == player) then {wcam = _vec addaction [localize "EVO_025", "actions\wepcam.sqf",0,1, false, true,"test2"]};

   };

   case "FFAA_famet_BO105_FFUR":

   {

if (score _dunit < _rank5) then {_handle = [_dunit,_rank5] execVM "scripts\req.sqf";[_unit] call EVO_Eject};

   };    

   case "FFAA_FAMET_NH90_FFUR":

   {

if (score _dunit < _rank4) then {_handle = [_dunit,_rank4] execVM "scripts\req.sqf";[_unit] call EVO_Eject};

   };

   case "Vulcan":

   {

if (score _dunit < _rank4) then {_handle = [_dunit,_rank4] execVM "scripts\req.sqf";[_unit] call EVO_Eject};

   };    

   case "FFAA_FAMET_NH90_MG":

   {

if (score _dunit < _rank3) then {_handle = [_dunit,_rank3] execVM "scripts\req.sqf";[_unit] call EVO_Eject};

   };

   case "FFAA_ET_TOA":

   {

if (score _dunit < _rank3) then {_handle = [_dunit,_rank3] execVM "scripts\req.sqf";[_unit] call EVO_Eject};

   };

   case "FFAA_IM_PIRANHA_30":

   {

if (score _dunit < _rank4) then {_handle = [_dunit,_rank4] execVM "scripts\req.sqf";[_unit] call EVO_Eject};

   };    

   case "FFAA_IM_PIRANHA":

   {

if (score _dunit < _rank3) then {_handle = [_dunit,_rank3] execVM "scripts\req.sqf";[_unit] call EVO_Eject};

   };

   case "FFAA_famet_BO105:

   {

if (score _dunit < _rank2) then {_handle = [_dunit,_rank2] execVM "scripts\req.sqf";[_unit] call EVO_Eject};

   };

   case "FFAA_ET_Vamtac_TOW":

   {

if (score _dunit < _rank2) then {_handle = [_dunit,_rank2] execVM "scripts\req.sqf";[_unit] call EVO_Eject};

   };

   case "FFAA_IM_M1043OE":

   {

if (score _dunit < _rank1) then {_handle = [_dunit,_rank1] execVM "scripts\req.sqf";[_unit] call EVO_Eject};

   };

   case "FFAA_ET_Vamtac_LAG40":

   {

if (score _dunit < _rank2) then {_handle = [_dunit,_rank2] execVM "scripts\req.sqf";[_unit] call EVO_Eject};

   };    

   case "FFAA_ET_Vamtac_M2":

   {

if (score _dunit < _rank1) then {_handle = [_dunit,_rank1] execVM "scripts\req.sqf";[_unit] call EVO_Eject};

   };    

   case "ZSU":

   {

if (score _dunit < _rank4) then {_handle = [_dunit,_rank4] execVM "scripts\req.sqf";[_unit] call EVO_Eject};

   };  

   case "BMP2":

   {

if (score _dunit < _rank4) then {_handle = [_dunit,_rank4] execVM "scripts\req.sqf";[_unit] call EVO_Eject};

   };  

   case "BRDM2":

   {

if (score _dunit < _rank3) then {_handle = [_dunit,_rank3] execVM "scripts\req.sqf";[_unit] call EVO_Eject};

   };

   case "BRDM2_ATGM":

   {

if (score _dunit < _rank3) then {_handle = [_dunit,_rank3] execVM "scripts\req.sqf";[_unit] call EVO_Eject};

   };

   case "T72":

   {

if (score _dunit < _rank5) then {_handle = [_dunit,_rank5] execVM "scripts\req.sqf";[_unit] call EVO_Eject};

   };

   case "UAZMG":

   {

if (score _dunit < _rank1) then {_handle = [_dunit,_rank1] execVM "scripts\req.sqf";[_unit] call EVO_Eject};

   };

   case "UAZ_AGS30":

   {

if (score _dunit < _rank2) then {_handle = [_dunit,_rank2] execVM "scripts\req.sqf";[_unit] call EVO_Eject};

   };    

   case "Su34":

   {

if (score _dunit < _rank5) then {_handle = [_dunit,_rank5] execVM "scripts\req.sqf";[_unit] call EVO_Eject};

if(_unit == player) then {wcam = _vec addaction [localize "EVO_025", "actions\wepcam.sqf",0,1, false, true,"test2"]};

   };

   case "Su34B":

   {

if (score _dunit < _rank6) then {_handle = [_dunit,_rank6] execVM "scripts\req.sqf";[_unit] call EVO_Eject};

if(_unit == player) then {wcam = _vec addaction [localize "EVO_025", "actions\wepcam.sqf",0,1, false, true,"test2"]};

   };    

   case "KA50":

   {

if (score _dunit < _rank6) then {_handle = [_dunit,_rank6] execVM "scripts\req.sqf";[_unit] call EVO_Eject};

if(_unit == player) then {wcam = _vec addaction [localize "EVO_025", "actions\wepcam.sqf",0,1, false, true,"test2"]};

   };

   case "Mi17":

   {

if (score _dunit < _rank4) then {_handle = [_dunit,_rank4] execVM "scripts\req.sqf";[_unit] call EVO_Eject};

   };

   case "Mi17_MG":

   {

if (score _dunit < _rank3) then {_handle = [_dunit,_rank3] execVM "scripts\req.sqf";[_unit] call EVO_Eject};

   };

   case "BMP2Ambul":

   {

if (score _dunit < 1000) then {_handle = [_dunit,_rank3] execVM "scripts\req.sqf";[_unit] call EVO_Eject};

   };

   case "Truck5tRepair":

   {

    if (player isKindOf "OFrP_Inf_GENIEchg") then

    {    

    if(not (isNull ltrk)) then

    {

    ltrk removeaction elock;

    ltrk lock false;

    };

    if(ltrk != _vec) then {elock = _vec addaction ["Lock Truck", "actions\englock.sqf",0,1, false, true,"test2"];ltrk = _vec};

    };

   };

   case "UralRepair":

   {

    if (player isKindOf "OFrP_Inf_GENIEchg") then

    {

    if(not (isNull ltrk)) then

    {

    ltrk removeaction elock;

    ltrk lock false;

    };

    if(ltrk != _vec) then {elock = _vec addaction ["Lock Truck", "actions\englock.sqf",0,1, false, true,"test2"];ltrk = _vec};

    };

    };

};

if(_unit != player) exitWith {};

if(_vec isKindOf "Air") then

{

if(_Vehicle == "IkaR_M2M_5b") then

{

_fireb = _vec addEventHandler["Fired",{if ((_this select 2) == "BombLauncher") then {trkbmb = [(_this select 0)] execVM "scripts\Trkbmb.sqf"}}];

};

/*

_hit = player addEventHandler ["hit",

{

_rnd = round(random 2);

switch (_rnd) do

{

case 0:

{

driver (_this select 0) say "Hit1";

hint "hit1";

};

case 1:

{

driver (_this select 0) say "Hit2";

hint "hit2";

};

case 2:

{

driver (_this select 0) say "Hit1";

hint "hit3";

};

};

}];

if(_hit > 0) then {_vec removeEventHandler ["hit", _hit]};

*/

setViewDistance avdist;

};

_getin = _vec addEventHandler ["GetIn", {handle = [(_this select 0),(_this select 1)] execVM call EVO_Boarding}];

if(_getin > 1) then {_vec removeEventHandler ["GetIn", _getin];};

Waituntil {player != driver _vec};

_vec removeaction wcam;

_vec removealleventhandlers "Fired";

setViewDistance vdist;

With EditPadPro, I checked all bracket I seen and didn't found any missing one so it's maybe something else but the "else" is beyond my actual abilities.

Share this post


Link to post
Share on other sites

As you use EPP, I tried to help you. biggrin_o.gif

However I wasn't able to spot the problem as well.

My suggestion would be to comment everything inside the switch

statement and readd once case statement after another.

Or comment the whole switch-case system as a start.

Maybe the error is found elsewhere.

First try to find the area the error is from.

Share this post


Link to post
Share on other sites

case "FFAA_famet_BO105:

should be case "FFAA_famet_BO105":

might fix it.

Share this post


Link to post
Share on other sites

Well spotted Squ33z3, I was focused on the brackets  banghead.gif

Gonna try it ASAP.

Q, thanks for taking the time to try wink_o.gif

EDIT: That's it! Thank you very much Squ33z3, you saved my week! notworthy.gif

You do have a tool, other than your "Brain 3.0", to check the apostrophes?

Greets

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  

×