RPG Developer Bakin

RPG Developer Bakin

Counting the number of enemies
Good day, all. I've working on layouts for the Battle system. I've gotten that working, but what I'd like to do is count the number of enemies at the beginning of battle and adjust the number and placement of windows (using slightly different layouts) depending on how many there are. Looking through the various commands, I'm at a bit of a standstill. I can make loops with commands that check various statuses of monsters, but not whether they exist.

In an ideal world, it would be start loop -> check if monster exists -> if they do, add 1 to a variable and restart loop // if they don't, exit loop -> then change which battle layout is used depending on the number in that variable.

I'm probably overthinking it, but is there a way to check if the monster in the nth position exists?
< >
Showing 1-5 of 5 comments
sylardean 9 Feb, 2024 @ 9:42am 
Have you tried setting up a Battle Common Event to auto check monster in nth placement when battle starts..? I vaguely remember there being an nth check option for monsters, I think i used something similar to check monsters you encounter for monster encounter rates information in a custom menu screen for achievements that I did. Cant exactly remember how I did it, I think I might have checked how the game tracks singular monster kills in the monster bestiary and went from there with the code and added it to my custom menu, ??? been a long while since I used Bakin.
castlefreak76 9 Feb, 2024 @ 10:15am 
There's an option like that, but it's only for specific monsters. Using it, I can check to see if there is - for example - a Sewer Rat in nth placement, but not if nth place is empty.
sylardean 10 Feb, 2024 @ 5:10am 
I don't think you can check if there's 0 monsters, thinking out loud here, maybe tie a variable to each nth placement so.. mob1 = 1, mob 2 = 2, mob 3 = 3... and switch the variable switch on/off depending on how many appear in battle. From there THEN do a variable check instead on the switches.. so.. if 1 is on = use layout 1, if 2 is on = use layout 2, etc. Maybe this could be a workaround for what your trying to do..??? untested mind you, just thinking out loud.
castlefreak76 10 Feb, 2024 @ 8:49am 
Thanks to your suggestion, I did some fiddling around. What ended up working rather than making variables mob1/mob2/mob3 etc. was checking if cast number 1/2/3 in Monster's HP was greater than 0, adding 1 to variable TotalMobs, moving on to the next one, and at the end checking the variable TotalMobs to see if they equal specific numbers and then changing out the layout used accordingly. At the end I cleared out TotalMobs to zero to make sure the next battle wouldn't also have issues. This of course was a common Battle event that takes place at the beginning of battle.
sylardean 10 Feb, 2024 @ 10:20am 
Originally posted by castlefreak76:
Thanks to your suggestion, I did some fiddling around. What ended up working rather than making variables mob1/mob2/mob3 etc. was checking if cast number 1/2/3 in Monster's HP was greater than 0, adding 1 to variable TotalMobs, moving on to the next one, and at the end checking the variable TotalMobs to see if they equal specific numbers and then changing out the layout used accordingly. At the end I cleared out TotalMobs to zero to make sure the next battle wouldn't also have issues. This of course was a common Battle event that takes place at the beginning of battle.

glad u got it working!!
< >
Showing 1-5 of 5 comments
Per page: 1530 50