The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: ldkraven on March 16, 2010, 04:29:58 AM

Title: Small edit to autorevive script
Post by: ldkraven on March 16, 2010, 04:29:58 AM
I recieved this script from dricc back in february and was wondering if someone could help me edit the script.


#--------------------------------------------------------------------------
  # autorevive item
  #--------------------------------------------------------------------------

class Game_Actor < Game_Battler
 
  #--------------------------------------------------------------------------
  # * Change HP
  #     hp : new HP
  #--------------------------------------------------------------------------
  def hp=(hp)
    @hp = [[hp, maxhp].min, 0].max
    if @hp == 0 and not state?(1) and not @immortal
      for item in $game_party.items
        if item.note == "<Autorevive>" and @hp == 0 then
          @hp=1
          $game_party.consume_item(item)
        else
          add_state(1)                # Add incapacitated (state #1)
          @added_states.push(1)
        end
      end
    elsif @hp > 0 and state?(1)
      remove_state(1)             # Remove incapacitated (state #1)
      @removed_states.push(1)
    end
  end
end




I need it to ask if i want to use the item before it revives the character. If anyone could tell me how I would appreciate it.
Title: Re: Small edit to autorevive script
Post by: dricc on March 29, 2010, 09:37:29 AM
Oh , yes , i remember .

Well , it is much more difficult but not impossible . You must create a "scene" class to make that . and maybe a "window" class also .
Title: Re: Small edit to autorevive script
Post by: ldkraven on March 31, 2010, 10:08:39 PM
Thats what i figured but i have no idea how. I tried to get the script to call a common event or change a switch/variable but it wasn't working. The reviving works though, thanks again.
Title: Re: Small edit to autorevive script
Post by: ldkraven on April 05, 2010, 06:27:05 AM
**bump**