Buff & State Manager

Last Updated: 2012.01.26
Download Link
Github Link

This script alters some of the basic mechanics revolving behind states, buffs, and debuffs that aren’t adjustable within RPG Maker VX Ace by default such as being able to affect the turns remaining on a state, buff, or debuff without affecting anything else or even adjusting how many times a buff (or debuff) can be applied to an actor.

This script brings back the option to make turns visible for states, buffs, and debuffs. This feature can be turned off within the script. I’ve always found this to be helpful for both players and developers. Knowing when a state, buff, or debuff will expire can make a huge difference in a player’s strategy and it can help out with gameplay balance designing, too.

These notetag “traits” can affect the maximum number of times buffs and debuffs can stack. Use these traits on actors, classes, weapons, armours, enemies, and even states.

<max buff stat: +x>
<max buff stat: -x>

Increases or decreases the maximum times that particular stat can be buffed by x. Note that the max increase here is still limited by the module constant MAXIMUM_BUFF_LIMIT. Replace “stat” with “MAXHP”, “MAXMP”, “ATK”, “DEF”, “MAT”, “MDF”, “AGI”, “LUK”, or “ALL” for those respective stats.

<max debuff stat: +x>
<max debuff stat: -x>

Increases or decreases the maximum times that particular stat can be debuffed by x. Note that the max decrease here is still limited by the module constant MAXIMUM_BUFF_LIMIT. Replace “stat” with “MAXHP”, “MAXMP”, “ATK”, “DEF”, “MAT”, “MDF”, “AGI”, “LUK”, or “ALL” for those respective stats.

<state x turn: +y>
<state x turn: -y>

When the battler is affected by state x, additional modifiers are made to the number of turns remaining for state x by y amount. The modifiers cannot reduce turns to under 0.

Advanced users can adjust the buff and debuff formula to their liking. One of the things that irked me was how it wasn’t possible originally to modify this any bit. Well, now it is, and it can be done in formula format. Just adjust it within the script’s module.

When states are reapplied to battlers that are already affected by them, choose to ignore how the turns will be changed, reset the turns, or add up the remaining turns with what the state provides by default. These notetags go into the states notebox:

<reapply ignore>

If this state is cast on a battler with the state already applied, turns remaining will not be reset nor will turns be added on.

<reapply reset>

If this state is cast on a battler with the state already applied, the turns will be reset to the default amount of turns the state normally starts with.

<reapply total>

If this state is cast on a battler with the state already applied, the turns will be added on to the current amount of turns remaining giving the battler a total of the remaining turns with the default turns for the state.

Skills and items can now directly affect how many turns remaining there are to pre-existing states, buffs, and debuffs applied on a target.

<state x turn: +y>
<state x turn: -y>

If the target is affected by state x, this will alter the turns remaining on that state by y turns if the state can be removed by turns. If the state goes under 0 turns, the state will be removed.

<buff stat turn: +x>
<buff stat turn: -x>

If the target’s stat is buffed, this will alter the turns remaining on that buff by x turns. If the buff’s remaining turns go under 0, the buff will be removed.

<debuff stat turn: +x>
<debuff stat turn: -x>

If the target’s stat is debuffed, this will alter the turns remaining on that debuff by x turns. If the debuff’s remaining turns go under 0, the debuff will be removed.

And that’s all, folks!

60 comments on “Buff & State Manager

  1. I can only think of one addition: turn modification for enemies (…and actors/classes too, I suppose, but I’m mostly concerned with bosses). That way, Silence only lasts for a single turn on bosses, but lasts for three turns on normal foes (for example).

    • Yeah, I think having a static skill with +/-X turns for state Y would be very cool indeed. That way we can put it on selected enemies, characters, classes, everything else.

  2. Pingback: Start new Project – A dumb game ~ | Yami World

  3. I particularly like the possibility for skills to adjust state turns. Reminds of me Arnaud’s Extend spell in Wild Arms 4 – pretty awesome (like everything related to Arnaud in fact XD)

  4. I love this script! Though I’ve encountered a few bugs that have left me scratching my head in confusion. I’m using the latest updated scripts (Core Engine, Battle Engine, Buff State Manager) on a clean project.

    (1) Turn Number Display – Afflicted states (poison, blind) display exactly like in your screenshots, but all the buffs/debuffs have trailing decimals attached to them.
    Image: http://i.imgur.com/KMk8C.png

    (2) The turn numbers for states afflicted on the party only show up on the first character.
    Image: http://i.imgur.com/tONC5.png

    (3) Using REAPPLY_STATE_RULES = 2, the buff/debuff turns do not update and after several additional applications, it seems as if their state icons get switched around.
    Image: http://i.imgur.com/kQ3Hc.png

    And here’s the skill I’m testing the script with, in case the issue’s on my end: http://i.imgur.com/MIh4c.png

  5. I’m not sure if I should report this here or at the Battle Engine page, but eh.
    Remaining turn numbers are drawn only on the first character in battle. You can only see them during skill/item selection. I have the latest version of the script.

      • I’ll have to check this out in the morning but it appears that states after this first one still don’t have their timer countdown in a party of three.


      • Now they’re drawn only on the first two actors, and some times they aren’t drawn at all, lol.
        Maybe I’m doing something wrong… Also, I think there is a problem with “End of Action” states. They don’t stack/reapply properly here…

  6. Hi, noticed this while I was testing out a project. If there are more than 4 buffs/states, the numbers indicating the remaining turns on the buffs will still show for the additional buffs and extends past the character’s portrait.

    Here is an example:

    This only happens when the party is not at its maximum size.

    On another note, and this might not be the right place for it: is there an easy way to display more than 4 states/buffs on the player characters?

  7. Thanks for the find! The number of states and buffs drawn is relative to the size of the actor’s rectangle used. So the wider it is, the more states and buffs are drawn.

    v1.07 – Bug Fixed: Remaining turns aren’t drawn in excess.

  8. If it was compatible with Modern Algebra’s “State Icon Scroll”, then you would be able to display more than four states :D.

  9. Hello, once again I have a question.
    I made a skill which regenerates 1% of the MMP per round. It adds a state which has the feature “Ex-Parameter [MRG] + 1%”. If a Charakter learns the skill at the beginning the 1% are below zero, so it doesn’t regenerate any MP. Is there a way to add a tag that says that at least 1 MP ist regenerated?

    • I just found a simple way, just posting if someone else hast the same problem.
      I added MP Recover as damage type to the Skill and used 1 as the base value.

      • Ok… didn’t test it before I posted this, sorry. Didn’t work because it just regenerates 1 MP when the skill is used. So I still have the problem.

  10. Having the same problem as guttershark, when a debuff or buff is added to a character or enemy that already has them the icon changes, which is something I don’t want to happen, any suggestions?

      • Well, I wanted to change it so that when a mob re applies the state it doesn’t refresh it. I tried changing it in the script but that alone with no notetags caused that error as well, when I changed it back so that it reapplies it, it all works out. I tried notetags but that also caused the error as well. even on the empty project as well

  11. I have another problem with the script. Whenever a buff/debuf is used (DEF debuff for example) it shows up as “DEF[]|”.

  12. /\ Similar problem here, whenever a buff or debuf popups appear, the msg shows (for example, in atk) +ATK[]{ << read [] as SQUARE…
    I read the code and seems whenever it calls %s, which i assume is stat variable, a strange SQUARE appears
    PS: i've tested in a totally new project with ONLY this script added and the bug is there, so maybe its rly a bug

    • Sry, wrong script… this bug is caused in BATTLE SYSTEM script

      :add_buff => “%s{”

      %s is resultin ” STAT [SQUARE] { “

  13. I am confused by the explanation what the difference is between DEFAULT_BUFF_LIMIT and MAXIMUM_BUFF_LIMIT … they read as thought they do the same thing. Can someone clarify their use?

    • consider default buff limit as the limit for the entire game. Monsters, skills, weapons… whatever gives you a buff, wont go higher than default buff limit
      now, for the max, if you set a notetag saying +5 buff stat for atk, for example, the MAX VALUE will be used to prevent overbuff. In that case, it can go higher than DEFAULT LIMIT, but wont go through MAX LIMIT (but just if a notetag allow it to go higher than default!)

      • So DEFAULT is the limit the players have to hold to using in-game facilities such as active buffs and what-have-you. Where MAXIMUM is a psuedo-hardcoded limit that even stacking the bonuses through tags put on things by the developers cannot be bypassed.

        That makes sense. A sound idea for the script too.
        Thanks for that explanation.

  14. Can someone please explain to me the significance of the buff formula “buff_level(param_id) * 0.25 + 1.0”? and how the buff/debuff times limits actually function? Because none of it seems to matter from my testing.

    I can apply more than 4 buffs to the same stat, though skills and item equips, etc… And the Formula doesn’t seem to have any measurable effect. If the state is * 200% then the stat gets doubled, every time a new state with that identical buff is applied, no matter what. A 100 DEF with 5 identical * 200% buffs become 3200. (Using the Adjust Limits script as well)

    Besides having a nice visual rep of buffs and turns remaining, I am not seeing the math behind this… Am I missing something obvious?

    I am using a clean project with just the Core + Buff * State + Adjust Limits…

    Thanks!

  15. Ok, I figured it out… I had not messed much with the Param tab and finely stumbled onto it.

    In case anyone else finds themselves asking the same question… Apparently, there are generic BUFF & DE-BUFF stacks that can be applied to the basic class stat curve stats. (when making a skill they are listed under the effects Param tab)

    And the formula simply defines what those buff/de-buff stacks do mathematically to the stat they are stacked onto. Actual status effects with percentages are unique, and aren’t considered either buff or de-buff.

    /facepalm

  16. Is there any way to set what icons will be used when de/buffs are added? Once you go past 2 stacks it starts going into other icons, which is fine, I just want to be able to set those.

    Currently it’s going into my skill icons, and it would be a whole heck of a lot of work to re-do the whole iconset, and reset all the skill/weapon icons to make room for buffs.

    So, any way to set
    stack 1 = icon x
    stack 2 = icon y
    stack 3 = icon z
    etc.?

    • Starting at line 578:
      #————————————————————————–
      # overwrite method: buff_icon_index
      #————————————————————————–
      def buff_icon_index(buff_level, param_id)
      if buff_level > 0
      return ICON_BUFF_START + ([buff_level – 1, 1].min) * 8 + param_id
      elsif buff_level < 0
      return ICON_DEBUFF_START + ([-buff_level – 1, -1].max) * 8 + param_id
      else
      return 0
      end
      end

      I don't know exactly what to do here to fix it… but this does seem to be the section responsible for deciding buff/debuff icons.

  17. Hey, Yanfly!
    Can we possibly get an adjustment that allows us to adjust the Buff & Debuff formula? If we want to be able to apply a lot of buffs or debuffs we can end up with situations where an enemy’s stat is debuffed all the way down to 0 (or beyond technically) which gets really awkward, which sort of caps the ‘strength’ we can allow with them, without creating odd inconsistencies with “# of times you can debuff vs # of times you can buff”

    see SMT Nocturne: Each of 4 levels of debuff was -12.5%; but each of 4 levels of buff was +25%

  18. Would it be possible to create a state that does not show up on any of the menus? I’m trying to add a state based on party formation to all my troops, but would like to keep it from showing any visible visual effects, other than the stat bonuses provided for being in a specific row.

  19. Hey Yanfly! This is my first time commenting any of your scripts so let me start out with a huge THANK YOU for making scripts that make RPG Maker VX Ace a million times more fun to use! Your scripts take it from pretty good to amazing!

    All of my parameters are basically being divided by 10. If I have an actor set to a class that has its level 1 hp set to 446, they will only have 44 hp in game. If their attack is 21, it is only 2 in game. This seems to happen to enemy stats as well, so that the functionality isn’t actually ruined, but I don’t think the change is intended.

    I replicated this bug in a fresh project with only the Yanfly Core and this script to make sure it wasn’t a compatibility issue.

    Any help would be greatly appreciated! Thanks for your time and amazing work!

  20. hello yanfly. i have a little problem in this script. I wrote in stun state notebox. Then i battletest one enemy that 100% chance stun attack. After the first stun applied to my char, the game crash. i don’t know why but the errorbox said that there is error in ‘game_battler’ script line 245. After that, i tried erase ” in state notebox and try the game again. This time, the game went smoothly. Please help me what i should do to fix this problem.

  21. I have a Question, would it be Possible to make A Status/Script, that changes a Status, based on the Status, for Example:
    you either apply/stack the Burn Status, OR you remove the Wet Status
    would love to make Status effects that play/combine with each other like this
    (wet gives you Burn Immunity, Burn gives you Wet Immunity, but one of those effects removes the over… or, is applied if the over is missing)

  22. Hey Yanfly, though I find it highly doubtful that you still check these, just in case I have a small question.
    As I’m sure you already know, the VX Ace’s custom formula box, along with your own Lunatic Damage script, allows for the targeting and damaging of an enemy while still applying or altering the states of the character. A very useful ability for any skill that will do greater damage at the cost of a weakened state or short debuff. But sadly this script’s ability to alter how skill’s affect states and buffs only applies to the original skill’s scope. If it target’s an enemy, it can only alter the states of that enemy. Any state or buff applied to the caster through custom formula are cannot be altered by this script.

    For all my lack of scripting knowledge, I’ve broken down this script rather nicely and have a strong gist of how it works, but have yet to find a way to make an enemy targeting skill alter the states of the caster. If you or any of your more script-savvy followers could show me how to edit the script into doing this, if not out right update the script to have this functionality, I and I’m sure plenty of others would greatly appreciate it.

  23. Pingback: DoubleX RMVXA Enhanced YSA Battle System: Classical ATB | doublexrpgmaker

  24. Pingback: RMVXA Scripting Proficiency Levels | doublexrpgmaker

  25. Is it possible for me to make the formula for the buffs work for only one actor? I applied the formula in the damage style box, modified for that character (1.0 + 1.0 with a buff limit of 1), and it worked great when I first got it working, but the next day it refused to use anything else but the default forumla.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s