Progressive States

Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

This script adds “progressive state” functionality to your project.

A progressive state is one that automatically changes to another state after a certain amount of actions or turns have passed if the state is not removed before then.

progressiveStates1

Download

Script: download here

Installation

Place this script below Materials and above Main

Usage

Add the following note-tag to a state

<progressive state: x>

For some state ID x. When the state is automatically removed due to timing
(turn count, action count, steps taken), the new state will be applied and the
old state removed.

Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

You may also like...

30 Responses

  1. Anonymous says:

    I am close to a begginer and I don’t undersatnd how to count turns using your progressive state sript.. Do i have to work with your “state charge” script also? And also, if i want to do simple damage after 3 turns (not a state like poison or death), is it possible with your script? Will the damage be randomized or on the target? I would prefer to be

    For example, i want to throw a tomatos at the ennemy, making no immediate effet else than a red splash animation (if possible). But in 3 turns.. a wild animal surge from the forest to attack the targetted ennemy (cause it’s like blood).

    Extra: if i can make the “wild animal” appear in the battle, like in a summon or pet i would be great too.. I saw Vlue made a script called “Pets and Summons” but it uses characters and that poses the probleme of “what if the party is already full” and limited graphics of heros in battle.

    Thanks for your precious help! 😀

  2. AT says:

    Question: I’m trying to make a berserker state that, once HP hits 0, gives the user three more turns before dying. In order to do this (from what I can tell), I would need two states: the 1st Beserk, which gives all the buffs and a Death immunity until health hits 0, and the 2nd beserk, which disallows healing and damage and ends in death. Any hints or ideas on how I could do this?

    Thank you for all your hard work!

    • Hime says:

      Hmm, there are some other plugins you will likely need since the default state functions probably aren’t enough for this.

      When the first berserk state is applied, that state would have knockout resistance at 100% so you don’t die.

      But then you need to have the state disappear 3 turns after it’s applied, so it would make sense to use a second state for this as you have said.
      So the question is, how do you apply a new state when you have zero HP?

      I think a new plugin will be needed that would allow you to add or remove states when a certain HP amount has been reached.

  3. SamHain says:

    I did a bit more playing around and think I found another issue. If you have a series of progressive states that have both turn-based and step-based removal, after a few stages in the progression things start to get a bit weird.
    I’m using NeonBlack’s State Graphics, which after running Progressive Scripts in a new project with and without State Graphics I’ve found doesn’t seem to interfere with Progressive States, but did give me a visual indicator that something is up. To get State Graphics to actually change the graphic of the character on the map when progressing by steps, I modified

    def add_progressive_state_by_steps(state)
    if @state_steps[state.id].nil?
    add_state(state.progressive_state)
    end
    end

    to

    def add_progressive_state_by_steps(state)
    if @state_steps[state.id].nil?
    add_state(state.progressive_state)
    $game_player.refresh
    end
    end

    Which when it was remove-by-step-only had everything working smoothly.

    So a bit of background: I have a progressing poison set up with 6 stages.

    When I have it set up so that it only progresses via turns in battle, or only progresses via steps taken, there is no problem; everything works the way it should (including State Graphics). But, when I set the states to progress after X turns and also set the remove by walking, things get a bit off.

    In battle, everything continues to work perfectly. States progress as they should without a hitch. But outside of battle, I have the poison set to progress every 10 steps. Here is what happens.

    Stage 1 to Stage 2: happens normally, progressing (and changing graphics) at step 10.
    Stage 2 to Stage 3: progresses at step 10, but the graphic change that should occur due to NeonBlack’s script doesn’t occur.
    Stage 3 to Stage 4: state graphic applies, but state progresses at step 9, not step 10.
    Stage 4 to Stage 5: progresses normally
    Stage 5 to Stage 6: progresses after 1 step, graphic doesn’t change.

    Any thoughts?

    • Hime says:

      It's a bit strange, but this little piece of info should provide some insight.

      First, turns exist outside of battle: one turn is equal to 20 steps. For every 20 steps that you take, the game executes "end of turn" processing which would for example decrease all state turns by 1.

      A turn is always every 20 steps, regardless of when the state is added. 20, 40, 60, 80, 100, etc. Now, if you happen to add a state that lasts one turn on your 19th step, the next step you take will trigger the end of turn processing and remove that state.

      This explains stage 2 to stage 3: on step 10, the state is removed…however, it was not removed because you took 10 steps; instead, it was pre-empted by the end of turn processes.

      To verify this, search for the turn_end_on_map method in Game_Actor and add the refresh call there.

      Now, the next mystery is also caused by this turn ending. If you look at the on_player_walk method, you can see that the order of calls is

      1. Check if turn has ended
      2. Update state steps

      From before, we see that the state has been removed due to the turn ending. This is the key: progressive states goes ahead and adds your new state and resets the step count to 10.

      Now what happens? The game proceeds to update state steps, subtracting the count by 1. And then 9 steps later, the count goes down to 0, the state is removed, and it progresses to stage 4.

      The bug here is due to the way turns and steps are handled, as well as when the progressive states are added. If it was strictly turns or strictly steps (and strictly in battle), then the issue does not occur. However, if you mix both removal types AND you're on the map, now you have this situation where your state can be removed by turn count, and then the steps are changed at a bad time.

      In order to address this issue, it would potentially be necessary to NOT add the progressive state immediately after the old state has been removed, but to queue it somewhere and then process it when all of the updates have been performed.

      • SamHain says:

        This insight was quite helpful. I wasn’t aware of turns persisting on the map. I was using 10 steps on the poison just for the test run, and the number of steps isn’t something I’m dead-set on.

        Rather than pull a typical needy non-scripter routine and ask you if you can do all the work of altering the script, I want to see if the simpler solution that comes to mind is viable.

        Assuming that 20 steps is, essentially, 1 turn, if I leave the progressive states as both turn-based and step-based, if I simply had them progress after 20 steps (or 40 steps for a state lasting 2 turns, 60 for one lasting 3, etc.), would that sync up the removal countdowns while on the map?

        • Hime says:

          I don’t think it would, as turns are based on party steps: if you take 15 steps, add a state, and then take another 5 steps, you will have taken 20 steps, and a turn will end. You would then take a turn off the state, even though you clearly haven’t had the state for a full turn yet.

          The two conditions therefore conflict: no matter how many steps you take, you are bound to run into an end-of-turn process. If you just happen to add the state 1 step before a turn is over, the next step you take, the turn will end.

          • SamHain says:

            Hm. That’s a bit vexing. Oh well. I guess I can handle it with two sets of states and parallel eventing. Thank you for the insights; they were most helpful.

  4. SamHain says:

    After a bit of testing, trial, and error, I discovered a minor incompatibility with this script and your State Charges script. With State Charges installed, Progressive States works fine for turn-based removal, but a remove-by-step progressive state will be removed on the appropriate step count without adding the new state in the progression.

  5. VR0 says:

    In all FF, is used for “Condenm” state, making all affecteds KO if don’t end the battle.

  6. Demos Kerrigan says:

    The script is extremely interesting. But I wonder if there’s any way to modify it so it can be for passive stats by step count only.

    Example : Someone walks into a desert and it’s afflicted to the state (dry), if a certain amount of steps (if possible to specify by individual actor it would be great too ^^”), then its states is set to KO since the actor went into coma because it didn’t find water in time.

    I appologize in advance if I asked too much ^^”

    • Demos Kerrigan says:

      About the way to config if it’s by step, action or turn, don,t mind about it. I just didn’t notice there was an option in the state database ^^” (I’m really sorry for having not noticed it, I hope you can forgive me ^^)

      • Hime says:

        I guess that would solve your problem?

      • Demos Kerrigan says:

        Technically yes. ^^. But I was still wondering if there was a way to increase or decrease the step limit depending the actor or class. Or I must have a script made especially to manage each actor’s step cap. ^^”

      • Demos Kerrigan says:

        Also, I wanted to specify that it wasn’t a request, but simply a question. And I forgot something fundamental that I usually do which is to thank you for every answers you’ve provided me so far. I’m deeply grateful for all the helps you’ve given to me. As always, stay awesome as you are. ^^

  7. SirCumferance says:

    Shoot, it could even be just when the state ends from being hit…HULK SMASH!!

  8. SirCumferance says:

    Can we take it another way, like if the state is removed (not just the turns) it progresses as well, maybe like an add on to this. I am thinking of an armor buff that degrades everytime you get hit…you know?

    is for the turns before change but…
    is for when the state ends

    Is that difficult? I was looking at the script and am not even sure of the syntax of how to do it or where to try

  9. Amelandui says:

    So… basically, you can make something similar to Toxic from pokemon, right?
    Nice :3

  10. rapture says:

    is possible to do that?
    i want to add a “bleeding effect” when someone attack via critical hit or 5% chance to start the state (i must test that point) represented with Ex-paramenter [HGR -3%] ok. Then, if someone inflict another attack that start the state it will be added with a progressive state wich up to 6% de dmg x turn? is possible to “stack” effects like this? or same with poisoning who is already poisoned?

  11. I was wondering if there was a way to do a progressive skill as well.

Leave a Reply

Your email address will not be published.

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax