Chaos Project

RPG Maker => General Discussion => Troubleshooting / Help => Topic started by: dylanf3 on September 02, 2011, 11:23:19 am

Title: [XP]Amount of Enemies on Map
Post by: dylanf3 on September 02, 2011, 11:23:19 am
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.
Title: Re: [XP]Amount of Enemies on Map
Post by: Spaceman McConaughey on September 02, 2011, 11:38:02 am
There's a very nice explanation in the manual.

In short: RTFM.
Title: Re: [XP]Amount of Enemies on Map
Post by: dylanf3 on September 02, 2011, 11:58:20 am
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...
Title: Re: [XP]Amount of Enemies on Map
Post by: Twb6543 on September 02, 2011, 12:12:57 pm
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
(http://penguingames.ucoz.co.uk/Twb6543/BLIZZABS_EVENT.png)
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.
Title: Re: [XP]Amount of Enemies on Map
Post by: dylanf3 on September 02, 2011, 12:23:08 pm
When i do that i get an error:
(http://dl.dropbox.com/u/28470346/ERROR.png)

Btw, this is my event:
(http://dl.dropbox.com/u/28470346/ERROR2.png)
Title: Re: [XP]Amount of Enemies on Map
Post by: Twb6543 on September 02, 2011, 12:30:42 pm
Whoops my fault is should be $game_map.battlers_group(ID).size
Title: Re: [XP]Amount of Enemies on Map
Post by: dylanf3 on September 02, 2011, 12:35:30 pm
Thanks :D It works now :)
I'll lock it now i guess :D