Checking Enemy IDs and if alive

drumblepie

Veteran
Veteran
Joined
Nov 12, 2015
Messages
33
Reaction score
3
Primarily Uses
Don't know where to post this for sure.

I can't find out how to check an Enemy's ID using either a Common Event or Javascript. Also, I can't figure out how to simply check if a particular enemy is alive or not. I want to say it'd be something like enemyTroop_member()[ID_#].isAlive but I don't really know.

One of the things I want to do is check Enemy IDs so I can remove them from a battle without it counting as a defeat. Also I need that info to determine certain States to add to them and what messages to have pop up during battle.

I'm quite desperate and fairly novice at Javascript. Please help! This could save my game.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,430
Reaction score
7,711
First Language
German
Primarily Uses
RMMV
You need to check enemy index in troop, not enemy ID.
And that is simply done by control variable, game data, for troop index 1-8.

EDIT:
to add an explanation, the enemy ID is the number that identifies the enemy data in the enemy tab. this number can't be used to check current HP in a battle because that enemy can be in the troop multiple times (all having the same ID but different troop index).

The troop index however can be selected in control variable game data to get specific data on the enemy that has that index in the troop.
However, as long as you're in common events you can only select the index without names because the common event doesn't know which troop it will be used on.
Open the control variable comman on game data while being in a troop event will show you in a better way how this works - the common event will work exactly the same if executed during battle, the editor just can't show it in the same way.
 
Last edited:

drumblepie

Veteran
Veteran
Joined
Nov 12, 2015
Messages
33
Reaction score
3
Primarily Uses
Thank you, that clarifies a lot for me. The 1-8 limit is part of the problem, especially since I'm using the HIMEWORKS Enemy Reinforcements Plugin to sometimes call more than 8 Enemies at a time, meaning any Enemies still in the battle may not be recognized by the game as fitting in slots 1-8. And as far as I know I can't assign an Enemy to one of those slots, which would really help.

I'm just trying to make a new system now for the game and see how it does. I forgot that, just like with items, the game doesn't differentiate between Enemies in a Troop if they're the same type, even if it labels them A, B, C, etc.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,430
Reaction score
7,711
First Language
German
Primarily Uses
RMMV
Even himes reinforcements have indices like I described, the editor just can't use them.
You'll need the script equivalents of those event commands (they're listed in a stickied topic somewhere in this forum), and then check the plugin to learn how it assigns the index numbers when calling Reinforcements
 

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

Latest Threads

Latest Posts

Latest Profile Posts

He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!

Forum statistics

Threads
106,035
Messages
1,018,459
Members
137,821
Latest member
Capterson
Top