[XP]Amount of Enemies on Map

Started by dylanf3, September 02, 2011, 11:23:19 am

Previous topic - Next topic

dylanf3

Heya guys, i'm using Blizz-ABS V2.84 and i wanted to know:
How can i convert the amount of enemies on a map to a variable?
Expl: i have 3 Enemies on 1 map and wish to only possible to leave the map when you have killed all the enemies.

Spaceman McConaughey

There's a very nice explanation in the manual.

In short: RTFM.

dylanf3

That's just about it, i know this is the command to look if:
$game_map.battlers_group(GROUP).size
but i dont know how to put it in an Variable, and how to call the correct group...

Twb6543

September 02, 2011, 12:12:57 pm #3 Last Edit: September 02, 2011, 12:31:46 pm by Twb6543
Quote from:  Manual
$game_variables[ID] = $game_map.battlers_group(GROUP).size


This sets the variable ID to the number of active Battlers in group GROUP.

For example lets say that Group 002 was my enemies group for alignments and I wanted to set variable 1 to the current size of that group.
$game_variables[1] = $game_map.battlers_group(2).size


Now lets say I also have group 3 as enemies and want to include them as well to the total.
$game_variables[1] += $game_map.battlers_group(3).size


Now Lets put that in event terms.
Spoiler: ShowHide

The $game_system should actually be $game_map ...

The second event page has SelfSwitch A on and teleports the player.

It is just an example of how I would do it. I don't actually use Blizz-Abs but that is what I got from the manual.
If you put a million monkeys at a million keyboards, one of them will eventually write a Java program.
The rest of them will write Perl programs.

dylanf3

When i do that i get an error:


Btw, this is my event:

Twb6543

Whoops my fault is should be $game_map.battlers_group(ID).size
If you put a million monkeys at a million keyboards, one of them will eventually write a Java program.
The rest of them will write Perl programs.

dylanf3

Thanks :D It works now :)
I'll lock it now i guess :D