Chaos Project

RPG Maker => RPG Maker Scripts => Script Requests => Topic started by: lonely_cubone on May 07, 2010, 09:22:32 am

Title: Check Number of Events on Map (SOLVED)
Post by: lonely_cubone on May 07, 2010, 09:22:32 am
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.
Title: Re: Check Number of Events on Map
Post by: Blizzard on May 07, 2010, 09:44:55 am
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?
Title: Re: Check Number of Events on Map
Post by: lonely_cubone on May 07, 2010, 09:46:56 am
All events, both enemies and non-enemies.
Title: Re: Check Number of Events on Map
Post by: Blizzard on May 07, 2010, 10:45:32 am
$game_variables[VARIABLE_ID] = $game_map.events.size
Title: Re: Check Number of Events on Map
Post by: lonely_cubone on May 07, 2010, 03:25:01 pm
Okay, thanks Blizzard! That's exactly what I was looking for. :D
Title: Re: Check Number of Events on Map (Unsolved Again)
Post by: lonely_cubone on May 09, 2010, 09:25:28 am
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
(http://i978.photobucket.com/albums/ae270/lonely_cube/Dimension%20Adventures%20Banners/Humphis.png)


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.
Title: Re: Check Number of Events on Map (Unsolved Again)
Post by: Blizzard on May 09, 2010, 09:28:58 am
The parenthesis goes into the line before like "force_action(".
Title: Re: Check Number of Events on Map (SOLVED again)
Post by: 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.
Title: Re: Check Number of Events on Map (SOLVED again)
Post by: WhiteRose on May 09, 2010, 11:56:28 am
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.  ;)
Title: Re: Check Number of Events on Map (SOLVED)
Post by: lonely_cubone on May 09, 2010, 12:01:13 pm
Oops, sorry.