So, here's a thing: recent (~2018) versions of GM:S/GMS2 have a third way of throwing errors.
If you've ever taken a peek at YYC YYGML.h
, it's called YYError
there.
It is used for "low-level" actions (like +
or inst.vari
) and a random few built-in
functions (like vertex_begin
).
The deal with it is that its code goes like this (pseudocode):
global_flag_1 = true;
if (global_flag_2) {
// (skip to the end of the current script/event if not using YYC)
return;
}
var error_msg = ...;
if (!global_flag_2) {
show_error(error_msg, true); // (sort of)
exit(-1);
}
where exit
is stdlib.h exit -
it immediately and unconditionally causes the game process to quit.
Obviously, a minor inconvenience for queuing errors, as it queues the error but then
your game closes.
To make things better, there is no way of knowing that your error comes from such a
source, as the function is small enough to get optimized and not appear in low-level
call stack at all.
However, I've found that global_flag_2
is also referenced inside show_error
, thus
was able to add a pair of functions to flip it back and forth, which means that you
can omit any such errors, but can't queue their messages (because the function quits early).
This might be addressed in future.