show_debug_message_ext

This function shows a custom debug message in The Output Window and The Debug Overlay at runtime.

The syntax of this function is identical to that of the string_ext function; aside from a single argument it can also take a Format String with placeholders and and array with additional arguments to replace the placeholders with.

Values of type Real that are an integer will have no decimal places in the string. Values of type Real that have a fractional part will have two decimal places in the string. If you need more decimal places in the output string you can use the function string_format.

Values of type Struct or Instance will be converted to a string using that struct's or instance's toString() Method if one exists, or converted to a string implicitly.

Values of type Handle will be converted to a string that shows the handle info: "ref <type> <id>".

Values of type Array will be converted to a string of the format [element1, element2, element3, element4, element5], i.e. the concatenation of all elements in the array. If any of the elements in the array is a struct or an instance then its  will be called to convert it to a string.

Syntax:

show_debug_message_ext(value_or_format, values_array);

ArgumentTypeDescription
value_or_formatAny (if value) or String (if format)The value to be turned into a string.
values_arrayArray of AnyOPTIONAL An array containing the values to be inserted at the placeholder positions.

 

Returns:

N/A

 

Example 1:

show_debug_message_ext("{0} - {1}", [1, "First item"]);

 

 

Example 2:

numbers = [59, 23, 656, 8, 54];
array_sort(numbers, true);

show_debug_message_ext("The three lowest numbers are: {0}, {1} and {2}", numbers);

The above code first defines an array with some numbers, and sorts them in an ascending order. It then uses that array in a show_debug_message_ext() to call to insert its first three numbers into a format string, and then print the resulting string to the Output Log.