RMMV Check if enemy is dead or has zero HP via script call

Status
Not open for further replies.

KotoYama

Veteran
Veteran
Joined
Apr 20, 2019
Messages
447
Reaction score
80
First Language
Spanish
Primarily Uses
RMMV
I guess it would be smth like $gameTroop.member().isAlive but I'm not sure
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
34,310
Reaction score
8,753
First Language
German
Primarily Uses
RMMV
it depends on where and when you want to use that script call.
in a troop event it's usually easier to use the game data section of control variable (not the script section) or the event conditions.
In a plugin it depends on when and where you call the function.
outside a battlescreen that won't work at all because outside the battlescreen no enemies exist.
 

KotoYama

Veteran
Veteran
Joined
Apr 20, 2019
Messages
447
Reaction score
80
First Language
Spanish
Primarily Uses
RMMV
Inside battle screen. My battle system works on parallel events.
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,976
Reaction score
2,299
First Language
EN
Primarily Uses
RMMZ
"Is enemy #1 (index 0) alive?"
JavaScript:
$gameTroop.members()[0].isAlive()

"Is the current HP of enemy #1 equal to 0?"
JavaScript:
$gameTroop.members()[0].hp === 0

The parts for these script calls (and much more) can be found here, in case you're interested:
 

KotoYama

Veteran
Veteran
Joined
Apr 20, 2019
Messages
447
Reaction score
80
First Language
Spanish
Primarily Uses
RMMV
"Is enemy #1 (index 0) alive?"
JavaScript:
$gameTroop.members()[0].isAlive()

"Is the current HP of enemy #1 equal to 0?"
JavaScript:
$gameTroop.members()[0].hp === 0

The parts for these script calls (and much more) can be found here, in case you're interested:
This works, thank u
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
9,115
Reaction score
5,968
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.

Latest Threads

Latest Posts

Latest Profile Posts

Reading about metaverses recently. I can totally imagine myself in the future, logging in with VR glasses to a virtual beach villa sitting in a virtual chair, with a virtual laptop facing the sea...coding 16-bit RM.
Mod name: "[Game name] Gameplay Overhaul"
What they actually mean: "Here is a mod that makes the game harder."
I decided to reinstall one of my most favourite game of all times, Gothic 2. Time to get back to Khorinis!
So much game make... I needs to rest. The foods call.
-Casino with bunnysuit green check.png
1638563168795.png

Forum statistics

Threads
117,166
Messages
1,105,096
Members
153,259
Latest member
litespace
Top