RMMZ VISUMZ Core Script - Using variables and switches in notes?

TenebrisCrow

The Kelphy Corp
Veteran
Joined
Oct 19, 2015
Messages
99
Reaction score
6
First Language
English
Primarily Uses
RMMZ
I am trying to set my Max HP % to a variable using VISUMZ Core Script. So depending on what integer the variable is equal to determines the percentage of the Max HP. I currently have this:


<MaxHP Rate: ($gameVariables.value(1))%>

I hoped that would work but it doesn't.
How do I do this?
I might have the plugin written incorrectly as well.
I also would like there to be a switch condition. So it only lets me go passed level 99 if a switch is enabled.

Any help would be great.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
2,761
Reaction score
1,619
First Language
English
Primarily Uses
RMMV
As a general rule, you can't use JavaScript expressions in notetag commands unless you are told you can.

In this case, the documentation for the <param Rate: x> notetag just says "Replace 'x' with a percentage (ie. 150%) or a rate (ie. 1.5)." It does not say that it will evaluate JavaScript, so your syntax is invalid.

However, if you scroll down in the documentation just a bit, you'll see the <JS param Rate: code> notetag. This one says code, and then instructs, "Replace 'code' with JavaScript code".

So <JS MaxHP Rate: $gameVariables.value(1)/100> will cause that variable's value to act as a percentage rate for your max HP.

I also would like there to be a switch condition. So it only lets me go passed level 99 if a switch is enabled.
I'm sorry, but I don't understand this. What does "level 99" mean? Do you mean the value of the variable is treated as being 99, even if it's higher, unless a switch is on? Or is this a completely different question about getting more than 99 experience levels in a class?
 

Latest Threads

Latest Profile Posts

edit: third time's the charm? some graphic text I whipped up that I like for the mid-game intertitle, now with all of the actual letters in the stupid damn words I was trying to spell :uswt2:
kcsmall.png
It is december, my dudes

badge_xmas.png
I love it when a plan comes together, and especially when Ruby decides to work with me when I decide to code. :kaopride:
Got sick and had to take a few days off work in order to get tested and make sure it wasn't the big one. Felt a lot better today and thought to myself, "Hey now, I can't get tested until tomorrow anyway, I can get so much character art done today!"
....I watched Youtube and browsed this site for hours instead.
>.>
But at least I'm doing the art now! Yaaaaay.......

Forum statistics

Threads
117,094
Messages
1,104,529
Members
153,100
Latest member
a1394649795
Top