[RMMZ] CREATING A CONDITION BASED ON HP/MP - HOW TO?

Posts

Pages: 1
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.
Marrend
Guardian of the Description Thread
21781
I more or less know how to do this Conditional Branch in Ace...


Conditional Branch: Script: $game_actors[id].hp == val && $game_actors[id].mp == val

...but, I would have to look up the references for MV/MZ. I think "$game_actor" would become "$gameActor", but, more than that, I can't remember.

*Edit: A bit of delving into 'rmmz_ojbects.js' (thanks again, Trials of MZ event!) uncovers...

$gameActors.actors(actor_id).hp == val && $gameActors.actors(actor_id).mp == val

...this as a possibility. Of course, if you want to check a percentile, it might look something more like...

($gameActors.actors(id).hp*100/$gameActors.actors(id).mhp) >= percentage_check && ($gameActors.actors(id).mp*100/$gameActors.actors(id).mmp) >= percentage_check

...this? The script-box for Conditional Branches might not fit all that in one viewing, but, I still believe it would work, in theory.
Pages: 1