Negative MP?

Meemoo

Imagination Puppet
Veteran
Joined
Oct 26, 2015
Messages
42
Reaction score
3
First Language
English
I'm trying to make it so when you use a skill, it takes away 7 MP for example, and your max MP is 3 let's just say, I want it to show that you now have -4 MP and during that time you have -4 MP you are unable to attack or move till your MP regenerates back.

I already have the regenerating MP down, I just need help with trying to get MP down to a negative number, because when I use a skill that spends more MP than what you have it is unable to let me do it, Is there a plugin or a way to do this?
 

InBlast

The Mad Hamster
Veteran
Joined
Nov 2, 2015
Messages
287
Reaction score
89
First Language
French
I think you would need to create a plugin that change this :

Code:
Game_BattlerBase.prototype.refresh = function() {
    this.stateResistSet().forEach(function(stateId) {
        this.eraseState(stateId);
    }, this);
    this._hp = this._hp.clamp(0, this.mhp);
    this._mp = this._mp.clamp(0, this.mmp);
    this._tp = this._tp.clamp(0, this.maxTp());
};
into something like this :
Code:
Game_BattlerBase.prototype.refresh = function() {
    this.stateResistSet().forEach(function(stateId) {
        this.eraseState(stateId);
    }, this);
    this._hp = this._hp.clamp(0, this.mhp);
    if(this._mp > this.mmp) {
        this._mp = this.mmp;
    }
    this._tp = this._tp.clamp(0, this.maxTp());
};
But I cannot test actually, and I'm not a good JS dev, so maybe a better one could answer you better.

EDIT : there is a need to also allow the use of a spell if you don't have enouth mana.
I will try to create the plugin. It will train me a little ^^


Try this : https://github.com/InBlast/Plugins/blob/master/IB_NegativeMana.js
 
Last edited:

Meemoo

Imagination Puppet
Veteran
Joined
Oct 26, 2015
Messages
42
Reaction score
3
First Language
English
I think you would need to create a plugin that change this :

Code:
Game_BattlerBase.prototype.refresh = function() {
    this.stateResistSet().forEach(function(stateId) {
        this.eraseState(stateId);
    }, this);
    this._hp = this._hp.clamp(0, this.mhp);
    this._mp = this._mp.clamp(0, this.mmp);
    this._tp = this._tp.clamp(0, this.maxTp());
};
into something like this :
Code:
Game_BattlerBase.prototype.refresh = function() {
    this.stateResistSet().forEach(function(stateId) {
        this.eraseState(stateId);
    }, this);
    this._hp = this._hp.clamp(0, this.mhp);
    if(this._mp > this.mmp) {
        this._mp = this.mmp;
    }
    this._tp = this._tp.clamp(0, this.maxTp());
};
But I cannot test actually, and I'm not a good JS dev, so maybe a better one could answer you better.

EDIT : there is a need to also allow the use of a spell if you don't have enouth mana.
I will try to create the plugin. It will train me a little ^^


Try this : https://github.com/InBlast/Plugins/blob/master/IB_NegativeMana.js
Thank you for this, I don't know how to JS or create plugins myself so this is awesome of you to do.

I've tried your plugin and when I have used up all my MP I still can't use anymore skills, the text is grayed out. I've turned off all of my plugins as well so nothing would interfere with it either. I thought of using a common event and try to do it that way but it's all becoming very complicated and stuck.
 

InBlast

The Mad Hamster
Veteran
Joined
Nov 2, 2015
Messages
287
Reaction score
89
First Language
French
Oh, just found out something. Try again (download it from the same link).

With event, I don't think this is possible.
 

Meemoo

Imagination Puppet
Veteran
Joined
Oct 26, 2015
Messages
42
Reaction score
3
First Language
English
Oh, just found out something. Try again (download it from the same link).

With event, I don't think this is possible.
Awesome! It actually works now, but there is another problem that came up and it's
the MP blue bar. It keeps going every time I attack now and I'm pretty sure it will keep
going till it reaches the end of the left screen. Any way to just make it stop and have
an empty bar?
 

InBlast

The Mad Hamster
Veteran
Joined
Nov 2, 2015
Messages
287
Reaction score
89
First Language
French
I was expecting this ^^ I will search.
Do you use any plugin that modify the battle HUD ?

Done. Try new version.
 
Last edited:

Meemoo

Imagination Puppet
Veteran
Joined
Oct 26, 2015
Messages
42
Reaction score
3
First Language
English
I was expecting this ^^ I will search.
Do you use any plugin that modify the battle HUD ?

Done. Try new version.
Holy crap you're fast, yeah everything works great! The blue bar is fixed and everything is looking awesome.
Thank you so much for this plugin you made, it's going to help my game out so much more now that I have
this. I don't know how else to repay you other than thanks. If you need artwork for anything or sprites for
something, message me, It's the one thing I can do at least.

Edit: Also you should share this case someone might find it useful, it's an awesome plugin.
 

InBlast

The Mad Hamster
Veteran
Joined
Nov 2, 2015
Messages
287
Reaction score
89
First Language
French
Nice to know it works well =)
You're welcome, it wasn't so much ^^Well, I may need a game logo for my title screen soon. If you have some skills in photoshop (or other), I'm interested ^^

Maybe I will ^^

If you need, I can modify the plugin to block the player to use any spell that cost mana if the mana is negative (so, no need to use a state). I will add some line to have better compatibility.
 

Meemoo

Imagination Puppet
Veteran
Joined
Oct 26, 2015
Messages
42
Reaction score
3
First Language
English
Nice to know it works well =)
You're welcome, it wasn't so much ^^Well, I may need a game logo for my title screen soon. If you have some skills in photoshop (or other), I'm interested ^^

Maybe I will ^^

If you need, I can modify the plugin to block the player to use any spell that cost mana if the mana is negative (so, no need to use a state). I will add some line to have better compatibility.
I use SAI which is more close to a paint program than anything but I'd be willing to give it my best. I can
give you some examples too if you would like. :)

Actually that would be awesome, If that was added then the MP bar would just need to regenerate and then the actor can use moves again. I would try to get it so the other actors would fight while the other one with negative MP would recover and get attacked. Because I wanted it to be a risky move when you used allot of MP. Yeah that would be so sweet of you.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,959
First Language
English
Primarily Uses
RMMV
Be careful using this if you have any effects that use the MP regeneration trait, as it may cause some screwy behaviour.
 

Meemoo

Imagination Puppet
Veteran
Joined
Oct 26, 2015
Messages
42
Reaction score
3
First Language
English
Be careful using this if you have any effects that use the MP regeneration trait, as it may cause some screwy behaviour.
Thank you, I'll definitely keep an eye out for anything strange.
 

InBlast

The Mad Hamster
Veteran
Joined
Nov 2, 2015
Messages
287
Reaction score
89
First Language
French
Done, new version on github. Now, if you have negative mana, you're not able to use a skill that cost mana. Note that if your mana is 0, you can still use a skill that cost mana.
Don't hesitate to PM me if you want some other features in the plugin.

And yes, I would be happy to see some of your works ! (In PM too, to avoid flooding this thread)
 

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,981
Members
137,563
Latest member
cexojow
Top