Dear forum users! In compliance with the new European GDPR regulations, we'd just like to inform you that if you have an account, your email address is stored in our database. We do not share your information with third parties, and your email address and password are encrypted for security reasons.

New to the forum? Say hello in this topic! Also make sure to read the rules.

Providing a more precise target of where the script crashed

Give us your input on how we may improve the ScriptAPI in the game in future versions.
Forum rules
By using the forum you agree to the following rules.
Post Reply
User avatar
JakSparro98
Superfighter
Superfighter
Posts: 530
Joined: Fri Jul 15, 2016 7:56 pm
Started SFD: PreAlpha 1.0.5
Location: Rome, Italy
Gender:
Age: 25

Providing a more precise target of where the script crashed

Post by JakSparro98 » Sat Dec 22, 2018 9:03 pm

Today's situation is if some scripts crashes you are aware only of the stack trace, without the line were the crash occurred.

The exception thrown by the script engine should be handled by specifying the line of code that failed, I probably guess that a reason why that is already implemented is because the code changes morphology when the temp file is created to handle the script so the line error will result in a wrong line catch because of various file optimizations, I will suggest at least specifying the last tried action before crashing in case the other way isn't feasible,e.g.

Code: Select all

void KillPlayer()
{
IPlayer plr=null;
plr.Kill();
count++;
}
The exception should show that the script crashed on IPlayer.Kill() at the function KillPlayer()

Another thing could be showing the last completed actions before the crash, in this case IPlayer a=null;

EDIT:
I want to specify that this suggestion is referring to visualizing a more detailed script crash error for the normal user that need to report the issue when he finds one, I'm not referring to better developer debugging techniques.
2 x

User avatar
Sree
Superfighter
Superfighter
Posts: 325
Joined: Sun May 08, 2016 8:19 pm
SFD Account: phasmic
SFD Alias: sree
Gender:
Age: 23

Post by Sree » Sun Dec 23, 2018 8:05 am

You could use visual studio debugger for this

here's how the example in your thread would look like in debugger
Image
0 x

User avatar
JakSparro98
Superfighter
Superfighter
Posts: 530
Joined: Fri Jul 15, 2016 7:56 pm
Started SFD: PreAlpha 1.0.5
Location: Rome, Italy
Gender:
Age: 25

Post by JakSparro98 » Sun Dec 23, 2018 3:08 pm

Sree wrote:
Sun Dec 23, 2018 8:05 am
You could use visual studio debugger for this

here's how the example in your thread would look like in debugger
Image
I can assume that it was a way too simple example where every compiler will tell you that the variable is not initialized, what I'm trying to say is that if the error occurs at runtime, because of some logic mistakes, where the map/script is shared on Steam, an user won't be able to report you an effective error message rather than what method failed.
0 x

User avatar
Sree
Superfighter
Superfighter
Posts: 325
Joined: Sun May 08, 2016 8:19 pm
SFD Account: phasmic
SFD Alias: sree
Gender:
Age: 23

Post by Sree » Sun Dec 23, 2018 4:01 pm

JakSparro98 wrote:
Sun Dec 23, 2018 3:08 pm
I can assume that it was a way too simple example where every compiler will tell you that the variable is not initialized, what I'm trying to say is that if the error occurs at runtime, because of some logic mistakes, where the map/script is shared on Steam, an user won't be able to report you an effective error message rather than what method failed.
that screenshot wasn't an error displayed by the compiler, it was the visual studio's debugger in action which showed the exception raised and the source of it, also this was recorded during run-time because a logical error.. so don't get what you are trying to say.

if what you are trying to propose is for the script users to be notified where and why an exception was raised, then you should specify that in the thread.
0 x

User avatar
JakSparro98
Superfighter
Superfighter
Posts: 530
Joined: Fri Jul 15, 2016 7:56 pm
Started SFD: PreAlpha 1.0.5
Location: Rome, Italy
Gender:
Age: 25

Post by JakSparro98 » Sun Dec 23, 2018 4:18 pm

Sree wrote:
Sun Dec 23, 2018 4:01 pm
that screenshot wasn't an error displayed by the compiler, it was the visual studio's debugger in action which showed the exception raised and the source of it [..]
I see, I thought it was an exception warning like java does.
Sree wrote:
Sun Dec 23, 2018 4:01 pm
if what you are trying to propose is for the script users to be notified where and why an exception was raised, then you should specify that in the thread.
Yeah, even because this thread explains that you can attach VS and that is made for debugging the code when something happen on the developer's view, but when something is occurring when a user is playing is another story, and this latter is what I want to enhance.
2 x

Post Reply