- Pokémon Essentials Version
- v18 ➖
Debugging code can be pretty annoying, especially when you don't know the value of a certain variable. That's where this script comes in. It tracks whichever variables you want by displaying their value at the right side of the screen. You can specify the size of the extra window, as well as how many lines a variable may use up to show the value.
Installation
In a new script section above Main, add the following script:
VariableTracker
Documentation
To track the value of a variable, use VariableTracker.track(name, code)
To stop tracking a variable, use VariableTracker.stop_tracking(name). This will stop tracking the variable (so that it won't display it anymore).
When this script tries to display a value but it returns an error, it will print out --- instead.
Installation
In a new script section above Main, add the following script:
VariableTracker
Documentation
To track the value of a variable, use VariableTracker.track(name, code)
- name: This is the display name of the variable and can be literally anything as long as it's a string.
- code: This can either be a String or a Proc. If it's a String, it will evaluate the string and display the return value. If it's a Proc, it will call the proc (without any arguments) and display the return value. It automatically calls .inspect on whatever it's about to display.
To stop tracking a variable, use VariableTracker.stop_tracking(name). This will stop tracking the variable (so that it won't display it anymore).
When this script tries to display a value but it returns an error, it will print out --- instead.
- Credits
- Marin