Check Number of Events on Map (SOLVED)

Started by lonely_cubone, May 07, 2010, 09:22:32 am

Previous topic - Next topic

lonely_cubone

May 07, 2010, 09:22:32 am Last Edit: May 09, 2010, 12:00:48 pm by lonely_cubone
I'm trying to make a BLIZZ-Abs skill that causes the targets to run away. I know I can do this with common events and forced actions, but there's one thing I can't figure out, and I'm sure it's just a little bit of code. How can I set an in-game variable to the number of events on a map? Thanks to anyone who can solve this hopefully simple problem.

Blizzard

Since you are using Blizz-ABS, which count exactly do you need? Enemy count, real event count or the count of all events and enemies on the map altogether?
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.


Blizzard

$game_variables[VARIABLE_ID] = $game_map.events.size
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.

lonely_cubone

Okay, thanks Blizzard! That's exactly what I was looking for. :D

lonely_cubone

I'm having issues with this. The code Blizzard gave me works fine, but something else related to it is messing up.

As I said, I'm making a skill that causes enemies to run away from the user. It gives the enemies a state, and then runs a common event. The common event checks for this state on each enemy, and if the enemy has it, the enemy runs away. The problem is, once it gets to actually telling the enemy to run away, it gets a syntax error. This is a picture of the common event:

Spoiler: ShowHide


Does anyone know what the issue is? I've checked the manual many times, and it appears that I'm doing everything correctly. By the way, I'm using Blizz-ABS 2.7.

Blizzard

The parenthesis goes into the line before like "force_action(".
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.

lonely_cubone

Thank you so much! That works perfectly! :D
As you can probably tell, my Ruby/RGSS skills are a bit... lacking, but I am trying to learn it, and I know other languages pretty well. Little things like this are helping me understand the language, a little bit at a time.

WhiteRose

Quote from: lonely_cubone on May 09, 2010, 09:33:01 am
Thank you so much! That works perfectly! :D
As you can probably tell, my Ruby/RGSS skills are a bit... lacking, but I am trying to learn it, and I know other languages pretty well. Little things like this are helping me understand the language, a little bit at a time.

You might want to mark the first post as solved rather than the last, so that the topic title changes.  ;)