RMRK is retiring.
Server is paid up for the rest of 2026, but the forum may go after that. See here for more information. Please archive or save anything you would like to keep before 2027.
Main Menu
  • Welcome to The RPG Maker Resource Kit.

Small edit to autorevive script

Started by ldkraven, March 16, 2010, 04:29:58 AM

0 Members and 1 Guest are viewing this topic.

ldkraven

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.

dricc

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 .
You can use my scripts freely . but not for commercial use .
:ccbync:
Don't encrypt your game !!!
Want to give me credit ? Easy ,add me in your game :

ldkraven

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.

ldkraven