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,173
Reaction score
1,164
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 Posts

Latest Profile Posts

I want to learn Javascript to create a custom menu, but I don't really know where to start.
One uncomfortable truth that has withstood the test of time, is how most people will stand by while they see a crime happening, unless it's illegal to stand by. We probably wouldn't have stories about "special heroes" or games about heroes if the "everyday common folk" were largely capable of being heroes. Heroes face dangers that most people are not willing to.
I'm having toooo much fun designing the new MP (Mental Psyche) system. I've only worked it out for enemies so far, but it's fun to stun them, then go after their MP and delete them instead to farm for better item drops.
anyone know of a place I can promote my game? sorta like game awards but for indie devs, like a place where I can drop a trailer and like stir up some hype
Doing RPG Maker News for 17th October 2021

Forum statistics

Threads
115,882
Messages
1,093,697
Members
151,126
Latest member
LAB00M
Top