• 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!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

GM:S (1.4.1804) debugger watch problem

P

Peter Szabo Gabor

Guest
Hello,

I used GM4-5-6-7-8 (8.1) quite a while, and now I started a new project in GM:S (not GM:S2).
I tried to add a watch (I wanted to know what the width of a dynamically loaded sprite).

1. I started my project in debug mode
2. I added a watch type window
3. I added a new watch (sprite_get_width(<ID>)) <ID> -> I used different IDs I knew was loaded (1-2-3 etc).

It accepted the watch, but under the VALUE header, no value was shown. :-/
Quite strange. The older debugger allowed me to add any kind of expression (GML) as a watch.

Any ideas what I am doing wrong?

Thank you all in advance!
KR,
Peter
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
GM<=8.1 runtime was interpreter-based, which allowed for arbitrary code execution, including from debugger.
GM:S was updated to compile the code instead, which was good news for performance, but meant departure of a few functions and expression-based debugger watches.
GMS2 debugger had seen a comeback of the feature, which is known to have been done by having the IDE compile a snippet of code to be watched and transmitting it to the runtime.

But, to the point. If you can't move to GMS2, your options for an in-game equivalent are:
  • This library (free, relatively recent - not really tested yet)
  • NSP2 (free, a bit oddish but works for common things)
  • value = live_execute_string("return " + expression)
    in my own GMLive.gml (paid, supports entirety of GML out of box)
 
P

Peter Szabo Gabor

Guest
GM<=8.1 runtime was interpreter-based, which allowed for arbitrary code execution, including from debugger.
GM:S was updated to compile the code instead, which was good news for performance, but meant departure of a few functions and expression-based debugger watches.
GMS2 debugger had seen a comeback of the feature, which is known to have been done by having the IDE compile a snippet of code to be watched and transmitting it to the runtime.

But, to the point. If you can't move to GMS2, your options for an in-game equivalent are:
  • This library (free, relatively recent - not really tested yet)
  • NSP2 (free, a bit oddish but works for common things)
  • value = live_execute_string("return " + expression)
    in my own GMLive.gml (paid, supports entirety of GML out of box)
Thank you for the prompt answer. I will check out the additional libraries if there are no other ways... , but I was asking this thing, because the "Watches" debug window is a feature of the Debugger. Meaning: it should work, ain't it? I tried even with simple variables, and it shew nothing. Zero. Null. I bet, the watches should work, it is a basic brick of every debug system since Turbo Pascal. Sorry, to sticking to this, but I can't imagine that YoYo released an unuseable watch window for its debugger.
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
Thank you for the prompt answer. I will check out the additional libraries if there are no other ways... , but I was asking this thing, because the "Watches" debug window is a feature of the Debugger. Meaning: it should work, ain't it? I tried even with simple variables, and it shew nothing. Zero. Null. I bet, the watches should work, it is a basic brick of every debug system since Turbo Pascal. Sorry, to sticking to this, but I can't imagine that YoYo released an unuseable watch window for its debugger.
Looking around, it seems like watches had been broken for a pretty long time (at least since 2016) but also basically never talked about (a single topic?), so it's possible that no one ever reported the issue and no one at YYG noticed themselves for whatever reason.
 
P

Peter Szabo Gabor

Guest
Looking around, it seems like watches had been broken for a pretty long time (at least since 2016) but also basically never talked about (a single topic?), so it's possible that no one ever reported the issue and no one at YYG noticed themselves for whatever reason.
Thank you again! This ... :) is strange. Actually, it is pretty important feature (okay, could be worked around, with instance watch, globals and locals windows), and I could also use the libraries you suggested.

Thank you again for your kind help!
 
Top