How do I make a player character come back to life automatically (sometimes) <Resolved>

Status
Not open for further replies.

marbeltoast

Your future fish emporer
Veteran
Joined
Nov 11, 2018
Messages
80
Reaction score
28
First Language
English
Primarily Uses
RMMV
Hey all!

So, here's the situation: I want to create an equip item that gives a player character a small chance to, upon death, come back to life automatically with full HP. Additionally, I need this to function in the event that the party only has one character, living or dead, in it, without combat/the game ending during the revival process due to no living allies.

As a stretch goal, I would like to be able to customise how much HP the character gets when they revive, and also apply a status effect upon revival, such as "prevent additional revival this turn."

Is this something that can be done in MV as standard? Is there a plugin that exists already which can do this? I tried looking for something like this in prior threads but found nothing conclusive.

Any help at all would be greatly appreciated. Thanks for reading and have a good tuesday!
 

mathmaster74

just...John
Veteran
Joined
Jun 12, 2016
Messages
285
Reaction score
193
First Language
English
Primarily Uses
RMMV
@marbeltoast Here's a Yanfly tips and tricks video about how to do something very much like what you're asking...if not entirely. Take a look! :smile:
Best!

Sincerely,
 

marbeltoast

Your future fish emporer
Veteran
Joined
Nov 11, 2018
Messages
80
Reaction score
28
First Language
English
Primarily Uses
RMMV
Well, I tried the method that Yanfly demonstrates in the video, but something appears to have gone wrong. Here's my code:
Code:
<Custom Apply Effect>
if (target.isActor() ) {
  var trinket = $dataArmors[50] ;
  if (target.hasArmor(trinket) ) {
    target.discardEquip(trinket) ;
    var hp = Math.floor(target.mhp) ;
    target.gainHP(hp) ;
  }
}
</Custom Apply Effect>
It's returning that ever so helpful "undefined is not a function" error message. If it's going to be that obtuse, it might as well just say "NO."

If it's not obvious, I'm not fluent in javascript. Anybody able to explain where I went wrong?
 

Riff

Eorzean
Veteran
Joined
Oct 25, 2015
Messages
266
Reaction score
84
First Language
English
Primarily Uses
RMMV
Do you have the latest Buff & State Core plugin?
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,091
Reaction score
1,508
First Language
EN
Primarily Uses
RMMZ
Code is case sensitive: use gainHp instead of gainHP. The rest looks OK to me~ :kaothx:
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,842
Reaction score
5,225
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,074
Members
137,578
Latest member
JamesLightning
Top