-
States Immune to Full Recovery
8/12/12
Summary
I hate how full recovery event command removes positive states, (for example you have a state that boost defense, and it get's removed once you use full recovery). Can someone make a script that allows choose which states aren't affected by it.
Features Desired
- Ability to list which states don't get removed by Full Recovery
Games its been in
- I know that Final Fantasy XII has this feature, (for example: you use cast Protect on your party and then use a Save Crystal, which also fully Recovers your party, positive status effects like Protect aren't removed).
Did you search?
Yes
Where did you search?
- Google
- RMRK
- RPG Maker VX.net Forums
What did you search for?
- "Full Recovery"
- "Full Recovery" + States
- States
- "Full Recovery" + Immune States
- (I might have used more, but I searched so many times).
-
Put the tag "\no_recover" in the notebox of states you don't want to remove upon full recovery.
class Game_BattlerBase
def clear_states
hold_states = []
states.each { |state|
hold_states.push if !state.note[/\\no[_ ]recover/i].nil?
}
@states = hold_states
@state_turns = {}
@state_steps = {}
end
end
-
Put the tag "\no_recover" in the notebox of states you don't want to remove upon full recovery.
class Game_BattlerBase
def clear_states
hold_states = []
states.each { |state|
hold_states.push if !state.note[/\\no[_ ]recover/i].nil?
}
@states = hold_states
@state_turns = {}
@state_steps = {}
end
end
Thanks for the reply Pacman. I tried it and it gave me this error though:
Script 'Game_BattlerBase' line 146: NoMethodError occured.
undefined method `collect' for nil:NilClass
I then tried using it in a fresh new project and it removed the "\no_recover" states also.
-
This should work.
class Game_BattlerBase
alias no_recover_states_init initialize
def initialize(*args)
@states = []
no_recover_states_init(*args)
end
alias no_recover_states_clear clear_states
def clear_states(*args)
hold_states = []
for state in states
hold_states.push(state.id) if state.note[/\\no[_ ]recover/i] != nil
end
no_recover_states_clear(*args)
@states = hold_states
end
end
-
This should work.
class Game_BattlerBase
alias no_recover_states_init initialize
def initialize(*args)
@states = []
no_recover_states_init(*args)
end
alias no_recover_states_clear clear_states
def clear_states(*args)
hold_states = []
for state in states
hold_states.push(state.id) if state.note[/\\no[_ ]recover/i] != nil
end
no_recover_states_clear(*args)
@states = hold_states
end
end
It gave me this error:
Script 'Game_Actor' line 52: TypeError occurred
no implicit conversion from nil to integer
and I tried it in a new project again and it removed all of the states again.
-
I don't get that error. It works completely fine for me.
-
I don't get that error. It works completely fine for me.
I put without quotes "\no_recover" with the backslash included right? I don't understand, you tried this in a fresh new project right?
-
Yes, new project, everything. Works fine.
-
Yes, new project, everything. Works fine.
Sorry, it is working now. I made the silly mistake of putting the script below "Main". Thanks for the script, this really helps.
I tested it out while placing other script in it, (one at a time), and finally figured it out, Yanfly's 'Yanfly Engine Ace - Passive States v1.02" is causing this compatibility error:
"Script 'Game_Actor' line 52: TypeError occurred
no implicit conversion from nil to integer"
The problem was fixed though: http://rmrk.net/index.php/topic,46683.0.html