[Solved] RMMV - State That Temporarely Lower Max HP - Buffs & States Core (YEP)

Status
Not open for further replies.

Accatosh

Veteran
Veteran
Joined
Dec 16, 2018
Messages
85
Reaction score
14
First Language
Swedish
Primarily Uses
RMMV
Hello!

I'm wondering how I can make a state temporarely lowers max hp to the current hp in RMMV. I'm trying to do this with Buffs & States Core (YEP).
An example of what I want is:

Actor 1 has 500 mhp and currently has 100 hp. But when actor 1 recieves the state, the actors mhp will be lowered to 100 hp. But when the state is removed, then the mhp will return to 500 mhp.

How can I do this?

If I'm not explaining well or not enough, please tell me.

Thank you in advance
 
Last edited:

FoxIt

Villager
Member
Joined
Aug 20, 2019
Messages
7
Reaction score
5
First Language
English
Primarily Uses
RMMV
No need for buffs and states core to get in the way here, the editor can do this just fine.

Create a new state and in the effects tab, go to the parameters, standard parameter and select max hp, set the % (so 20% would be needed in your example), and create a skill that can apply the state. No need for plug-ins here
 

Accatosh

Veteran
Veteran
Joined
Dec 16, 2018
Messages
85
Reaction score
14
First Language
Swedish
Primarily Uses
RMMV
@FoxIt
Thank you for your answer! I think I didn't explain enough, since I want the mhp to change to hp without any percentage.
For example, you can have 500 mhp and full hp. You then take 42 damage from a specific skill that also gives you the state. You now have 458 hp left and since you have this state, the mhp temporarily decreases to 458. But if you instead take 106 damage from the same skill, then you'll have both 394 hp and 394 mhp. The only way to return mhp to it's normal value, is to remove the state. If you succeed to remove it, then the mhp will equal 500 again.

In other words I want to do something like:

<Custom Action End Effect>
target.mhp = taget.hp
</Custom Action End Effect>

But this doesn't work though...
 
Last edited:

FoxIt

Villager
Member
Joined
Aug 20, 2019
Messages
7
Reaction score
5
First Language
English
Primarily Uses
RMMV
Oh, okay, now that would be a bit more complicated, something that I am unable to help you with...
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,510
Reaction score
992
First Language
EN
Primarily Uses
RMMV
Yea, you can't set parameters like that because they're calculated (for actors) based on class, equips, permanent bonuses, etc... Actually, hang on a minute. Permanent bonuses sounds good! :kaopride:

Try these Buffs & States Core notetags on your state:
JavaScript:
<Custom Apply Effect>
// Initialise tracking value
user._mhpLost = user._mhpLost || 0;
// Add difference between current and max HP
user._mhpLost += user.mhp - user.hp;
// Apply permanent MHP malus
user.addParam(0, user.hp - user.mhp);
</Custom Apply Effect>

<Custom Remove Effect>
// Revert MHP malus
user.addParam(0, user._mhpLost);
// Remove tracking value
delete user._mhpLost;
</Custom Remove Effect>
Explanation:
addParam is essentially just the Change Parameter event command: it permanently adds to the value of a basic param (MHP = 0, MMP = 1, ATK = 2, etc). So we stick a variable called _mhpLost on the state bearer to remember how much should be added back when the state wears off, then tell the game to add "current minus max" to their maximum HP. When the state wears off, addParam gets called again to reverse the effect. :kaophew:

Well, that's in theory, I haven't tested it. :kaoswt: Hopefully it works though! :kaothx:
 

Another Fen

Veteran
Veteran
Joined
Jan 23, 2013
Messages
551
Reaction score
264
First Language
German
Primarily Uses
Haven't tried it either due to not having the maker installed here yet, but judging from first glance the "custom remove effect" might not be triggered if the state is removed due to the battler becoming immune to it ("state resist"), dying or when you use the "Recover All" event command. I might be wrong here, but be sure to test these.

Also, is this supposed to be a one time reduction of MHP when the state is applied or do you want to continuously change the stat when the battler continues to take more damage from other sources (so they cannot be healed)?

If the only goal is to prevent the battler from getting healed, you could maybe achieve that by instead using a dedicated "Healing" element for all your healing items and give the state a "0% Healing element rate" trait.
(Although this would not affect recovery through "HP Regeneration Rate" traits by default if you are using those.)
 

Accatosh

Veteran
Veteran
Joined
Dec 16, 2018
Messages
85
Reaction score
14
First Language
Swedish
Primarily Uses
RMMV
@caethyril and @Another Fen , thank you for your answers!

The notetag is almost perfect. As Another Fen mentioned death, "Recover All" and immunity won't recover the temporary lost mhp.

Is there a way to make it possible? Else I might use the other solution Another Fen mentioned.
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,510
Reaction score
992
First Language
EN
Primarily Uses
RMMV
I think you'd need a plugin to handle State Resist and Recover All, but with Buffs & States Core I think you could handle death by putting this notetag on state #1?
JavaScript:
<Custom Apply Effect>
if (user._mhpLost) user.addParam(0, user._mhpLost);
delete user._mhpLost;
</Custom Apply Effect>
I.e. do the same thing when death is applied as would happen when the state is removed by normal means. :kaothx:
 

Accatosh

Veteran
Veteran
Joined
Dec 16, 2018
Messages
85
Reaction score
14
First Language
Swedish
Primarily Uses
RMMV
@caethyril

Thank you once again. I actually fixed the death problem earlier by doing the same thing. The only problem was that the death removed the state before the <Custom Apply Effect> could start. I fixed this by using State Categories (YEP) and put <Category: Bypass Death Removal> into the state's notes.

The problem I have left now is when I win. I'm using another kind of battle system, which basically has battles on the map. This means that I can't use <Custom Victory Effect>. If the state is removed with events, then the mhp lost won't return. I don't know how to do it, but is it possible to do it with script calls?
 
Last edited:

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,510
Reaction score
992
First Language
EN
Primarily Uses
RMMV
If the state is removed with events, then the mhp lost won't return. I don't know how to do it, but is it possible to do it with script calls?
The Change State command should proc a state's Remove Effect; just tested on the map with only Buffs & States Core and this notetag seemed to show the message OK when I had an event remove poison from the entire party:
JavaScript:
<Custom Remove Effect>
alert(user.name() + ' is feeling better now.');
</Custom Remove Effect>
...so I'm not sure what's happening for you. Maybe a plugin-related issue? :kaoswt:

In theory this, in a Script command, ought to manually process the "remove effect" on the party leader:
JavaScript:
var actor = $gameParty.members()[0];
if (actor._mhpLost) actor.addParam(0, actor._mhpLost);
delete actor._mhpLost;
You can change the index (0 = leader, 1 = first follower, etc) as needed, or loop over all members, e.g.
JavaScript:
$gameParty.battleMembers().forEach(function(m) {
  if (m._mhpLost) m.addParam(0, m._mhpLost);
  delete m._mhpLost;
});
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
14,274
Reaction score
7,859
First Language
English
Primarily Uses
RMMV

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.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

FREE RPG Maker Ready Glowing Ball Animation
Enjoy -No Credit Needed But Appreciated -
Download it at https://lvgames.itch.io/glowing-ball-sprite-pixel-fx-rpg-maker-ready
Ugh....When you spend hours doing something and then end up scrapping the idea >.<
Random joke of the day: This morning a man wearing a face mask robbed a supermarket in the town center. So far the police has arrested 240 suspects.
Hosting competitions using your game is always so nerve wracking!!!
Social distancing is great, apart from trying to work from home while the guy up the road now has ample time and apparently the only way to fill it is to ride his dirt bike up and down our street all day :(

Forum statistics

Threads
95,460
Messages
929,288
Members
125,695
Latest member
nasavat
Top