pedrocarsamar

Villager
Member
Joined
Jun 19, 2017
Messages
23
Reaction score
12
First Language
portuguese
Primarily Uses
RMVXA
Hello. Is there a way of checking the total number of enemies in a troop during battle? For example: through a script call.

Thanks in advance
 

Shiro-chan

Friendly Neighbourhood Neppy Maid
Veteran
Joined
Aug 7, 2018
Messages
194
Reaction score
59
First Language
German
Primarily Uses
RMVXA
Code:
$game_variables[x] = $game_troop.members.size

Replace x with a variable of your choice. If you want to interact with this, remember that some parts of the engine count the first member as member 0 (so a troop with 8 enemies would actually mean that the 7th is the last), so for those cases you may want to reduce the value by 1 before doing anything. I found that out the hard way.
 

pedrocarsamar

Villager
Member
Joined
Jun 19, 2017
Messages
23
Reaction score
12
First Language
portuguese
Primarily Uses
RMVXA
Code:
$game_variables[x] = $game_troop.members.size

Replace x with a variable of your choice. If you want to interact with this, remember that some parts of the engine count the first member as member 0 (so a troop with 8 enemies would actually mean that the 7th is the last), so for those cases you may want to reduce the value by 1 before doing anything. I found that out the hard way.
Thank you!
 

Latest Threads

Latest Posts

Latest Profile Posts

Mixing different pixi filters over a picture. :MV3:

lumina_in_space.jpg

I don't know if my game dev skills are improving... But my waifu making ones sure are. :LZSwink:
Who wants to solve a riddle from my game?
"I prayed for her to lay down her worldly habit and accept the invitation to change her life forever." From lost to found. From past to present, From frown to smile. From the way people treat her as nothing but something to say wow about. From faithless to faithful. From something no one wants to something valuable, someone will respect and love. Thank you, Jesus.
Two new amazing plugins from @NhatNguyen! Footsteps & Stamina. Video on Twitter showcasing:

Forum statistics

Threads
123,098
Messages
1,153,959
Members
161,424
Latest member
kiamat
Top