Storing enemy index as variable?

I would like to know if it is possible to use a script call to store an enemy's index as a variable. I know it is possible to use script calls to access information about actors (EX: $game_actors[x], $game_variables[x], etc), but I am not sure if it is possible to do the same for enemies. Does anyone know if this is possible, and if so, what script call I would use to accomplish it?
What exactly do you mean by an "enemy's index"?
What exactly do you mean by an "enemy's index"?
Each enemy in a battle troop is assigned an index number ranging from 1 to 8 (8 is the maximum number of enemies that can be present in a battle at a time). I would like to know if it is possible to store the index number that was assigned to an enemy in a variable.
I've moved this thread to VX Ace Support. Please be sure to post your threads in the correct forum next time. Thank you.
Each enemy in a battle troop is assigned an index number ranging from 1 to 8 (8 is the maximum number of enemies that can be present in a battle at a time). I would like to know if it is possible to store the index number that was assigned to an enemy in a variable.
Use enemy.index if the enemy is already known. Otherwise use this:

$game_troop.members.each { |member| next unless cond? $game_variables[var_id] = member.index break} Where cond? is written by you to check if the queried game troop member is the enemy you want 😀

Original thread: https://forums.rpgmakerweb.com/threads/storing-enemy-index-as-variable.42033/