RMMZ Create a condition based on actor's HP/MP - Is it possible in MZ?

Kalombi

Veteran
Veteran
Joined
Oct 10, 2018
Messages
36
Reaction score
23
First Language
English
Primarily Uses
N/A
Hello, I ran into this problem while scripting in MZ.

I want to create a conditional that uses an actor's HP or MP as the determining factor. But it seems that the only way to do this is to convert those stats into variables and then run the conditional on those variables. What could I be missing? Or is there just no way to do that?

Thank you for any help.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,252
Reaction score
14,262
First Language
English
Primarily Uses
RMMV
You could use a script call in the Conditional Branch
 

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,407
Reaction score
654
First Language
indonesian
you can do that (storing in variable) OR if you know some scripting just use conditional branch -> script:
Code:
$gameActors.actor(x).hp <= y
change x to your actor id
change <= to any comparison like == or >= depending on your situation
<= will return true if first value is lower or equal to second value
== will return true if first value is equal to second value
>= will return true if first value is higher or equal to second value
< will return true if first value is only lower to second value
> will return true if first value is only higher to second value
change y to to any number you want to compare with hp...

for mp just change .hp to .mp

above is current hp or current mp...

if you want to use actor MAXHP or MAXMP instead... just use
.mhp => max hp
.mmp => max mp

hope this help.
 

Latest Threads

Latest Posts

Latest Profile Posts

I found a book about game localization. It costs R$708,00 on Amazon. ;_;
I really wish my game was far enough along for it to be actually playable beyond certain aspects. I think I've crafted a really fun battle system thanks to ATB, fighting game, and Boost point mechanics.
Play test of my current progress on Happy Camper
Cutscene Contest Winners have been announced!

I'm heading back to Orlando tomorrow! My dad and I have forgiven each other, so we're planning to spend Spring Break together. We'll probably go to SeaWorld and Aquatica one day, and maybe even use my air fryer to make something to go with Dad's grilled steak. The train leaves tomorrow, and I'll be working on my game on board!

Forum statistics

Threads
109,110
Messages
1,042,177
Members
141,608
Latest member
Sinthea
Top