RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
how do I make actors die at 0 hp?

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 82
We learn by living...
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

**
Rep:
Level 71
RMRK Junior
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"

***
Rep:
Level 82
We learn by living...
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.

***
Rep:
Level 82
IT ALL ENDED.
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]

********
Furry Philosopher
Rep:
Level 94
Rawr?
2013 Best RPG Maker User (Creativity)Randomizer - GIAW 11Gold - GIAW 11 (Hard)Secret Santa 2013 ParticipantFor frequently finding and reporting spam and spam bots2012 Best RPG Maker User (Programming)2012 Best RPG Maker User (Mapping)Secret Santa 2012 ParticipantGold - GIAW 9Project of the Month winner for September 2008For taking a crack at the RMRK Wiki2011 Best RPG Maker User (Programming)2011 Kindest Member2011 Best Veteran2010 Most Deserving Of A Promotion2010 Best RPG Maker User (Technical)
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.




***
Rep:
Level 82
We learn by living...
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).