I have specific lines of HUD text that are on top of each other, and only one shows at a time. So say, I'd want text to show up that says "Wednesday" that shows up when variable #0002 = 3. One problem though: I have no idea how to make it show up using variables. Switches are easy, of course, it was in the tutorial. But I have no idea where to put variable number and variable value.
How to use variables in conditionals in SumRndmDde's HUD Maker?
RPG Maker MV SupportYou can do conditional checks for variables like this:
$gameVariables.value(x) == y
Replace 'x' with the variable's ID, and 'y' with the value that's being checked to determine if the condition is true. If you use '==' as the javascript operator, then it checks if variable X is equal to y, but you can replace == with other operators such as > (greater than), < (less than), >= (greater than or equal to) and so on, depending on your needs.
In your specific case, write the following line; $gameVariables.value(2) == 3
This means that if variable 2 is equal to 3, the "Wednesday" text will show up.
$gameVariables.value(x) == y
Replace 'x' with the variable's ID, and 'y' with the value that's being checked to determine if the condition is true. If you use '==' as the javascript operator, then it checks if variable X is equal to y, but you can replace == with other operators such as > (greater than), < (less than), >= (greater than or equal to) and so on, depending on your needs.
In your specific case, write the following line; $gameVariables.value(2) == 3
This means that if variable 2 is equal to 3, the "Wednesday" text will show up.
There's where it is. I was doing something similar, but I don't have too much a grasp on JS so I was using one = instead of two. At least I was close!
Original thread: https://forums.rpgmakerweb.com/threads/how-to-use-variables-in-conditionals-in-sumrndmddes-hud-maker.152938/