Gargoyle77

Veteran
Veteran
Joined
Dec 4, 2017
Messages
92
Reaction score
16
First Language
English
Primarily Uses
RMMV
Is there a way to do this? I mean, when in battle, items should cost MP when used. I guess something can be done with yanfly's item requirements, but sadly Idk javascript. Can someone help me with this? Thanks.

Yanfly's plugin in case that's your approach.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,943
Reaction score
3,140
First Language
English
Primarily Uses
RMMV
Item Requirements can make you require the actor to have a certain amount of MP, but it won't make them spend it.

Code:
<Custom Enable Requirement>
condition=battler.mp>=X;
</Custom Enable Requirement>

You could combine it with a notetag from Yanfly's Skill Core:
Code:
<After Eval>
user.gainMp(-X);
</After Eval>
 

Gargoyle77

Veteran
Veteran
Joined
Dec 4, 2017
Messages
92
Reaction score
16
First Language
English
Primarily Uses
RMMV
Item Requirements can make you require the actor to have a certain amount of MP, but it won't make them spend it.

Code:
<Custom Enable Requirement>
condition=battler.mp>=X;
</Custom Enable Requirement>

You could combine it with a common event on the item to remove MP from the user afterward, but you'd have to jump through some hoops to figure out which actor used the item and use JavaScript to check whether you're in battle.

Another approach would be to use Yanfly's Skill Cost Items. Remove the actual Item command from battle, copy every item with a skill version (of an Items type), and have that skill require one of the item using the plugin settings.
Second option sounds like a lot of work, but it might be the cleanest and only possible solution for this. Thanks a lot for your answer.
 

oooNUKEooo

Veteran
Veteran
Joined
Sep 22, 2020
Messages
151
Reaction score
41
First Language
br portuguese
Primarily Uses
RMMV
Code:
<Custom Enable Requirement>
   condition = user.mp >= 0;
</Custom Enable Requirement>
 

oooNUKEooo

Veteran
Veteran
Joined
Sep 22, 2020
Messages
151
Reaction score
41
First Language
br portuguese
Primarily Uses
RMMV
youll need to make the cost be paid by putting the code somewhere. either damage or effect will do.

Item Requirements can make you require the actor to have a certain amount of MP, but it won't make them spend it.

Code:
<Custom Enable Requirement>
condition=battler.mp>=X;
</Custom Enable Requirement>

You could combine it with a notetag from Yanfly's Skill Core:
Code:
<After Eval>
user.gainMp(-X);
</After Eval>
LOL.

you beat me to it.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,943
Reaction score
3,140
First Language
English
Primarily Uses
RMMV
Second option sounds like a lot of work, but it might be the cleanest and only possible solution for this. Thanks a lot for your answer.
Yeah, I don't know if you saw my edit to my first reply, I forgot the Skill Core notetags could be used on items. Much simpler.

The only thing it doesn't address is letting the user know why they can't use the item. It will grey out the item if the actor doesn't have enough MP, but it won't tell them why or show how much they do need or anything.

If you want that, you'll have to go the Skill route.
 

Gargoyle77

Veteran
Veteran
Joined
Dec 4, 2017
Messages
92
Reaction score
16
First Language
English
Primarily Uses
RMMV
youll need to make the cost be paid by putting the code somewhere. either damage or effect will do.


LOL.

you beat me to it.

Mechanically, it works almost perfectly fine. Thanks a lot for your answer. The only minor thing is that items that use those notetags disappear when the conditions are not met. I know that that's how the plugin works. I just think it'd be good if the item names stayed grey as any other unusable skill would. If anyone knows how to modify yanfly's plugin to do this, please tell me. But for now, it works.
Yeah, I don't know if you saw my edit to my first reply, I forgot the Skill Core notetags could be used on items. Much simpler.

The only thing it doesn't address is letting the user know why they can't use the item. It will grey out the item if the actor doesn't have enough MP, but it won't tell them why or show how much they do need or anything.

If you want that, you'll have to go the Skill route.

That's fine. The game would warn the player that all actions during battle consume a fixed amount of MP. My only worry is the one posted above. Thanks for worrying.


EDIT: I want items to only consume MP when in battle. Outside battle they should work even if the user doesn't have any MP.
 
Last edited:

oooNUKEooo

Veteran
Veteran
Joined
Sep 22, 2020
Messages
151
Reaction score
41
First Language
br portuguese
Primarily Uses
RMMV
i dont think the plugin will differentiate battle from field if not listed in its parameters or notetags... youll probably have to choose one way or another.
 

Latest Threads

Latest Profile Posts

I just got all of my wisdom teeth out today, thankfully I have the rest of the week off.
Man I am learning I am bad at naming armor lmao.
The game's opening, now fully polished! :LZScheeze:





Aaand, here's me working on it in today's "Game Making Every Day" video! :LZSooo:

Hello! Can anyone help me? I followed making cooking tutorial for RPG Maker MV. But for some reason buff state that food gives doesn't work in overworld. It disappears. What am I supposed to do?
A shotgun is not a rifle. Huh.

Forum statistics

Threads
124,408
Messages
1,163,397
Members
163,207
Latest member
zapedrin
Top