How to watch var value

I look for a realtime help to look at the value of a specific variable.


Something go wrong, so I want to debug my game.


It's must exist a way to get realtime value of a var.


Thanks for your help.
, if you talk about variable from rpg maker 


in game tape F9


if you talk about javascript variable.
 


transforme your var like thats


var Thisismyvar = 0;
// remove the declaration var to change the scope.this allow you to call your variable anywhere in game
Thisismyvar = 0;


and in the console (F8)


Tape the name of your variable and you will get the reeltime current value.


Capture.JPG
In addition to Jonforum's answer, if you're trying to debug a particular script/plugin you can use console.log(); from the script to print to the console.


You can also access the various global vars ($gamePlayer, $gameMap, $gameVariables...) and all related functions and data directly from the console.


For example, $gameMap.events(); will list all the event objects on the current map.
Also, Orange Hud will allow you to display variables on screen:


http://hudell.com/blog/mv-plugin-orange-hud/


It's meant for creating new HUDs and interfaces, but I use it all the time to just print a variable on screen that will automatically update whenever it changes.
, if you talk about variable from rpg maker 


in game tape F9


if you talk about javascript variable.
 


transforme your var like thats



var Thisismyvar = 0;
// remove the declaration var to change the scope.this allow you to call your variable anywhere in game
Thisismyvar = 0;


and in the console (F8)


Tape the name of your variable and you will get the reeltime current value.


View attachment 57050



Did't work here, told me that var was undefined. I want value of Var 1 with the name MomentJour(ok)
@XGuarden


send your complete script is because you not remove the var declaration before your variable


ps: Dont quote all post, You will attract the lightning of the moderator 🤘 .
F9 is the way you show the value of the variable in real time in game. I tried it on a clean project and it works. If you can't even get that far to do that, then the only way I ever got it to work was a print command to force print the value of the variable at that point in time. I know in ruby msgbox_p(name of variable) will do that, but I have no idea on JavaScript (maybe someone who knows JavaScript will know more?)
I fix it wit the orange plugging. That what I need because the provide real time value unlike F9. I try to find out when this value change for no reason so it's perfect.


Problem solved.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-watch-var-value.74092/