Good call. That's what I get for trying to be helpful while working 🤣
Negative MP plugin?
RPG Maker MV SupportOk, so just to be clear, is everything working properly now?
Sounds like me helping someone when it's late. Quite recently I've managed to write code that checks if a variable is between two values like so:
x<=2 && x>=6, which is not quite how you do it xDNo, not really. The Attack and guard skills work now only on 0 MP.
Somehow they still don't work on Negative MP.
Earlier they didin't work on 0 and negative too.
I have no idea what might be causing this. But I'm bad with scripting so maybe you'll come up with something.
Ah, you'd want them to work on negative MP as well? I guess we both understood your request as no skills should work on negative MP - this is a fairly simple change:
JavaScript:
Game_BattlerBase.prototype.canPaySkillCost = function(skill) {
return this._tp >= this.skillTpCost(skill) && (this.skillMpCost(skill)<=0 || this._mp > 0);
};
To be clear, this will make skills with 0 MP cost (or ones with a negative MP cost if you have any) always work.
Finally! Everything works perfectly. Thank you all so much!
Sorry for writing here again but there's another problem that I didin't notice at first.
Would it be possible to keep the negative MP after battle?
When an actor has negative mp in battle and the battle ends it gets set back to 0.
Would it be possible to keep the negative MP after battle?
When an actor has negative mp in battle and the battle ends it gets set back to 0.
Please remind us of which battle system plugin you've implemented in your game project. The solution might depend on how that coder altered the default BS...
I am using the Yanfly's atb battle system
I would've expected the edit I provided to refresh() to take care of that. At first glance, I don't see anything else that gets called at the end of battle that would modify current MP, nor anything that modifies it in the ATB or Battle Engine Core.
But it must be one of your plugins, because in my test project it stays at the negative value.
If you can narrow down what's doing it, we can help with an edit.
But it must be one of your plugins, because in my test project it stays at the negative value.
If you can narrow down what's doing it, we can help with an edit.
Alright, somehow. Yep's core engine is causing it. I disabled every other plugin one at a time and only when this one was set to OFF the mp stayed negative after battle.
What's interesting is that when I made a new project with Yep's core engine and the negative mp plugin the mp stayed negative. So it's probably something with the config right?
Right. Make sure the order in the plugin manager is the same as your test project, and just go through the plugin parameters.
Okay, It works!
Looks like the Negative MP plugin had to be higher in the list than Yep's core engine.
Original thread: https://forums.rpgmakerweb.com/threads/negative-mp-plugin.155267/