pedrocarsamar

Veteran
Veteran
Joined
Jun 19, 2017
Messages
30
Reaction score
14
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
197
Reaction score
61
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

Veteran
Veteran
Joined
Jun 19, 2017
Messages
30
Reaction score
14
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

Hello! Can anyone help me? I followed making cooking tutorial for RPG Maker MV. But for some reason buff state that food gives doesn't work in overworld. It disappears. What am I supposed to do?
A shotgun is not a rifle. Huh.
SIGH its so hard to convince my friend that making a game for fun and making one to sell takes different planning. I don't care about weird bothersome ways of doing things in a game made for fun, but when you are planning to market it, there is some stuff that you just have to streamline or cut out.
It might be a little bit boring and tedious, but building that database of armor, items, weapons and skills are super important.

Forum statistics

Threads
124,399
Messages
1,163,341
Members
163,195
Latest member
new88betscom
Top