Automatic state activation based on MP?

Status
Not open for further replies.

Grayborders

Maniac, Lunatic, Crazy
Veteran
Joined
Oct 19, 2013
Messages
146
Reaction score
79
First Language
Hungarian
Primarily Uses
Hi there this might very well be an ultra noobie question but i cant figure this one out and after 1h of google i stil cant find how to do this.

I`m trying to activate a state when mp reaches 0, i alos want to set up states wich have a % chance to trigger when mp is 0. This whould happen for ALL battles and all characters so not just the actors. I really feel stupid for asking this but i just cant find this, is it a script? like the one that triggers death?

I`d really appriciate if somene pointed me in the right direction.

My other Question is whats the best way to make a state have the effect where it takes 100% of demage taken and deal it to another stat, example whould be when the state is active instead of taking hp demage the whole of the deamge is aplied to mp, i found scripts that convert demage that is dealt by the players, but i need a way to have a state wich while active transfers all demage to mp.
 
Last edited by a moderator:

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,513
Reaction score
3,203
First Language
Binary
Primarily Uses
RMMZ
Not that hard. here you go.

Place this script below anything that overwrites the refresh method in Game_BattlerBase.

Use the customization to suit your needs.

#==============================================================================##                      http://dekitarpg.wordpress.com/                         ##==============================================================================#module MP_Status#==============================================================================#    # State ID for the state that is added when MP reaches 0. this state is   # removed Once MP is above 0.  MP_Empty = 1    # These are the states that have a chance of beign appliedwhen mp reaches 0.  # Format of array is [state_id, percentage_chance],  Chances =[     [2, 25],     [3, 25],  ]    # Maxmium Percentage, recommend to keep 100.  Max_Chance = 100  end #==============================================================================#class Game_BattlerBase#==============================================================================#  #----------------------------------------------------------------------------#  # Alias List  #----------------------------------------------------------------------------#  alias :alias_G_BB_refresh :refresh  #----------------------------------------------------------------------------#  # Refresh  #----------------------------------------------------------------------------#  def refresh    alias_G_BB_refresh    mp_state_checks  end  #----------------------------------------------------------------------------#  # MP State Checks  #----------------------------------------------------------------------------#  def mp_state_checks    return remove_state(MP_Status::MP_Empty) if @mp > 0    add_state(MP_Status::MP_Empty)    MP_Status::Chances.each do |data|      next unless data    != nil      next unless data[0] != nil      add_state(data[1]) if rand(MP_Status::Max_Chance+1) < data[0]    end  end end#==============================================================================##                      http://dekitarpg.wordpress.com/                         ##==============================================================================#I think Tsukihime made a script that allows you to convert damage from HP into MP whilst a state is applied. dont know for sure though but convert damage scripts would be your best bet.
 
Last edited by a moderator:

Grayborders

Maniac, Lunatic, Crazy
Veteran
Joined
Oct 19, 2013
Messages
146
Reaction score
79
First Language
Hungarian
Primarily Uses
Not that hard. here you go.

Place this script below anything that overwrites the refresh method in Game_BattlerBase.

Use the customization to suit your needs.I think Tsukihime made a script that allows you to convert damage from HP into MP whilst a state is applied. dont know for sure though but convert damage scripts would be your best bet.
Oh wow.... that was quick THANK YOU VERY MUCH :) I do have 1 question tough, i`m not sure yet but my porject might end up turning commercial, in case it dose what are the terms of use? The last thing i want is uncredit and missuse anything this great community offers.

Edit: I cant find the script, i found his site, and looked throgh all his scripts but no convert demage or anything that is staterelated that whould remotely do this, you dont mean Yanfly by any chance? cause his converter only converts demage for formulas and dont work for states.
 
Last edited by a moderator:

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,513
Reaction score
3,203
First Language
Binary
Primarily Uses
RMMZ
for that little bit of code i would be happy with credit, use as you wish.
 

Grayborders

Maniac, Lunatic, Crazy
Veteran
Joined
Oct 19, 2013
Messages
146
Reaction score
79
First Language
Hungarian
Primarily Uses
for that little bit of code i would be happy with credit, use as you wish.
Awsome, thanks again, if i end up commercial i will sure to donate towards every free scripters. I`m so amazed by this community.

Stil cant find the convert damage tough, but will figure it out somehow :)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
One point with the above (Dekita can confirm/deny) - this would apply to your own battlers AND to enemies. If you only want it to apply to actors, a slight mod would be required to point it at the Game_Actor class instead of Game_BattlerBase.


For the convert damage script, did you check through the Master Script List? You can sort it by Author and just look through Tsukihime's scripts.


Moving to Script Requests
 
Last edited by a moderator:

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,513
Reaction score
3,203
First Language
Binary
Primarily Uses
RMMZ
I can confirm that if you want it to effect actors only you only have to change the class...

However, its easier to just redefine the method "mp_state_checks" within the game actor / game enemy class(s) and call super...

Actually, it will only take about 1 minute from my life...

#==============================================================================##                      http://dekitarpg.wordpress.com/                         ##==============================================================================#module MP_Status#==============================================================================#    # State ID for the state that is added when MP reaches 0. this state is   # removed Once MP is above 0. Affects both actors and enemies.  MP_Empty = 1    # These are the states that have a chance of beign applied when mp reaches 0.  # Format of array is [state_id, percentage_chance],  ALL_chances =[     [2, 25],     [3, 25],  ]  # These are states that are applied to actors only.  Actor_Chances =[     [4, 25],     [5, 25],  ]  # These are states that are apllied onto enemies only.  Enemy_Chances =[     [6, 25],     [7, 25],  ]    # Maxmium Percentage, recommend to keep 100.  Max_Chance = 100  end #==============================================================================#class Game_BattlerBase#==============================================================================#  #----------------------------------------------------------------------------#  # Alias List  #----------------------------------------------------------------------------#  alias :alias_G_BB_refresh :refresh  #----------------------------------------------------------------------------#  # Refresh  #----------------------------------------------------------------------------#  def refresh    alias_G_BB_refresh    mp_state_checks  end  #----------------------------------------------------------------------------#  # MP State Checks  #----------------------------------------------------------------------------#  def mp_state_checks    return remove_state(MP_Status::MP_Empty) if @mp > 0    add_state(MP_Status::MP_Empty)    MP_Status::ALL_Chances.each do |data|      next unless data    != nil      next unless data[0] != nil      add_state(data[1]) if rand(MP_Status::Max_Chance+1) < data[0]    end  end end #==============================================================================#class Game_Actor < Game_Battler#==============================================================================#  #----------------------------------------------------------------------------#  # MP State Checks  #----------------------------------------------------------------------------#  def mp_state_checks    super    MP_Status::Actor_Chances.each do |data|      next unless data    != nil      next unless data[0] != nil      add_state(data[1]) if rand(MP_Status::Max_Chance+1) < data[0]    end  end end #==============================================================================#class Game_Enemy < Game_Battler#==============================================================================#  #----------------------------------------------------------------------------#  # MP State Checks  #----------------------------------------------------------------------------#  def mp_state_checks    super    MP_Status::Enemy_Chances.each do |data|      next unless data    != nil      next unless data[0] != nil      add_state(data[1]) if rand(MP_Status::Max_Chance+1) < data[0]    end  end end#==============================================================================##                      http://dekitarpg.wordpress.com/                         ##==============================================================================#
also, with the Tsukihime script i mentioned...
LINK TO PAGE

Found by googling - "tsukihime - damage convert to mp damage script" :)
 
Last edited by a moderator:

Grayborders

Maniac, Lunatic, Crazy
Veteran
Joined
Oct 19, 2013
Messages
146
Reaction score
79
First Language
Hungarian
Primarily Uses
I can confirm that if you want it to effect actors only you only have to change the class...

However, its easier to just redefine the method "mp_state_checks" within the game actor / game enemy class(s) and call super...

Actually, it will only take about 1 minute from my life...

#==============================================================================##                      http://dekitarpg.wordpress.com/                         ##==============================================================================#module MP_Status#==============================================================================#    # State ID for the state that is added when MP reaches 0. this state is   # removed Once MP is above 0. Affects both actors and enemies.  MP_Empty = 1    # These are the states that have a chance of beign applied when mp reaches 0.  # Format of array is [state_id, percentage_chance],  ALL_chances =[     [2, 25],     [3, 25],  ]  # These are states that are applied to actors only.  Actor_Chances =[     [4, 25],     [5, 25],  ]  # These are states that are apllied onto enemies only.  Enemy_Chances =[     [6, 25],     [7, 25],  ]    # Maxmium Percentage, recommend to keep 100.  Max_Chance = 100  end #==============================================================================#class Game_BattlerBase#==============================================================================#  #----------------------------------------------------------------------------#  # Alias List  #----------------------------------------------------------------------------#  alias :alias_G_BB_refresh :refresh  #----------------------------------------------------------------------------#  # Refresh  #----------------------------------------------------------------------------#  def refresh    alias_G_BB_refresh    mp_state_checks  end  #----------------------------------------------------------------------------#  # MP State Checks  #----------------------------------------------------------------------------#  def mp_state_checks    return remove_state(MP_Status::MP_Empty) if @mp > 0    add_state(MP_Status::MP_Empty)    MP_Status::ALL_Chances.each do |data|      next unless data    != nil      next unless data[0] != nil      add_state(data[1]) if rand(MP_Status::Max_Chance+1) < data[0]    end  end end #==============================================================================#class Game_Actor < Game_Battler#==============================================================================#  #----------------------------------------------------------------------------#  # MP State Checks  #----------------------------------------------------------------------------#  def mp_state_checks    super    MP_Status::Actor_Chances.each do |data|      next unless data    != nil      next unless data[0] != nil      add_state(data[1]) if rand(MP_Status::Max_Chance+1) < data[0]    end  end end #==============================================================================#class Game_Enemy < Game_Battler#==============================================================================#  #----------------------------------------------------------------------------#  # MP State Checks  #----------------------------------------------------------------------------#  def mp_state_checks    super    MP_Status::Enemy_Chances.each do |data|      next unless data    != nil      next unless data[0] != nil      add_state(data[1]) if rand(MP_Status::Max_Chance+1) < data[0]    end  end end#==============================================================================##                      http://dekitarpg.wordpress.com/                         ##==============================================================================#
also, with the Tsukihime script i mentioned...

LINK TO PAGE

Found by googling - "tsukihime - damage convert to mp damage script" :)
Thank you i eventually found it, and i didnt specify because i wanted the death condition to be trigger for everyone not just the battlers, so it was exactly what i wanted the first time:) Thanks again. It worked wonders.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,860
Messages
1,017,038
Members
137,568
Latest member
invidious
Top