Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: FUBAR-BDHR on November 21, 2008, 12:39:31 am
-
I've hit this a couple of times while doing some mission debugging. Using a message to display variable data in an every-time event quickly overloads the message queue resulting in an int(3). Is this something that could be replaced with a warning? Currently it's at line 2038 in mission\missionmessage.cpp.
-
Well using it in an every-time event means that you add a lot of messages per second. No wonder it's getting overloaded. Although we could no doubt remove the Int3() I do wonder what you are actually doing that requires so many messages. It should only Int3() if you have more than 30 messages in the queue.
-
Debugging. The last time I had an every-time loop tossing out sets of random numbers and I was displaying those numbers to the screen. Basically how I tracked down that problem with rand-multiple. It does only seem to actually hit the int(3) in debug mode. Running the regular build just skips messages but then you don't get the fs2_open.log.
-
Int3(), like Assert() only ever do anything in debug mode.
Int3() is basically a programmer saying "If we get to this point in the code, something is wrong." While Assert is the programmer saying "If this isn't true, something is wrong." In some of those cases what is wrong is minor enough that a release build can survive the error so the release build shouldn't say anything. A debug build however should be alerting the coder that something is wrong. Hence the Int3().
-
OK I understand that part but there are a lot of times that when an int3() or assert occurs the game crashes in a regular build. This isn't one of those. So the question is it serious enough to warrant an int3() instead of just a warning that allows you to continue?
-
Well if you can get it as the result of a normal mission it probably doesn't warrant an Int3(). Having it print a message to the debug log would probably be enough.
-
Saw the change in the revision history. Thanks. :yes:
Should make testing looping events with random variables a lot easier.
-
Yeah. I forgot to mention I changed it. :D