When MP hits 0, I want the character to not be able to attack.

Hello, everyone. I figured this was a specific problem to me and I've scoured the internet to find a solution, but I don't think I can word it right enough for Google to pull up what I'm looking for.

In the game I am creating, I have a character that has a gun he cannot get rid of. He uses it for battle but it drains his mana. I have successfully made it so that after each attack it drains his mana, but when it hits 0, he is still able to attack. I don't want that. I want to make it so when his mana is 0 you cannot attack with him until you refill his mana points. Is there something in the system settings I am missing? Can I make a certain weapon call upon a certain skill or something? He is the only one using a gun. I am using Yami's Symphony battle script. I have tried putting things in the note section of the gun weapon so it calls upon a different skill (other than skill one which is default) but it does not seem to work. Any suggestions? I am open to make it so the attack is weaker if the MP is 0, or so on, I'm just not sure what to do.

Any help is appreciated. Thank you.

-Vamp.
@VampireKiller21 You could try this:
Code:
(a._mp = 0) ? 0 : (*insert basic attack formula here*)
It won't stop them from attacking, but it will make sure that attacking with 0 MP will always do 0 damage, regardless of Atk, MAtk, Def, and MDef stats of both fighters.
@JtheDuelist Just a correction as this is within the VX Ace section.
Code:
a.mp == 0 ? 0 : -replace with damage formula-

Also, just giving the attack skill an MP cost of at least 1 should render it unusable if the actor has no MP.
Anything that attack skill unusable would make attack unusable as well.
And such, Rinobi's solution should work, at least in default script
I don't know if your battle system script would alter how they handle the attack skill though
So with the formula that you guys gave me where am I supposed to put that? Anywhere I put it doesn't seem to work.

<attack skill: 128>
<target action>
icon create: user, weapon
icon: user, weapon, angle, -45
icon: user, weapon, cur_y 35
wait: 4
icon: user, weapon, cur_x -10
attack animation: target, wait
skill effect: whole
icon delete: user, weapon
</target action>

This is in the NOTE SECTION of the WEAPON I am having this character use. This allows his animation to step forward, use the gun, and step back. I guess another way of putting this is how to I make it so the gun will either shoot and do no damage, or not shoot at all when there is 0 MP? Is that possible? Do I need to somehow make the weapon call to a certain skill? I'm not sure what to do. Again I am using Yami's Battle Symphony Script. I have been looking around still with no luck. Thank you all so much for the help so far!

Side note, all the other characters using different weapons I want to be able to still attack even with 0 MP.

-Vamp
In the damage formula box for the basic attack in the database's Skill tab.
In the damage formula box for the basic attack in the database's Skill tab.
But won't that make it so EVERYONE with 0 MP can't attack? I only want the one character to not be able to with 0 MP.
That notetag is for a weapon, alright. Say, you have two character, A and B. Are both character can equip that weapon, but either has to be unable to attack?

If the particular weapon can be equipped by one character, it's much easier. But if not, it may need a script patch to work
That notetag is for a weapon, alright. Say, you have two character, A and B. Are both character can equip that weapon, but either has to be unable to attack?

If the particular weapon can be equipped by one character, it's much easier. But if not, it may need a script patch to work
I don't believe I quite understand what you are saying, sorry.
I don't believe I quite understand what you are saying, sorry.
I think I screwed up. Let me rephrase it in a chronology.

<attack skill: 128>
This is the notetag, which I believe it works to change the normal attack as skill 128
This notetag is placed in weapon notebox
So, anyone who use the weapon will have their normal attack changed into skill 128 when the weapon is equipped
In sense, if skill 128 uses 1MP per attack, means if the character has 0 MP, the character can't attack. It should solve the problem already

Then, you said this
I only want the one character to not be able to with 0 MP.
Implying the weapon can be equipped to other characters, but only one character can't attack if its MP is 0 while equipping the weapon?
I think I screwed up. Let me rephrase it in a chronology.


This is the notetag, which I believe it works to change the normal attack as skill 128
This notetag is placed in weapon notebox
So, anyone who use the weapon will have their normal attack changed into skill 128 when the weapon is equipped
In sense, if skill 128 uses 1MP per attack, means if the character has 0 MP, the character can't attack. It should solve the problem already

Then, you said this

Implying the weapon can be equipped to other characters, but only one character can't attack if its MP is 0 while equipping the weapon?
Ohhh okay sorry for the confusion. Yes, only ONE character can equip the weapon, no one else in the whole game. So that note tag then, it doesn’t seem to work completely, am I using the wrong symbols? It keeps doing the normal attack and ignores using skill 128, it just uses skill 1.
So that note tag then, it doesn’t seem to work completely, am I using the wrong symbols?
I can't help with this, does the script you're using even support changing attack skill id in the first place? I don't know
But if you managed to change skill ID based on the weapon, then my solution above should works
I can't help with this, does the script you're using even support changing attack skill id in the first place? I don't know
But if you managed to change skill ID based on the weapon, then my solution above should works
I’ll try to test it tonight and let you know, thank you.
Looking forward to it 🙂
Looking forward to it 🙂
I have found another script to help with the skill replacement! Everything now works just fine! Thank you all!

-Vamp

Original thread: https://forums.rpgmakerweb.com/threads/when-mp-hits-0-i-want-the-character-to-not-be-able-to-attack.91899/