Applying a status on a party member when their MP reaches 0

micky315

Warper
Member
Joined
Mar 19, 2015
Messages
2
Reaction score
0
First Language
English
Primarily Uses
Hey there, Im having trouble finding a way to give a character a status effect if there HP or MP falls beyond a certain point or reaches 0. I know that the "death" status effect does this when HP reaeches zero but I dont know how it does it. It just says "State #1 will be automatically added when HP reaches 0."

Thanks.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Please don't make your text look like that. If you want help, make your post as easy to read as possible. That is not easy to read.


State 1 is death.


State 2 is guard.


You can't mess around with them.


I've moved this thread to RGSS3 Script Requests. Please be sure to post your threads in the correct forum next time. Thank you.
 
Last edited by a moderator:

EatYourBeetS

The Abysswalker
Veteran
Joined
Feb 23, 2015
Messages
96
Reaction score
30
First Language
Italian
Primarily Uses
In the script Game_BattlerBase , around line 500 

#-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh state_resist_set.each {|state_id| erase_state(state_id) } @hp = [[@hp, mhp].min, 0].max @mp = [[@mp, mmp].min, 0].max @hp == 0 ? add_state(death_state_id) : remove_state(death_state_id) @mp == 0 ? add_state(id) : remove_state(id) #Add this line to the script endadd @mp == 0 ? add_state(id) : remove_state(id) , and write instead of id the index of the state you want to apply.
 

micky315

Warper
Member
Joined
Mar 19, 2015
Messages
2
Reaction score
0
First Language
English
Primarily Uses
In the script Game_BattlerBase , around line 500 

#-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh state_resist_set.each {|state_id| erase_state(state_id) } @hp = [[@hp, mhp].min, 0].max @mp = [[@mp, mmp].min, 0].max @hp == 0 ? add_state(death_state_id) : remove_state(death_state_id) @mp == 0 ? add_state(id) : remove_state(id) #Add this line to the script endadd @mp == 0 ? add_state(id) : remove_state(id) , and write instead of id the index of the state you want to apply.
Thanks! This is actually the first thing I tried but I used the name of the status instead of its index number.

Also, is there a way to do this with enemy's aswell? So that whenever any enemy has zero mp they also have a status applied to them?
 

EatYourBeetS

The Abysswalker
Veteran
Joined
Feb 23, 2015
Messages
96
Reaction score
30
First Language
Italian
Primarily Uses
I'm pretty sure this does automatically work with enemies too, though I can't check at the moment.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Enemies are based on Game_BattlerBase so anything you put in that method will apply to actors and enemies.


Never use names. Just use ids (without leading zeros).
 

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

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
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.

Forum statistics

Threads
105,868
Messages
1,017,085
Members
137,583
Latest member
write2dgray
Top