Temporary Buffs that last multiple fights

Hi there guys and gals!

I´ve been tinkering around with my project and made save points that work as healing and teleport points aswell (this is all working)
Now i figured whats the point of having Inns where i can sleep and heal up if i have free healing at save points other than maybe
a cutscene.
So i thought to myself about adding a "Well Rested" state that you get for sleeping at Inns (to justify the cost for healing at Inns)

How would i go about creating a state that lasts lets say 15 minutes or over the course of a set amount of battles or something like that?

By regular means states can be bound to how many steps you can take until it ends
this can make the buff either super efficient or super underwhelming depending
on how many encounters you get during this period.
So either a buff timer or encounter limit would be ideal.

Would be gratefull for input and ideas 😛

Greetz Dan
Moved to: RPG Maker MV SupportThat is the correct board for "How Do I?" type questions (unless you believe they will require Plugins, in which case use the Plugin Requests board). Please only use the MV Deployment board for issues/questions about creating a playable end product from your finished project. (I know the multitude of boards can get confusing; just giving you this info to clear things up a bit!)

There are several approaches you could use for multi-battle buffs, but what I would probably do is to use a Stackable States plugin, and at the start or end of each battle (note that reliably doing it at the end of each battle would require an additional plugin such as this one), reduce the number of stacks of the buff by one - and if it becomes zero, remove the buff. A good approach whenever you're making an event that needs to be run in every battle is to use a Common Event - have an event in each troop that simply calls this Common Event at the right time (start or end of battle).

However, if the only type of multi-battle buff you want to use is buffs that affect the entire party (such as the Well Rested buff you'd get from an Inn), then you can do it without Stackable States. You can simply set a variable when the player rests at an Inn (e.g. set Variable #28 to the value 5 for a 5-battle buff), and at the start of each battle (Turn 0), if the variable is greater than 0, apply the state or buff to the party. Then, decrease its value by 1. After you've fought 5 battles without resting, Variable #28 will be 0 (or less), so when this event is run in subsequent battles, the buff will not be applied, which is what you want.
oh my bad. thanks for moving it to the correct area ill pay better attention next time.
thanks for the reply i will test what works best for the situation. probably gonna go with the later variable
version of the buff thanks a ton!

Greetz Dan
Okay i kinda feel dumb right now maybe ive been looking at it too long.
I cant seem to set it up 😅
I hate to be a bother but could i get a more detailed explenation for the above mentioned variable setup to
get my state buff working?
Im stuck and cant seem to work it out myself...
I guess ill come back to this problem at a later time when i gathered more experience and knowledge.
I got it to work. It doesnt look nice or clean but it works.
Probably a better way but i cant seem to find it.
Im using Yanflys Base Troop events for a reverse mana system so it comes in handy with this aswell.

In Troop Events i have this now:

IF: Well Rested ≥ 5
Control Variables: #10 Well Rested -= 1
Else:
IF: Well Rested ≥ 4
Control Variables: #10 Well Rested -= 1
Else:
IF: Well Rested ≥ 3
Control Variables: #10 Well Rested -= 1
Else:
IF: Well Rested ≥ 2
Control Variables: #10 Well Rested -= 1
Else:
IF: Well Rested ≥ 1
Control Variables: #10 Well Rested -= 1
Else:
IF: Well Rested ≥ 0
Change State: Entire Party, - Well Rested
End

Sleeping at the Inn adds the Well rested state
after 5 encounters it gets removed.
Hi, if I understood, this event is run once per battle (at the start). In that case, the last 2 lines would be sufficient.
Code:
IF: Well Rested > 0
Control Variables: #10 Well Rested -= 1
Else:
Change State: Entire Party, - Well Rested
End
Hi, if I understood, this event is run once per battle (at the start). In that case, the last 2 lines would be sufficient.

Code:
IF: Well Rested > 0
Control Variables: #10 Well Rested -= 1
Else:
Change State: Entire Party, - Well Rested
End

I think i had tried that but had the issue that it wouldnt properly count down. ill give it another try.
Thanks

Edit:
Oh wow... Im a dolt... i had the initial setup wrong but the end correct and instead of setting up the start right i re-did the whole thing 😅. And suprise suprise it works just the way you said it should.

Thanks a ton TSR!


One more thing.
Is there a way to make it check the event at the end of combat instead of start?
Right now (thank god its working and i hope i dont ruin it again haha😅)
it checks the event at the beginning of the combat so it will count down to 0
but until i enter the next fight it will still be active (because it counts down and removes it at the start of battle rather then at the end)

Right now the state ends once the counter reaches 0 but you can still see the state active in the menu until the next encounter. It doesnt look nice and bothers me
Glad it help!
As someone says above, you'll probably need a plugin to have an event checked at the end of battle... What come to my head right now would be 'Yanfly Utility Common Event', it enable you to trigger commen events at some time point in the game such as upon loading the game or after each battle won or battle escape. It is a plug & play plugin, so you just have to set your common event to trigger at each battle end in the plugin options.

But before you try that, just out of curiosity, what happen if the state is remove at countdown 1 instead of zero?
just out of curiosity, what happen if the state is remove at countdown 1 instead of zero?
I had the same idea. It does the same thing. Its still active in the menu but not in the next encounter.

Ill check the plugin.
Thanks! Your the man!

Ill have to wait with the plugin.
Its 1$ but i dont have a credit card or paypall account 😛
(but id be more then glad to pay for it)
Oki then,
good luck with that!
Alright a upate on this.
I was just about to buy yanflys utility common event plugin when someone told me
that although it works the escape mechanic is bugged and they refered me to smrd´s plugin that does the same thing
and ...pause for dramatic effect....
IT WORKS!
Yay!
Thanks for all the time and effort in helping me!
Cool!

Original thread: https://forums.rpgmakerweb.com/threads/temporary-buffs-that-last-multiple-fights.115467/