Gargoyle77

Veteran
Veteran
Joined
Dec 4, 2017
Messages
95
Reaction score
17
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
5,096
Reaction score
3,248
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
95
Reaction score
17
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
159
Reaction score
42
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
159
Reaction score
42
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
5,096
Reaction score
3,248
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
95
Reaction score
17
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
159
Reaction score
42
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 Posts

Latest Profile Posts

Food for thought. Factorio: Spaghetti belts make your factory inefficient as you fight for space constantly. Satisfactory: Spaghetti belts and massive clipping is the most efficient way to run your factory since it's the shortest distances.
ScreenShot_8_19_2022_8_51_4.png
Both Mike and Ray here are in a "HYPE!" state after Mike uses "Wild Party", which also heals everyone. they'll do more damage and counter more often, but defense is lower along with hit rate.
WHEEL3.gif
Ooker spookers and fun attack mechanics! What a Friday!
Not today... Not today...
I guess I should send my CV to Hasbro. I've made Monopoly cheaters edition more fun and challenging. I've developed custom cheats and chest/chance cards for it. And I've cleared many nightmares through my cards and rules.

Forum statistics

Threads
124,708
Messages
1,165,420
Members
163,521
Latest member
Balalaika
Top