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.
So you want it to happen automatically, not through another party member using the item on the party member?
man autophoenix in FF games made it like, easy as balls.
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
@>
***bump***
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
I can work around the question. Thanks alot ^.^
nice work dricc. You should post a topic for it :)