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
41,937
Reaction score
14,556
First Language
English
Primarily Uses
RMMV
are you using any plugins?
 

Another Fen

Veteran
Veteran
Joined
Jan 23, 2013
Messages
604
Reaction score
315
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 Posts

Latest Profile Posts

Whenever I start on a new chapter, it doesn't feel like the next episodes, but more like sequels :)
It can be frustrating that so many commercial games have used up titles that might otherwise be great for a project.
Light up explosions with QABS and Community Lighting.
qcPQHt9.gif

Forum statistics

Threads
110,655
Messages
1,054,985
Members
143,779
Latest member
Epitaph78
Top