The RPG Maker Resource Kit

RMRK RPG Maker Creation => Requests => Script Request => Topic started by: ldkraven on January 01, 2010, 07:35:59 PM

Title: [RESOLVED] Phoenix Down like script
Post by: ldkraven on January 01, 2010, 07:35:59 PM
I'm new to the forums and looking for a script that would revive the actor if Item X was in inventory. Any help would be appreciated. In the meantime i'll try to do it in an event.
Title: Re: [REQUEST] Phoenix Down like script
Post by: modern algebra on January 02, 2010, 05:02:41 PM
So you want it to happen automatically, not through another party member using the item on the party member?
Title: Re: [REQUEST] Phoenix Down like script
Post by: strike on January 02, 2010, 08:42:46 PM
man autophoenix in FF games made it like, easy as balls.
Title: Re: [REQUEST] Phoenix Down like script
Post by: ldkraven on January 03, 2010, 01:49:14 AM
Not exactly, i want them to have a choice. something like: Use item X? Yes or no. This is what i have right now and it doesn't work:


@>Conditional Branch: Script: $game_party.all_dead?
   @>Conditional Branch: [ItemX] in Inventory
       @>Text: -, -, Dark, Bottom
        :        : Use ItemX?
       @>Show Choices: Yes, No
        :  When [Yes]
           @>Recover All: Entire party         <<<(theres only one person)
           @>Change Items: [ItemX], -1
           @>Wait: 60 frame(s)
           @>Text: -, -, Dark, Bottom
            :        : Used ItemX!
           @>
        :  When [No]
           @>
        :  Branch End
        @>
     :  Branch End
     @>
  :  Branch End
@>









 
Title: Re: [REQUEST] Phoenix Down like script
Post by: ldkraven on January 27, 2010, 07:53:31 AM
***bump***
Title: Re: [REQUEST] Phoenix Down like script
Post by: dricc on February 05, 2010, 02:30:24 PM
I made a quick script :

[spoiler]

 #--------------------------------------------------------------------------
 # 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

[/spoiler]

To use this , create an item and add "<Autorevive>" in the comments field .
If one of your heroes die , the item will be automaticaly consumed and the hero will be revive with 1 hp .
if oyu want the hero to be revived with full HP instead , change :
         @hp=1
by
         @hp=@maxhp

This is not exactly what you need , because i don't ask the question . the item is automatically consumed
Title: Re: [REQUEST] Phoenix Down like script
Post by: ldkraven on February 10, 2010, 04:22:28 AM
I can work around the question. Thanks alot ^.^
Title: Re: [RESOLVED] Phoenix Down like script
Post by: modern algebra on February 10, 2010, 08:01:48 PM
nice work dricc. You should post a topic for it :)