PDA

View Full Version : Error messages in log.txt file



FAE_Cazador
Apr-03-2013, 04:48
Hi, I have just started to log the events of the missions I fly in a file named log.txt. This is setup in the conf.ini, and is something similar to the coop.txt in good old IL-2 (unfortunatelly not so comprehensive as coop.txt).

However, when look at the log file, I find literally hundredths of lines showing the same error message, several times every second

[19:38:40] =================================================
[19:38:40] System.NullReferenceException: Object reference not set to an instance of an object.
[19:38:40] at s5QdK76qtaLAs.5RHy88LiHZv.AVzUpYmGw7DUFE()
[19:38:40] =================================================

This makes the log file completely unreadable,the file becoming >60 MB in a few minutes of flight.

What is this message about? I do not have any crash or problem when flying. And it is happening off and online. I cannot say if this was existing before the TF Mod patch as I have noticed it after having applied it.

Thanks in advance for your help

Salmo
Apr-03-2013, 05:29
Hi, I have just started to log the events of the missions I fly in a file named log.txt. This is setup in the conf.ini, and is something similar to the coop.txt in good old IL-2 (unfortunatelly not so comprehensive as coop.txt).

However, when look at the log file, I find literally hundredths of lines showing the same error message, several times every second

[19:38:40] =================================================
[19:38:40] System.NullReferenceException: Object reference not set to an instance of an object.
[19:38:40] at s5QdK76qtaLAs.5RHy88LiHZv.AVzUpYmGw7DUFE()
[19:38:40] =================================================

This makes the log file completely unreadable,the file becoming >60 MB in a few minutes of flight.

What is this message about? I do not have any crash or problem when flying. And it is happening off and online. I cannot say if this was existing before the TF Mod patch as I have noticed it after having applied it.

Thanks in advance for your help

Are you using any scripts with the mission? This is a common error that occurs with scripted & non-scripted battles. It occurs when the code tries to access an object that does not exist in the battle. For example, the code may be trying to cycle through all the ground objects for an army (say to see if they have been destroyed), but one army does not have any ground objects, so the code throws an error. It's really just poor programming & does not affect the battle at all. It's very annoying though if it's filling your game log.

The error can be overcome by enclosing custom script code in a try-catch statement like this:

try
{
custom script code goes here
}
catch (NullReferenceException n)
{}
catch (Exception e)
{
GamePlay.gpLogServer(null, "ERROR: ", new object[] { e.Message });
}

Salmo
Apr-03-2013, 05:36
Hi, I have just started to log the events of the missions I fly in a file named log.txt. This is setup in the conf.ini, and is something similar to the coop.txt in good old IL-2 (unfortunatelly not so comprehensive as coop.txt).

However, when look at the log file, I find literally hundredths of lines showing the same error message, several times every second

[19:38:40] =================================================
[19:38:40] System.NullReferenceException: Object reference not set to an instance of an object.
[19:38:40] at s5QdK76qtaLAs.5RHy88LiHZv.AVzUpYmGw7DUFE()
[19:38:40] =================================================

This makes the log file completely unreadable,the file becoming >60 MB in a few minutes of flight.

What is this message about? I do not have any crash or problem when flying. And it is happening off and online. I cannot say if this was existing before the TF Mod patch as I have noticed it after having applied it.

Thanks in advance for your help

Are you using any scripts with the mission? This is a common error that occurs with scripted & non-scripted battles. It occurs when the code tries to access an object that does not exist in the battle. For example, the code may be trying to cycle through all the ground objects for an army (say to see if they have been destroyed), but one army does not have any ground objects, so the code throws an error. It's really just poor programming & does not affect the battle at all. It's very annoying though if it's filling your game log.

The error can be overcome by enclosing custom script code in a try-catch statement like this:



try
{
custom script code goes here
}
catch (NullReferenceException n)
{
// do nothing
}
catch (Exception e)
{
GamePlay.gpLogServer(null, "ERROR: ", new object[] { e.Message });
}

FAE_Cazador
Apr-03-2013, 05:52
Thanks, Salmo, and yes, it is happening in scripted offline missions like in a Wick vs Dundas Campaign and, on line, at least in a island map server. I will keep a record wherever I fly to see exactgly where.

Should I have to add those lines of code in the .CS files of the scripted mission? I will try, but I am afraid of destroying the script file, as scripting is far beyond my programming skills (actually, apart from simple old BASIC language, not more than cut & paste) :)

It is very annoying because it makes logging events useless :(

By the way, perhaps a true (Coop.txt) log file recording the events of the flight would be a good add-on in a future patch, specially if COOP missions become available. I will report it in the BugTracker database for future reference.

Salmo
Apr-03-2013, 06:09
Should I have to add those lines of code in the .CS files of the scripted mission? I will try, but I am afraid of destroying the script file, as scripting is far beyond my programming skills (actually, apart from simple old BASIC language, not more than cut & paste)
Yes. But it will require some C# knowledge to get it right. If you PM me, I'll send you my email address. If you send me the script, I'd be pleased to see if I can tidy up some of the errors for you.


It is very annoying because it makes logging events useless
Agreed.


By the way, perhaps a true (Coop.txt) log file recording the events of the flight would be a good add-on in a future patch, specially if COOP missions become available. I will report it in the BugTracker database for future reference.
That's a good idea, event logging like in 1946 is on TF's to-do list.

FAE_Cazador
Apr-03-2013, 06:17
Thank you very much, Salmo, PM sent.