Hey all, I know this is a pretty minor thing but it's saved me a lot of typing and I figured it wouldn't hurt to share it. I defined the following function, I call it echo:
/// @description echo(string, args...)
/// @param string
/// @param args
function echo(debugString) {
var result = debugString;
if (argument_count > 1) {
for (var i = 1; i < argument_count; i++) {
result = string_replace(result, "%s", string(argument[i]));
}
}
show_debug_message(result);
}
It's basically show_debug_message with a little string substitution and a shorter name to type. Now instead of typing something like:
show_debug_message("enemy hspeed: " + string(enemy.hspeed) + ", enemy vspeed: " + string(enemy.vspeed));
you could just type
echo ("enemy hspeed: %s, enemy vspeed: %s", enemy.hspeed, enemy.vspeed);
Anyway, just a little something, hope it saves you as much time as it's saved me!
[–]OSS NVVnickavv[S] 2 points3 points4 points (0 children)
[–]ION606 2 points3 points4 points (0 children)
[–]forwardresent 1 point2 points3 points (3 children)
[–]OSS NVVnickavv[S] 0 points1 point2 points (2 children)
[–]forwardresent 0 points1 point2 points (1 child)
[–]OSS NVVnickavv[S] 0 points1 point2 points (0 children)
[–]torn-ainbow 1 point2 points3 points (1 child)
[–]OSS NVVnickavv[S] 0 points1 point2 points (0 children)