Counting Same Items

Kadafi

Reader
Veteran
Joined
Apr 7, 2014
Messages
38
Reaction score
25
First Language
Indonesian
Primarily Uses
RMMV
Hi guys, i have a question. How i can get the number of actors who has the same level?

Example: I have 3 actors in my party. 1st = Lv. 3; 2nd = Lv. 3; 3rd = Lv. 1. I want to set variable 1 by the number of actors who has Lv. 3 so the result would be 2 cause i have 2 Lv. 3 actors.

So, does anyone know how to do this?

Thank you.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,592
Reaction score
6,522
First Language
Indonesian
Primarily Uses
RMVXA
I have no idea how to do it via event. But it can be done easily with script call

Code:
$game_variables[10] = $game_party.members.select {|m| m.level == 3}.size
 

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
Hi guys, i have a question. How i can get the number of actors who has the same level?

Example: I have 3 actors in my party. 1st = Lv. 3; 2nd = Lv. 3; 3rd = Lv. 1. I want to set variable 1 by the number of actors who has Lv. 3 so the result would be 2 cause i have 2 Lv. 3 actors.

So, does anyone know how to do this?

Thank you.
I thought of a way to pull this off by pure eventing, with the help of a common event checking each char's lv, combined with a variable counter, but why do you want a variable to do this anyway?

What do you need it for, can't you just get Himes custom page condition script, and have 3 char lv  page conditions or do you have to have all three tied into a single variable for what you need to do?
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,050
Members
137,571
Latest member
grr
Top