How to check how many enemies are on map Blizz Abs

Started by Zexion, March 16, 2011, 11:17:16 pm

Previous topic - Next topic

Zexion

I read the manual but i think i misunderstood, or i'm doing it wrong or something.
First off in the manual it says:
  • $game_map.battlers_group(GROUP).size - how many battlers of a group are currently on the map.

    so I evented this:
    @>Conditional Branch: Script: $game_map.battlers_group(2).size = 0
        @>text: Blah Blah....Blah?
        @>screen flash: (255,255,255,255), @10
        @>transfer player: [005: Destiny Island] blah blah
        @>
    : Else
    @>
    : Branch End
    @>

    It's on parallel process so when all the enemies (group 2) are defeated, it would do that little scene.
    But it's trippin out, because i think im using the script wrong or something.
    So when I get to the map of the enemies, it gives me an error:
    NoMethodError occured while running script. 
    undefinded method 'size=' for #<Array: 0x8a591f8


    What am I doin' wrong. :(

    Scripts I'm using:
    Spoiler: ShowHide
    Kh Item Menu
    hermes
    hermes
    hermes
    hermes
    hermes
    (takes like 5 slots lol)
    Kh Journal Menu
    Different Attack Algorithms
    Mogs Treasure Menu
    Kh Save Menu
    Blizz 1
    Blizz 2
    Blizz 3
    Battle Music
    Battle Cry
    Auto Target
    Blizz Enemy Hp Meter
    Kh Hud 1
    Kh Hud 2
    Kh Hud 3
    Kh Main Menu

    (seems like a lot but some scripts are split into more pieces.)
    Is this an error due to the script I called or due to one of the scripts?

LiTTleDRAgo

it should be

Quote$game_map.battlers_group(2).size == 0

The Niche

Actually, I'm pretty sure it's:

$game_map.battlers.size == 0
Level me down, I'm trying to become the anti-blizz!
Quote from: winkio on June 15, 2011, 07:30:23 pm
Ah, excellent.  You liked my amusing sideshow, yes?  I'm just a simple fool, my wit entertains the wise, and my wisdom fools the fools.



I'm like the bible, widely hated and beautifully quotable.

Dropbox is this way, not any other way!

Blizzard

March 17, 2011, 05:06:28 am #3 Last Edit: March 17, 2011, 05:07:30 am by Blizzard
That would include lifeless objects and generally every event that you turned into an enemy with \e[ID] regardless of the group.

EDIT: This here should be the most convenient way:

Quote$game_map.battlers_group(BlizzABS::Alignments::ENEMY_GROUP).size == 0

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Zexion

first: WOW lol lots of help in 1 day :P or 2 idk how long its been lol

Second: Well I put the code that blizz said, and the error is fixed, but nothing happens now. I kill all the enemies, but the cutscene won't play.

LiTTleDRAgo

then try this
Quote$game_map.battlers_group(2).size == 0


G_G

Open up the Blizz abs config and go to the groups ot alignments tab. Look for the id of the group you want checked.

Zexion

@LiTTleDRAgo tht one didnt seem to work either...

I don't know whats wrong with this lol. Im just using a simple event with a script call to do a cutscene. It's exactly the way I said in my earlier post except now the script: is changed to what littledrago posted.

@game_guy is there anything else I need to configure like am I suppose to configure enemies or does it just do it on its own?
I don't mean like making them enemies on the map, I mean like...is there some kind of database edit I'm supposed to do?

I'm not getting annnnny errors at all, but the cutscene doesn't start... I made a temporary fix by making each enemy add to a variable when killed and then checking when that variable is at a certain number, and that works fine except that it doesn't always let me kill all of them before it starts even though I put the exact requirement for the variable to equal the enemies killed.
This is like the intro to my game lol I really need this fix :\.

The Niche

Level me down, I'm trying to become the anti-blizz!
Quote from: winkio on June 15, 2011, 07:30:23 pm
Ah, excellent.  You liked my amusing sideshow, yes?  I'm just a simple fool, my wit entertains the wise, and my wisdom fools the fools.



I'm like the bible, widely hated and beautifully quotable.

Dropbox is this way, not any other way!

Zexion

March 19, 2011, 02:59:02 pm #9 Last Edit: March 19, 2011, 03:17:44 pm by Zexion
yeah if you want I could upload a demo of itt cus its really frustrating me.(to many things needed to make a demo lol.)

anyways yeah its on parallel ima screenshot it right now
Spoiler: ShowHide

The Niche

Well first of all, capitalise the s in both your messages. Second: try one equals sign. It shouldn't work, but occasionally it does.
Level me down, I'm trying to become the anti-blizz!
Quote from: winkio on June 15, 2011, 07:30:23 pm
Ah, excellent.  You liked my amusing sideshow, yes?  I'm just a simple fool, my wit entertains the wise, and my wisdom fools the fools.



I'm like the bible, widely hated and beautifully quotable.

Dropbox is this way, not any other way!

Wizered67

That really shouldn't ever work :huh:

2 equal signs compares values so only 1 equal sign just wouldn't work right.....

Zexion

ahh 1 "=" gives me the error again :d also that text isn't reeeallly what its gonna say lol I just wanna test it till it works :P gr why is this happening

winkio

try putting

p $game_map.battlers_group(2).size


as the event code for a non-enemy event on the map.  Enter the map, kill the enemies, then talk to that event.  The number that pops up is the number of enemies Blizz-ABS thinks there are on the map.  Tell us what it is.

LiTTleDRAgo

March 20, 2011, 12:14:55 am #14 Last Edit: March 20, 2011, 12:17:13 am by LiTTleDRAgo
Quote from: winkio on March 19, 2011, 09:30:15 pm
try putting

p $game_map.battlers_group(2).size


as the event code for a non-enemy event on the map.  Enter the map, kill the enemies, then talk to that event.  The number that pops up is the number of enemies Blizz-ABS thinks there are on the map.  Tell us what it is.


blizz abs bug!!
I make 2 enemies then kill them but the event says the battler is still 2

Quote from: Zexion on March 19, 2011, 12:19:28 pm
I made a temporary fix by making each enemy add to a variable when killed and then checking when that variable is at a certain number, and that works fine except that it doesn't always let me kill all of them before it starts even though I put the exact requirement for the variable to equal the enemies killed.


how about paste this into each enemy page

Wait : 10 Frame(s)
Script : $game_map.rename_event(@event_id, 'defeat')




Zexion

ommmmgggg lol I did what winkio said and when i first started it said 13, and I was like ohhhh i guess when I did the variable thing I forgot 1 more so it started before I killed all of them, buuuuuuttttttttt. I was right there are only 12 enemies, so when I kill all of them it shows an extra 1 enemy for some reason?? That is why the thing won't start because I have it searching for 0 enemies but it says there is still 1. (even though there are really none on the map)