Calling a variable with code

Hello there! I would like to know how to call upon a variable with code. something along the lines of ($gameVariable.X etc)

(this is specifically for Smrnddude's HUD maker plugin where I want to condition a picture when a variable meets a certain value)
Hello there! I would like to know how to call upon a variable with code. something along the lines of ($gameVariable.X etc)

(this is specifically for Smrnddude's HUD maker plugin where I want to condition a picture when a variable meets a certain value)
$gameVariables.value(id) - to get
$gameVarables.setValue(id) - to set
$gameVariables.value(id) - to get
$gameVarables.setValue(id) - to set
Correction:

$gameVariables.setValue(id, newValue)
Just as a couple of quick tips:
MV and MZ have been out for years, so pretty much all simple little things have been asked. If you were to Google "rpg maker mz variable script call" you'd find existing threads right away without having to wait.

There is also a pinned script call list that has many basic (and not-so-basic) functions listed.

Good luck!
Correction:

$gameVariables.setValue(id, newValue)
Yeah, right, sorry.
Just as a couple of quick tips:
MV and MZ have been out for years, so pretty much all simple little things have been asked. If you were to Google "rpg maker mz variable script call" you'd find existing threads right away without having to wait.

There is also a pinned script call list that has many basic (and not-so-basic) functions listed.

lol your right i shoulda done that in the first place. (Thankyou to everyone who helped me find my answer 😀 )
one other question: once I call the variable how do I specify that is is equal to a number e.g. something like ''$gameVariable.value(1) = 3''
how do I specify that is is equal to a number
Not sure what you mean here

if you mean to make it equal to a number
$gameVariables.setValue(id, newValue)

if you mean to check if its equal to a number
Code:
$gameVariables.value(x) == y
Not sure what you mean here

if you mean to make it equal to a number


if you mean to check if its equal to a number
Code:
$gameVariables.value(x) == y
thanks heaps 😀

Original thread: https://forums.rpgmakerweb.com/threads/calling-a-variable-with-code.164729/