This function will create a custom debug message that is shown in the compiler window at runtime. Note that the message can be either a string or a real number, but if you need both then the number will have to be converted to string first using the string function (see the example below) and that if the number has more than two decimal places then you should use string_format to show them as by default decimals are rounded to the nearest two decimal places (so "1.2468" would show as "1.25" in the output window).

Debug messages shown with this function will be shown in the Compiler Output Window at the bottom of the IDE as well as in the Graph View of the debugger when running the game in Debug Mode. If you only want to see messages in Debug Mode then you should probably be using debug_event instead.



参数 描述
string The custom debug message to show.




if !instance_exists(obj_Exit)
   show_debug_message("Exit not created!");
   show_debug_message("Error Num: " + string(global.error));

The above code checks to see if an instance exists and if it does not, a debug message is shown in the compile window and the game is ended.