Okay so i'm trying to create an event wherein the player can heal up to 50% of there Max HP. The catch? It can only heal you up to 50% Max HP which means if you try to use it while at 50% or higher it will have no effect. Side notes: There are only two party members and there is no actual RPG battles in game. Anyone know how to accomplish this?
RPG Maker MV 50% Heal
RPG Maker MV SupportThis is not a game mechanic discussion - it is a "how do I ..." question, and belongs in MV Support. Or more specifically, the damage formula thread.
Are you saying, if the player has 25%, they will get another 50% bringing them up to 75%? Or that they will only get 25% which will bring them to 50% and no higher?
I'm going to assume you'll give them 50% even if it puts them higher than 50% at the end. Something like this in your damage formula would do that:
b.hpRate() < 0.5 ? Math.floor(b.mhp * 0.5) : 0
and make sure there's no variance.
This will work if they have up to 50% of mhp but not exactly 50%. If you want them to gain HP if they already have exactly 50%, change the < to <=
If you're doing this through eventing and not through a skill or item, do this instead:
This gets the actor's HP and MHP into variables, calculates 50% of MHP, and if the actor currently has less than that 50%, it increases their HP by that much. Again, use <= if you want to give them HP if they have exactly 50%
Are you saying, if the player has 25%, they will get another 50% bringing them up to 75%? Or that they will only get 25% which will bring them to 50% and no higher?
I'm going to assume you'll give them 50% even if it puts them higher than 50% at the end. Something like this in your damage formula would do that:
b.hpRate() < 0.5 ? Math.floor(b.mhp * 0.5) : 0
and make sure there's no variance.
This will work if they have up to 50% of mhp but not exactly 50%. If you want them to gain HP if they already have exactly 50%, change the < to <=
If you're doing this through eventing and not through a skill or item, do this instead:
Code:
Control Variables [1: Actor HP] = Game Data > Actor (choose actor) > HP
Control Variables [2: Actor MHP] = Game Data > Actor (choose actor) > MHP (in parameters)
Control Variables [2: Actor MHP] /= 2
Conditional Branch: Variable [1: Actor HP] < Variable [2: Actor MHP]
Change Actor HP: (choose actor), Variable [2: Actor MHP]
End
This gets the actor's HP and MHP into variables, calculates 50% of MHP, and if the actor currently has less than that 50%, it increases their HP by that much. Again, use <= if you want to give them HP if they have exactly 50%
I'm sorry I posted this in the wrong place I'm kind of new to this but what I mean to say is that, It will only be able to bring you to 50%. Let me explain better. In game the player can find these rest areas if this area has a "bed" there and they use it it will only bring your HP to 50% of Max HP, meaning if you have 300 HP overall and your current HP is say about 30 and you use this event it will bring you to 150 HP but if you try to use it again it will not take you beyond 150 HP. This way players can't spam it to regain 100%. Do you know how to do that?
Code:
Control Variables [1: HP to Give] = Game Data > Actor (choose actor) > Max HP (in parameters)
Control Variables [1: HP to Give] /= 2
Control Variables [1: HP to Give] -= Game Data > Actor (choose actor) > HP
Conditional Branch: Variable [1: HP to Give] > 0
Change Actor HP: (choose actor), Variable [1: HP to Give]
End
So this is now working out what 50% of the actor's maximum HP is, and the difference between that and their current HP. If that ends up being < 0, it means they have more than 50% already. If it's > 0, it means they have less than 50%, and the variable will currently hold what they would need to top them up to 50%.
It works! Thank you so much friend! I'll make sure to post accordingly as well!
ProjectMarakar, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.
Next time please just edit the previous post if less than 72 hours have passed.
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
Next time please just edit the previous post if less than 72 hours have passed.
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
Original thread: https://forums.rpgmakerweb.com/threads/rpg-maker-mv-50-heal.73270/
