Jump to content
Sign in to follow this  
Murcielago_ESP

Show Script Errors system (-showScriptErrors) does not work properly.

Recommended Posts

Hi all!

Looks like that the issue have been already reported on dev-heaven.net. I think this is a pretty important issue as people trust the Show Script Errors system when people does code for Arma 2. I did not realize how important this issue is since I posted a comment on the BIS forums talking about my last creation (Real Damage for Arma 2) Writing this comment I realize that the "-showScriptErrors" glitch can be the cause of the HEAVY performance issue of some multiplayer missions. I let you know that I have some experience with the Arma engine right now (More than 2640h of experience only in Arma 2) and after all this time I learn many tricks to make my life easy when I create missions/codes. Thanks to this experience I noticed that when a mission has errors the mission performance is fine at the beginning and after some time (Code usage) there is a big drop in performance (That behaviour happens in many Warfare missions) Non detected errors will be not prompted and the script will not be executed and may be it would create "collateral errors". I do not why but this is always like this, for this reason when I do missions I do stability tests and code flow checks.

Stability test:

My stability test is a simple stress test (I run the mission making sure that all the code have been used several times) and after some time I check the mission performance with Fraps. If the mission performance is similar to the one at the start of the mission I share the mission with you guys.

Code flow check:

This is a test that tracks the code flow to confirm that the code does exactly what I expect. That test not only checks for errors in addition it can reduce the "hidden work" of your code (Things that your code does and can be improved/removed) I use the GlobalChat command to create marks inside the code and then when the code runs I check the marks to know what the code really does (Like a break point in VisualBasic)

Example of not captured error (HandleDamage in Real Damage system - SQF script):

If (Alive(_This Select 0)) Then

{

_Unit = _This Select 0;

_Part = _This Select 1;

_Damage = _This Select 2;

If (Damage _Unit == 0) Then {_Unit SetDamage 0.1; Null = [_Unit] ExecVM "Real_Damage\Bleading.sqf";};

If (Vehicle _Unit == _Unit) Then

{

// TORSO

If (_Part in ["body"]) Then

{

// WOUND: MINOR

If (_Damage > 0.1+(Damage _Unit)) Then

{

_Unit SetDamage ((Damage _Unit)+0.075);

Player Globalchat FORMAT ["TORSO (MINOR): %1 | DU: %2",_Damage,Damage _Unit];

};

// WOUND: CRITICAL

If (_Damage > 0.3) Then

{

If ((_This Select 4) == "B_12Gauge_Pellets") Then

{

_Unit SetDamage ((Damage _Unit)+0.2);

Player Globalchat FORMAT ["TORSO (CRITICAL): %1 | DU: %2",_Damage,Damage _Unit];

}

Else

{

If ((_Damage < 0.6) And ((_This Select 0) Distance (_This Select 3) < 50)) Then {_Unit SetDamage ((Damage _Unit)+(_Damage*1.45));} Else {_Unit SetDamage ((Damage _Unit)+0.2);};

Sleep 0.1;

"logic" CreateUnit [Position _Unit, Logic_Team, "This AttachTo [_Unit,[0,0,0]];", 1.0, "MAJOR"];

_Unit SetHit ["legs",1];

Player Globalchat FORMAT ["TORSO (CRITICAL): %1 | DU: %2",_Damage,Damage _Unit];

};

};

};

}

Else

{

_Unit SetDamage ((Damage _Unit)+0.1);

};

}; // <- REMOVING THE "};" NO ERROR MESSAGE WILL BE SHOWN AND THE SCRIPT WILL NOT BE EXECUTED

If (IsPlayer (_This Select 0)) Then {TitleText ["","WHITE IN",0];};

Sleep 0.2;

If (Count (NearestObjects [Position (_This Select 0),["logic"],0.3]) > 0) Then {(_This Select 0) SetHit ["legs",1];};

If you removed "};" from the main IF the error will not be shown, the script will not run and no chat messages will be shown.

I experienced some times this glitch and I guess that may be I experienced it in another different situation than a bracket.

Please guys be aware of errors and missions performance, they kill our game.

Thanks for your time.

Murcielago (mgllgm@hotmail.com)

Share this post


Link to post
Share on other sites

To everyone who does scripts,

Be aware that the capture error system (-ShowScrptsErrors) has some weak points. It will not show an error if you forgot a closing bracket and in addition if you use "BreakOut" or "BreakTo" commands to jump forwards the code will stop and no message will be shown.

I already reported to ARMA2 Community Issue Tracker (Bug #70299)

Hi,

Like I said before I saw the capture error system failing with something different than the bracket issue. Here there is an example where the system does not show anything when an error happens.

I was studying the "BreakOut" command to understand its "real" behaviour and what I can do with it and I find out that if you it to jump to a scope ahead of its position the code will stop working and no error message is shown.

I only want to make our game better and show that there is a critical weak point. This capture error system bug can be behind the performance issue that makes some missions unplayable affecting to how people perceive what Arma is and it can decrease players population... Check how many people came back to Arma after the last big patch that improved the game performance...

Code example:

LoopV = "";

Player GlobalChat "IN";

scopeName "main";

Player GlobalChat "MAIN LOOP";

while {true} do {

scopeName "loop1";

Player GlobalChat "LOOP1 - EXTERNAL";

while {true} do {

scopeName "loop2";

Player GlobalChat "LOOP2 - INTERNAL";

if (LoopV == "main") then {breakTo "main"; LoopV = "";}; // Breaks all scopes and return to "main"

if (LoopV == "loop1") then {breakOut "loop1"; LoopV = "";}; // Breaks scope named "loop1"

if (LoopV == "loop2") then {breakOut "loop2"; LoopV = "";}; // Breaks scope named "loop2"

if (LoopV == "jump") then {breakOut "jump"; LoopV = "";}; // Breaks scope named "jump"

sleep 1;

};

sleep 1;

};

scopeName "jump";

Player CommandChat "OUT";

I used triggers to activate the script and change the LooV variable value. If you change the LoopV to "jump" the code will stop and no error message will be shown.

Share this post


Link to post
Share on other sites

I already reported to ARMA2 Community Issue Tracker (Bug #70299)

Another case where the system does not capture an error is when you use the "In Array" command and you make an error forgetting double quotes. There is no message error and the sqf script does not run any more.

Example:

_Pos = animationState _Unit;

If (_Pos In ["amovppnemstpsraswrfldnon", amovppnemstpsraswpstdnon", "amovppnemstpsraswlnrdnon"]) Then {_Unit SetUnitPos "DOWN";};

// 2nd element is missing double quotes -> no error and sqf script does not run any more.

Share this post


Link to post
Share on other sites

It's hard for arma to detect those types of things, if you've ever noticed if you use an opening curly bracket for a function without closing it, it seems to go on forever and the function never really gets "defined" because there is no end. Very similar to a "RunAway" comment.

Share this post


Link to post
Share on other sites

On the other hand, sbsMac's Squint does a very good job of detecting most errors and can fix virtually all it finds with just the click of a button. There's no reason to ever run a script that has missing brackets or semicolons, etc.

For a scripting clodpate like me it's essential :)

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  

×