Gargoyle77

Veteran
Veteran
Joined
Dec 4, 2017
Messages
94
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,990
Reaction score
3,170
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
94
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
154
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
154
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,990
Reaction score
3,170
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
94
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
154
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


Calf survival story with a happy ending.
well here's that concept art!
WIN_20220812_16_53_56_Pro (2).jpg
Whaddya think? Name suggestions?
Some character designs of 'Coin Locker'.
(there may be some future designs along the process.)


Untitled1294_20220813055849.png
1660339609612.png
Really need to come up with better names for my folders.
rpgmakerxp wrote on caethyril's profile.
Hi, I saw you comment a google drive link to add a specific script to a kadowa plugin for battle voices here: https://forums.rpgmakerweb.com/inde...attacking-defending-skills-damage-ect.119148/

I'd like to add "multiple possible battle voices" for stuff too, can you please let me know what to change cause the link isn't working.

Forum statistics

Threads
124,455
Messages
1,163,794
Members
163,276
Latest member
Ciberfreak
Top