RPG Maker Forums

State Duration Rates


by lilyWhite


While VX Ace allows you to modify individual characters' chance of being afflicted by states, there is no way by default to allow modifiers on how long a state lasts. This script allows you to use element rates as modifiers on the duration of states. This is completely independent of the rate of inflicting the state, so this can be used, for example, to have enemies that are easily afflicted by a state but shake it off quickly or enemies that are difficult to land a state on but have it last a very long time.


To use, add this notetag to the state notes, where "x" is the number of the element rate you wish to use for the state:

Code:
<stateelem: x>
Then simply assign the element rate as normal. (i.e. >100% = longer duration, <100% = shorter duration)


Free for use in any commercial or non-commercial project! Credit to "lilyWhite"; I reserve the right to be slightly miffed if you get the capitalization wrong. :3


The script is within the spoiler below. Just copy into the Script Editor—no configuration required!

Code:
=begin

  = State Duration Rates, by lilyWhite =
  This simple little script allows you to use element rates as a modifier to
  the duration of states.
  
  To use, add this notetag to the state:
  
    <stateelem: x>
    
  where x is the number of the element rate you wish to assign to the state.
  Then simply assign the relevant element rate to whatever as usual. The
  resulting duration rounds to the nearest number, up or down.
  
  Usage: Free to use in any commercial or non-commercial project! Credit to
  "lilyWhite"; I reserve the right to be slightly miffed if you get the
  capitalization wrong. :3
    
=end

class Game_Battler < Game_BattlerBase
  #--------------------------------------------------------------------------
  # * Alias reset_state_counts
  #--------------------------------------------------------------------------
  alias elem_rate_state_counts reset_state_counts
  def reset_state_counts(state_id)
    elem_rate_state_counts(state_id)
    state = $data_states[state_id]
    if stateelem(state)
      @state_turns[state_id] = (@state_turns[state_id] * element_rate(stateelem(state))).round
      @state_steps[state_id] = (@state_steps[state_id] * element_rate(stateelem(state))).round
    end
  end
  
  #--------------------------------------------------------------------------
  # * Get State Element Rate
  #--------------------------------------------------------------------------
  def stateelem(state)
    if state.note =~ /<stateelem: (\d+)>/i
       return $1.to_i
    end
  end
end

Latest Threads

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,450
Members
137,820
Latest member
georg09byron
Top