[Beginner] How do I find the value of a variable?

C

cheef

Guest
I don't know how to actually check if a code is causing a value to go strange. For instance, I'm getting an error I shouldn't be getting when following PixelatedPope's Resolution-Aspect Ratio tutorial and can't test if one line or another is changing the value before it gets to the end.

In addition to the title question though, any basic or even obvious tips on how to search and troubleshoot variables for myself would be appreciated. I'm really having a rough time understanding computer logic.

Thanks!
 

CoderJoe

Member
First off, the debugger. I assume you're using gamemaker studio so there is a red icon that looks just like the run icon except it runs a debugger as well. You can view global and local variables and their values. You can also use the show_debug_message(message) to output stuff in the compile console. Hopefully that helps!
 
C

cheef

Guest
Great! I'm learning both Studio 2 and 1.4 since there's more tutorials for 1.4 right now. Debugger seems unable to search up variables that aren't causing problems but I'll try to use show_debug_message(variable); to get the numbers I need.

Thanks Joe!
 

CoderJoe

Member
No problem! The debugger takes a bit to get used to. I actually haven't tried the one in GM2 so I can't help much there. Good luck with your project!
 
Top