How to make MP drain when using an item?

Frain

Mastermind
Veteran
Joined
May 27, 2018
Messages
37
Reaction score
7
First Language
English
Primarily Uses
RMVXA
Hello! I spent few hours trying to figure out how should it work correctly. I gave up and I hope I can get some answers.
So, my point is basically, I want the MP to drain when using the flashlight (item). Let's say every 60 seconds it drains 3 points of MP. I want to make a system where the MP is the flashlight life, and batteries are used to restore the MP. The batteries work fine, they restore the MP. But the MP doesn't drain when using the flashlight! I tried this by using the common events, but it only works if I put the minus value in the "Turn off flashlight" common event. Otherwise nothing happens. I use Victor Light Effect script. Here are some screenshots of what I have so far:
flashh.png

flasshon.png

flasshhoff.png

batterysys.png
 

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,421
Reaction score
596
First Language
Italian
Primarily Uses
RMVXA
Trigger a switch and use a parallel process common event that lowers MP each second (using a wait command). If MP are 0 then the torchlight runs out. You can put everything in the same common event.
 

Frain

Mastermind
Veteran
Joined
May 27, 2018
Messages
37
Reaction score
7
First Language
English
Primarily Uses
RMVXA
Trigger a switch and use a parallel process common event that lowers MP each second (using a wait command). If MP are 0 then the torchlight runs out. You can put everything in the same common event.
Hey, hey, it works! Thank you so much! I was missing the variable for the player MP and I didn't set the conditional branch. Now it works like charm. I have one more small question: Is there a way to display MP status somewhere on the screen once flashlight is activated?
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,594
Reaction score
6,526
First Language
Indonesian
Primarily Uses
RMVXA
Is there a way to display MP status somewhere on the screen once flashlight is activated?
This is going to need a script. So it's a different request. I suggest u start a new one in the RGSS3 request forum.
 

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,421
Reaction score
596
First Language
Italian
Primarily Uses
RMVXA
It is theoretically doable with a script call but I do not recommend doing it. You have to be careful and properly delete the bar when needed. I would definitely do it with a script rather than relying on a script call.
 

Frain

Mastermind
Veteran
Joined
May 27, 2018
Messages
37
Reaction score
7
First Language
English
Primarily Uses
RMVXA
This is going to need a script. So it's a different request. I suggest u start a new one in the RGSS3 request forum.
It is theoretically doable with a script call but I do not recommend doing it. You have to be careful and properly delete the bar when needed. I would definitely do it with a script rather than relying on a script call.
Alright, thanks for help! :)
 

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

Latest Threads

Latest Posts

Latest Profile Posts

"You can thank my later", "But you haven't done anything", "Well, that's why ..."
Are we allowed to post about non-RPG Maker games?
I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

Forum statistics

Threads
105,884
Messages
1,017,238
Members
137,608
Latest member
Arm9
Top