Save-Point
Tiered States - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Material Development (https://www.save-point.org/forum-8.html)
+--- Forum: Scripts Database (https://www.save-point.org/forum-39.html)
+--- Thread: Tiered States (/thread-4638.html)

Pages: 1 2


Tiered States - MechanicalPen - 04-27-2013

Tiered States

Version: 1.0



Introduction

This script allows your RPG Maker XP project to have state effects that stack like in Pokemon or MegaTen.
It does this by applying a more powerful version of the state whenever the specified state already exists.


Demo

Here



The Script
Tiered States



Instructions

A hash of states with tiers needs to be provided at the beginning of the script. The key is the default state, the one that is applied when no states of this type are currently attached to the battler. The value is an array of the different tiers, in order of power from left to right.

In the demo provided, a way to have negative effects cancel out positive effects is shown.



Credits and Thanks

This script is based on Kain Nobel's States : Toggle script.



Terms and Conditions

Do whatever.


RE: Tiered States - MetalRenard - 04-27-2013

Nice. Very nice. *nods approvingly*


RE: Tiered States - yamina-chan - 04-27-2013

At first I thought it was tired states and was scratching my head in confusion. XD
The idea is nice, certainly =) I haven't tried it yet, but if it works it is a nice addition ^^
I would suggest however that you provide a download link for your demo that does not requite others to make an account. Unless you have one anyway, it is an annoyance and prevents some people from giving this a go.


RE: Tiered States - MechanicalPen - 04-27-2013

I had no idea 4shared required an account now. Any recommendations on a file host?


RE: Tiered States - yamina-chan - 04-27-2013

mediafire.com is a great page, as you neither need an account not have to wait a certain amount of time untill you can download. You as a host do need an account tough.
filedropper.com is also usefull, but you have less controll over your own files. Same with 2shared.com Both do not requite and account to upload or download.


RE: Tiered States - MetalRenard - 04-28-2013

You could also make an account on Dropbox. If you use this link you'll get free space, and me too: http://db.tt/JprwsOH
After that you just drop files in your "public" folder and give out the link.


RE: Tiered States - MechanicalPen - 04-28-2013

I switched the link to a 2hared one, but I'll be sure to use that link if I am ever in need of a dropbox.


RE: Tiered States - Karindanslav - 08-07-2013

This is exactly what i was looking for! Will it work for VX Ace? If not, is there any way you could make it so? I have zero scripting knowledge =(

EDIT: Forgot to add, but it seems to me that your download link is broken. I was able to find the demo file on 4shared by googleing the file name


RE: Tiered States - Ahzoh - 08-07-2013

you could have also used box.net...

why does no-one use that?


RE: Tiered States - MechanicalPen - 08-08-2013

I could certainly try to make it work for VX Ace. It's not that complicated of a system I just need to know how VX Ace applies states.

Edit: Dowloaded VX Ace Lite just for you. It is both less and more confusing than RPG Maker XP.

So, try this; I have no way to test if it works, so let me know.
Code:
#=============================================================================
# * Tiered States
#=============================================================================
#===============================================================================??
# ** RPG::State
#===============================================================================??

class RPG::State
  #-----------------------------------------------------------------------------
  # * Tiered States
  #     States are applied left to right, starting at the state before the =>.
  #
  # The example provided allows for negative states (stat-downs) to be
  # counteracted by positive states (stat-ups)
  #-----------------------------------------------------------------------------
  Tiered_States = {
                  20 => [24, 23, 22, 21, 20, 19, 18],
                  22 => [18, 19, 20, 21, 22, 23, 24]
                  }
  #-----------------------------------------------------------------------------
  # * has Tiered State?
  #-----------------------------------------------------------------------------
  def tiered?
    Tiered_States.include?(@id)
  end
  #-----------------------------------------------------------------------------
  # * How many tiers?
  #-----------------------------------------------------------------------------
  def tiers
    return Tiered_States.fetch(@id, [])
  end  

end
#===============================================================================??
# ** Game_Battler
#===============================================================================??

class Game_Battler
  #-----------------------------------------------------------------------------
  # * Alias Listings
  #-----------------------------------------------------------------------------
  alias_method :mpen_default_add_state, :add_state
  #-----------------------------------------------------------------------------
  # * Add State
  #-----------------------------------------------------------------------------
  def add_state(state_id)
    if $data_states[state_id].tiered?
      
      for i in 0...$data_states[state_id].tiers.size
        current_tier = $data_states[state_id].tiers[i]
        next_tier = $data_states[state_id].tiers[i+1]
        if self.state?(current_tier)
          if next_tier == nil
            #tier at maximum, regular state rules apply
            mpen_default_add_state(current_tier)
            return
          else
            remove_state(current_tier)
            mpen_default_add_state(next_tier)
            return
          end
        end
      end
      #no tiers applyed yet, default behavior.
      mpen_default_add_state(state_id)
    else
      #no tiers exist, default behavior
      mpen_default_add_state(state_id)
    end
  end
  
end