Im trying to make it so if my MP hits 0 the HP goes down by a specific amount (not percent) but I cant think of how to do this and I dont think any of the plugins i have will help
any ideas?
any ideas?
<Custom Turn Start Effect>
user.hadMp=user.mp>0 ? true : false;
</Custom Turn Start Effect>
<Custom Action End Effect>
if (user.hadMp && user.mp==0)
user.gainHp(-X);
</Custom Action End Effect>
The solution posted above by ATT_Turan should work in most cases. But there are scenarios when that wouldn't work such as:
gainMp or setMp. You can use @ct_bolt's Custom Script Anywhere if you're not familiar with aliasing. Unfortunately, this would implement HP reduction everytime MP goes from positive to zero. So you'll possibly have to deal with a lot of conditionals.Why wouldn't it work then? Unless you're suggesting they start the turn with 0 MP, do something to restore it with their first action, then exhaust it to 0 again with their second...which is technically possible, but seems a fringe scenario to me 😉
Very true.
THAT IS A FRINGE SCENARIO! 😮 Your code shouldn't allow that. Remember, your code has a check at turn start. So if you start the turn with 0 MP then the hp reduction won't activate at all.
Actually, your code will work just fine in this case. 👋
In fairness to you, I get to cherrypick which threads I want to solve. 😀
On the other hand, figuring out the exclusions in this case sounds like a lot of work too. 😳
Sadly, I remember a couple of them. Although the working hypothesis was that it was the same person remaking an account.
Yes, but it's my fault for not explicitly describing it properly.
this feels like a really stupid question but how do i turn it into a passive state, ive installed yanflys buffs and states core aswell with no real luck on makin anything work
You need to make sure you always read the instructions for plugins you install 😉 The documentation for Auto Passive States tells you how to put a passive state onto your actors via a notetag.
Okay...that is not how I read your original request. So the only notetag you need in your passive state is this:
<Custom Action End Effect>
if (user.mp==0 && user.hp>1)
user.gainHp(-1);
</Custom Action End Effect>
&& user.hp>1What a good idea!
Original thread: https://forums.rpgmakerweb.com/threads/im-trying-to-make-it-so-if-my-mp-hits-0-the-hp-goes-down-but-idk-how.147947/