Buff stays at 0 turns left. Doesn't happen with states. Is it intended?

Lnik3500

Master Troll
Veteran
Joined
Feb 26, 2015
Messages
314
Reaction score
49
First Language
French
Primarily Uses
RMMV
Hello!
It's basically what the title says. Whenever I apply a buff for 1 turn, it will actually last the turn after.
Looking up the turn counter returns 0, but is only removed the turn after.

Is this intended?

and is there a fix or I just need to cope with it?
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,140
Reaction score
14,645
First Language
English
Primarily Uses
RMMV
are you using any plugins?
 

Another Fen

Veteran
Veteran
Joined
Jan 23, 2013
Messages
606
Reaction score
318
First Language
German
Primarily Uses
From what I can tell this seems to be intended. Durations are updated at the end of each turn, but buffs (and "on action end" states for that matter) stay until the end of the next action.

As for fixes, if the buff is supposed to last one action you could set its starting duration to 0.
Alternatively you could use a state instead (which is generally more flexible than a buff).

If you want to use a plugin to remove buffs at the end of a turn instead you could try something like this:
Code:
/*:
* @plugindesc Remove buffs at the end of a turn
*/
(function() {
  
    var lastOnTurnEnd = Game_Battler.prototype.onTurnEnd;
    Game_Battler.prototype.onTurnEnd = function() {
        lastOnTurnEnd.call(this);
        this.removeBuffsAuto();
    };
 
})();
 

Lnik3500

Master Troll
Veteran
Joined
Feb 26, 2015
Messages
314
Reaction score
49
First Language
French
Primarily Uses
RMMV
@Another Fen Hello, this plugin you just created actually solves the problem I had!
It switched the buff to turn end like my states would

Thank you ^w^

For anyone else in case: Buffs actually last a turn more than you specify since it gets removed on action end even once it has 0 turns left. This is by default in the engine.
 

Latest Threads

Latest Profile Posts

I've been working on something on and off for a few years now, and I've been reluctant to share any details on the project before I had anything playable because I did not want to generate hype only for the project to go back on hiatus. That being said I believe what I'm working on is very unique and pushes the boundaries of what RPG Maker projects can be. Bold claims, I know but just wait.
Happy Mother's Day to all the moms :)
Create Anime Art w/ AI, Tall Sprites with Aurora, Customize Variable Display | RPG Maker News #34

[My favorite slow moving track I've made so far]
dd_airport2.jpgdd_combat.jpg
dd_town.jpg
I did an experiment to try to solve the art style problem between RTP and 3D models.
But, it feels this grimdark world is going to end even faster. :kaoswt2:

Forum statistics

Threads
111,193
Messages
1,059,173
Members
144,440
Latest member
Kono
Top