Tiered States
#1
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.
Reply }
#2
Nice. Very nice. *nods approvingly*
Reply }
#3
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.
Friendship is born at that moment when one person says to another: "What! You, too? Thought I was the only one." (C.S. Lewis)
For the time you're laughing, there's nothing wrong in the world. (Colin Mochrie)

If it's funny, make sure people laugh. If it's not funny, make it funny (unless it's actually really serious). (silvercheers)

Please don't spell my name "Yamina-chan". It's all small. Thank you =D
Reply }
#4
I had no idea 4shared required an account now. Any recommendations on a file host?
Reply }
#5
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.
Friendship is born at that moment when one person says to another: "What! You, too? Thought I was the only one." (C.S. Lewis)
For the time you're laughing, there's nothing wrong in the world. (Colin Mochrie)

If it's funny, make sure people laugh. If it's not funny, make it funny (unless it's actually really serious). (silvercheers)

Please don't spell my name "Yamina-chan". It's all small. Thank you =D
Reply }
#6
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.
Reply }
#7
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.
Reply }
#8
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
Reply }
#9
you could have also used box.net...

why does no-one use that?
"Turning iron ore into iron swords is a hard process, for one must first dig out the rock, and melt it to refine it, then one must pour that metal into a mould, let it cool a bit, and pound on it while it cools even further. Games are no different." - Ahzoh

Universal Declaration of Human Rights in Vrkhazhian
ʾEšol ḵavud ʾelẕakud lav ʾezʾaẕud zwazaršeru ya lit žalneru lav lit t͛enud. Ṗal sa-ražheru lav raržižu paplam lav ṗal widsaṟam bemaḵu šuku lit ʾeyṭu waẏnilaẇ.
All human beings are born free and equal in dignity and rights. They are endowed with reason and conscience and should act towards one another in a spirit of brotherhood.
Reply }
#10
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
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   KDamage States XP kyonides 0 1,022 06-29-2023, 02:20 AM
Last Post: kyonides
   Kolloseum States XP kyonides 55 72,253 02-26-2019, 08:28 AM
Last Post: kyonides
   Unalterable States DerVVulfman 0 4,229 01-22-2019, 01:04 AM
Last Post: DerVVulfman
   States : Expiration States Kain Nobel 1 6,707 01-26-2017, 09:45 PM
Last Post: Noctis
   DVV's States Rotation DerVVulfman 5 10,022 04-21-2016, 05:41 AM
Last Post: DerVVulfman
   States : Toggle Kain Nobel 0 4,986 10-09-2012, 05:22 PM
Last Post: Kain Nobel
   States : Spread Kain Nobel 0 4,802 10-09-2012, 05:04 PM
Last Post: Kain Nobel
   States : Spread Kain Nobel 2 6,294 07-10-2012, 04:44 PM
Last Post: Kain Nobel
   Kristina's Map States DerVVulfman 1 6,199 06-30-2010, 09:33 AM
Last Post: Nadim
   States Activation System aka State-Based Passive Augments, Version 0.2 Charlie Fleed 7 12,922 03-06-2010, 09:26 PM
Last Post: fgsfds



Users browsing this thread: 2 Guest(s)