• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM How to debug from a specific room

A

anomalous

Guest
I would make a debug object that when you put that in the game, it has certain keys mapped to cheat functions.
Like hitting "R" lets you pick which room you want it to take you to. It then executes a room goto as per normal, etc.
When done, just stop putting that object in the game and debug is off. Or always put it in put set a global to turn off/on debug mode (your debug mode).

Debugging done well ends up as part of the game design sort of.
 

Heavybrush

Member
thanks
I've done in this way:
I've made an object with this code:
create event

if(debug_mode) {
//debug message
show_debug_message("DEBUG!!!");

//debug overlay
show_debug_overlay(true);

//full screen disable
window_set_fullscreen(!window_get_fullscreen());
}

J key event
///change room cheat
if(debug_mode) {
room_goto(rm_module_test);
}

and I put this in the starting room
 
A

anomalous

Guest
Yeah, you got it, and your follow-on putting the debug overlay and setting a variable (Make it global perhaps) such that any objects you want to have a "debug mode" is the way to go. Based on the simplicity of your first post I didn't want to write more than the minimum.

And you may find later with other objects that they can have a "debug" mode in their draw event like drawing certain variables in text above their head (like AI states or whatever is bugging you) when that global variable is debug is on.
 
Top