RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[VXA][SOLVED] States Immune to Full Recovery

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 55
RMRK Junior
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).
« Last Edit: August 18, 2012, 05:52:49 PM by dragon3025 »

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Best IRC Quote2014 Zero to Hero2014 Most Missed Member2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
Put the tag "\no_recover" in the notebox of states you don't want to remove upon full recovery.

Code: [Select]
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
it's like a metaphor or something i don't know

**
Rep: +0/-0Level 55
RMRK Junior
Put the tag "\no_recover" in the notebox of states you don't want to remove upon full recovery.

Code: [Select]
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.

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Best IRC Quote2014 Zero to Hero2014 Most Missed Member2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
This should work.
Code: [Select]
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's like a metaphor or something i don't know

**
Rep: +0/-0Level 55
RMRK Junior
This should work.
Code: [Select]
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.

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Best IRC Quote2014 Zero to Hero2014 Most Missed Member2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
I don't get that error. It works completely fine for me.
it's like a metaphor or something i don't know

**
Rep: +0/-0Level 55
RMRK Junior
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?

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Best IRC Quote2014 Zero to Hero2014 Most Missed Member2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
Yes, new project, everything. Works fine.
it's like a metaphor or something i don't know

**
Rep: +0/-0Level 55
RMRK Junior
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
« Last Edit: August 18, 2012, 05:52:09 PM by dragon3025 »