The RPG Maker Resource Kit

RMRK RPG Maker Creation => Requests => Script Request => Topic started by: shintashi on January 26, 2011, 04:49:09 AM

Title: how do I make actors die at 0 hp?
Post by: shintashi on January 26, 2011, 04:49:09 AM
How do I make a character die if their hit points go to zero by some indirect effect outside combat?

Pseudo code:

if @actor.hp == 0
@actor.dead = true
end
Title: Re: how do I make actors die at 0 hp?
Post by: brewmeister on March 02, 2011, 02:54:17 AM
The default system will set the "Knockout" state when HP 0 is reached. You don't have to do anything.

Essentially, "Dead" is having a state with "Regard as HP 0".  Usually also with "Can't Get EXP" & "Can't Move"
Title: Re: how do I make actors die at 0 hp?
Post by: shintashi on March 02, 2011, 03:31:41 AM
Quote from: brewmeister on March 02, 2011, 02:54:17 AM
The default system will set the "Knockout" state when HP 0 is reached. You don't have to do anything.

Essentially, "Dead" is having a state with "Regard as HP 0".  Usually also with "Can't Get EXP" & "Can't Move"


unfortunately I'm not using a default system. I've got a battle system where if a monster kills off my characters, they die, but If I create a piece of code that lowers their hp (such as from backlash of a powerful spell) combat monsters stop attacking, and they can no longer attack, but they can continue walking around, get healed, etc. While this is a useful effect for simulating quasi immortal zombie status, since i actually want characters to be able to die/explode from casting over powered spells, this effect is superfluous and unwanted.

In other words, I need a method of telling the computer to kill the actors when their hit points hit zero.
Title: Re: how do I make actors die at 0 hp?
Post by: Pokey on March 02, 2011, 08:16:17 AM
I dont know if this will work:
make a common event. set variable x = player's HP
conditional branch: x </= 0,
[do what you want here]
Title: Re: how do I make actors die at 0 hp?
Post by: Zylos on March 02, 2011, 04:15:34 PM
So... wait, are you using something like an ABS? Because I thought you could just make a poison-like status that would knock you out, or import a doom countdown script or something.
Title: Re: how do I make actors die at 0 hp?
Post by: shintashi on March 02, 2011, 10:10:57 PM
I was using Mr Mo's ABS actually. Its for the 'Child of Reason' project - the other projects don't use ABS, and I'd taken a break from CoR to work on particle systems and Text interface - both of which are going to be integral to CoR later on.

Point is, when you cause someone's hit points to drop to zero outside of a direct attack, in ABS, they don't always die, because death checking code isn't instantiated in the same place as hp tracking. (I can't believe I'm using instantiate in a sentence).