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,930
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 Profile Posts

Doing RPG Maker News #18 | Moghunter is Back, Encrypt MV/MZ Plugins, Isometric Geometric Tiles
Unironically, no joke, after consideration and self-reflection, I have decided that the best thing for my creative/workflow/commitment problems is to spend EVEN MOAR hours a day playing videogames than I normally do. (Micro-thread)
FINALLY got my weather system implemented. Who needs a black mage when you have a weathermancer! :p
Oh boy! COVID19 lockdown again! Good thing I already never go outside! :D
This one is less showing off and more 'I really don't know how I feel about this one.' The 'child' sprite template I made either works great or doesn't at times. (She is a fairy, so I made her small).
Morgan.png

Forum statistics

Threads
110,640
Messages
1,054,894
Members
143,767
Latest member
Kaelith001
Top