Looking for a way to run an ever decreasing stat that needs to be refilled

Eff-n-Geoff

Veteran
Veteran
Joined
Oct 26, 2015
Messages
182
Reaction score
7
First Language
English
As above really, I'm looking to run something similar to a hunger bar that needs to be refilled over time otherwise the player dies?

If the player picks up a food item then the bar re-fills and begins to deplete again ... 

Any ideas?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,111
Reaction score
13,715
First Language
English
Primarily Uses
RMMV
You could use a state with Ex-Parameter HP Regeneration of a negative number, except that uses a % and not a set value.
 

Eff-n-Geoff

Veteran
Veteran
Joined
Oct 26, 2015
Messages
182
Reaction score
7
First Language
English
A percentage would work absolutely fine, could you possibly explain this a little more? Also it's not health that i'll be running but a different variable, however it works in the same way so thought it was easier to explain it that way.

Thank you for replying so fast too!
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,434
Reaction score
7,713
First Language
German
Primarily Uses
RMMV
If you're not using MP, then you can rename MP to hunger or whatever and have it used that way.


In the traits area you can change additional parameters, and one of them is MP-regeneration (another would be the HP-regeneration Shaz mentioned).


If you set that for a negative value in the traits of every actor, it will automatically go down.


The only thing you would have to do is to make your events check the MP of the actors.


If you're already using HP and MP in your game, then you would either have to use a variable and control it (and its changes) with parallel process events, or use a plugin that adds new values.


There is a tutorial about evented hunger/thirst systems somewhere on this forum, but I don't know if a plugin already exists for MV.
 

Eff-n-Geoff

Veteran
Veteran
Joined
Oct 26, 2015
Messages
182
Reaction score
7
First Language
English
Hi Andar, thanks for coming in on this ... so I have checked out the traits area in MV and I can not find a way to add this in? I'm so sorry as I'm a complete newbie for adding in custom things to RPG Maker MV ... could you possibly point me to something I could follow?

I was probably being a little cagey, but basically what I'm after is a Battery stat that if it reaches 0 then a plugin command is ran that reduces the light emitting from the player using the Terrax Lighting system.
 
Last edited by a moderator:

alberthk

EM[P]
Veteran
Joined
Mar 28, 2015
Messages
41
Reaction score
6
First Language
Bahasa
. . .on ACE i used TP. . .but somehow, it causes major lag. . .might be working well in MV. . .
 

Eff-n-Geoff

Veteran
Veteran
Joined
Oct 26, 2015
Messages
182
Reaction score
7
First Language
English
Fantastic! I have found it now - thank you! So now the MP is reducing during gameplay how can I create an event that checks the MP and runs a plugin command if it reaches zero? There doesn't seem to be an option for checking MP.

Would the attached screenshot work ... so it's basically replacing the variable Battery Power with the MP constantly - then if the Battery Power reaches zero I can call an effect?

Screen Shot 2015-12-07 at 11.03.35.png
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,434
Reaction score
7,713
First Language
German
Primarily Uses
RMMV
yes there is - control variable, load the game data into the variable and then check the value of the variable with a conditional branch
 

Eff-n-Geoff

Veteran
Veteran
Joined
Oct 26, 2015
Messages
182
Reaction score
7
First Language
English
Perfect! So it's working now and the lighting effect too ... the only issues i'm encountering are ...

1) The MP only seems to reduce when I run, it needs to reduce constantly

2) The update frequency of the parallel event isn't immediate, is there a way I can get this to speed up?

Thank you so much for your help!
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,434
Reaction score
7,713
First Language
German
Primarily Uses
RMMV
2) The update frequency of any parallel depends on the number of waits inside - and is a matter of experimentation.


too few waits and the event will cause lag, slowing down everything.


too many waits and the check will not happen often enough, again slowing everything down.


The correct number is somewhere in the middle and depends on too many other things to be set generally.


Without wait, the parallel will run once per frame - sixty times per second - usually causing lag.


The wait commands tells it to skip some frames before running again - a wait(5) would result in the event being executed "only" ten times per second.


a wait(120) would result in a two-second-stop between two executions of the parallel.


Start with wait(5) and increas if too much lag, decrease if the event isn't called often enough


1) RM has no time in the game, if you want that you'll need to implement a time system, either by event or by script.


Event could be the same parallel that checks for zero, only reduzing the MP in addition to checking with the change MP command.


In that case however, you have to remove the trait
 
Last edited by a moderator:

Eff-n-Geoff

Veteran
Veteran
Joined
Oct 26, 2015
Messages
182
Reaction score
7
First Language
English
Fantastic, putting those waits in actually makes it all work a little quicker (as I didn't have any in there before)

The last piece of the puzzle is that the MP only reduces when the character moves, is there a way to get it to reduce constantly?
 

Eff-n-Geoff

Veteran
Veteran
Joined
Oct 26, 2015
Messages
182
Reaction score
7
First Language
English
Solved it ... I added a section to the common event that was being called to reduce the MP by one each cycle, that way I didn't have to mess around with the player stats too much ... job done.

Thank you for all of your help there Andar, brilliant!
 

Falcon At

Veteran
Veteran
Joined
Jan 6, 2014
Messages
35
Reaction score
25
First Language
SAE
Primarily Uses
MP regeneration/degeneration only ticks on movement. You need to set it to a parallel event instead. Have the event change MP and wait in a loop. That will allow you to tie battery power to frame rate and thus real time. 

[edit]: glad you figured it out! 
 
Last edited by a moderator:

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

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,051
Messages
1,018,549
Members
137,836
Latest member
T62352536256t362
Top