Checking all party member levels

Hello, I want to check my whole party member's level.

Say for example my party members has levels 51, 45, 55, 34 for the 4 actors.

How can I do it via script to check if someone among them is level 45?

thanks for the help...
You can do so without a script using just variables and eventing. Just set one variable to equal the level of the character you want to check, then do a conditional branch to check if it's equal to 45. If yes, do the thing then check for the next character using the same variable. If no, just move on to checking. Easy~
you can set a variable equal to level of actor in each slot, check if it's 45, if yes do what you want, if not, proceed to next party member
I know it can e done without it but to save some time for you. This and much more can be done with one of my scripts.

V's Conditional Checkshttp://forums.rpgmakerweb.com/index.php?/topic/17907-vs-conditional-checks-v12/
Thanks for all the replies guys. I was asking for a script equivalent of this because I am learning how to do them not in the events.

I was thinking of using a loop for $game_party to check their levels, but I am lost on that track.

Edit: Got it working. Thanks everyone.
Here's one way

Code:
  #-----------------------------------------------------------------------------  # * Party Level  #-----------------------------------------------------------------------------  def party_lv(amount_greater_then)    result = false    $game_party.members.each { |i| result = true if i.level > amount_greater_then  }    result  end
okay got another question vidaca 🙂

i wanted to change the experience of a certain actor, is there a script equivalent of this. I wanted to change the experience of the actor who used a certain item...

is that possible on scripts?
First off. It is all possible with scripts. It might not be easy but it is possible. Loosely speaking, you could control an entire space ship or army of cyborg clones using Ruby. 😮   Ok a little much but it true though. Ruby is a programming language just like any other. (And it has a lot more pros then cons if you ask me)You would be amazed what you can do with it.

Is it going to be the same amount every time. or will it vary depending on the item.
Its going to be the same amount. 🙂

Thanks for the explanation though 😀
Here you go. I haven't tested it yet though. I am going to be using this, it a great idea and saves you from common eventing it.
Let me know how it works out for you.
 

OK. now it works.

Spoiler
Code:
#<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>##                                                                              ##                             V's Item Experience                              ##                                 Version  0.2                                 ##                                                                              ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~##                                Written By:  V                                ##                        Last Edited:  January 29, 2013                        ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~##                                                                              ##<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>##                                                                              ##==============================================================================##------------------------------------------------------------------------------## ** Disclaimer                                                                ##------------------------------------------------------------------------------##                                                                              ## This script was intended for Non-commercial use only, if you wish to use     ## this script in a commercial game please PM me at which ever site you found   ## this script. Either way please give me credit in your game script as the     ## writer of this script, and send me a PM abuot the release of the game/demo.  ##                                                                              ##------------------------------------------------------------------------------## ** How To Use                                                                ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~##                                                                              ## * Use this tag in an items notebox if you wish to recive exp when using that ##   item.                                                                      ##             <Item_XP: Amount>                                                ##                                                                              ##------------------------------------------------------------------------------## ** Description                                                               ##------------------------------------------------------------------------------##                                                                              ##  v0.1                                                                        ## ~=~=~=~                                                                      ##                                                                              ## * This script allows the actor to gain experience for using set items.       ##                                                                              ##  v0.2                                                                        ## ~=~=~=~                                                                      ##                                                                              ## * Bugs Fixed.                                                                ##                                                                              ##------------------------------------------------------------------------------##==============================================================================##==============================================================================# ** V's Item Experience#==============================================================================#==============================================================================# ** Scene_Battle#------------------------------------------------------------------------------#  This class performs battle screen processing.#==============================================================================class Scene_Battle < Scene_Base  #--------------------------------------------------------------------------  # * Aliasing Method: Item [OK]  #--------------------------------------------------------------------------  alias :sboio527254524778673  :on_item_ok  #--------------------------------------------------------------------------  # * Item [OK]  #--------------------------------------------------------------------------  def on_item_ok    BattleManager.actor.gain_item_xp(@item_window.item)    sboio527254524778673()  endend#==============================================================================# ** Scene_Item#------------------------------------------------------------------------------#  This class performs the item screen processing.#==============================================================================class Scene_Item < Scene_ItemBase  #--------------------------------------------------------------------------  # * Aliasing Method: Item [OK]  #--------------------------------------------------------------------------  alias :sioio454343413  :on_item_ok  #--------------------------------------------------------------------------  # * Item [OK]  #--------------------------------------------------------------------------  def on_item_ok    @actor.gain_item_xp(@item_window.item)    sioio454343413()  end end#==============================================================================# ** Game_Actor#------------------------------------------------------------------------------#  This class handles actors. It is used within the Game_Actors class# ($game_actors) and is also referenced from the Game_Party class ($game_party).#==============================================================================class Game_Actor < Game_Battler  #--------------------------------------------------------------------------  # * Gain Item Experience  #--------------------------------------------------------------------------  def gain_item_xp(item)    note = /<Item_XP:\s*(\d*)>/i    item.note.scan(note)    if $1 && $1 != ""      item_xp = $1.to_i      gain_exp(item_xp)    end  endend
Thanks for the quick reply. so it means whosoever uses the item gains the experience given, right?

PS: The script gives me this error:

BattleManager line 114

undefined method ">=" for nil.NilClass
Yep, in battle too. I don't know how that will work out with leveling though I didn't really get a chance to test it out all the way. I wrote it in 20 mins. most of the time was the tags though.
I got it to work when ever it levels up, however when I use the item on an actor (whoever that actor is), it seems not to be gaining the experience I need in the note tags.
The person that uses the item gains the xp for using the item. (Or should...)
the current experience stays 0. 

it also says it doesn't have a correct argument for gain_exp and it doesn't seem to recognize the method?
I have made a few adjustments but it is still not done being updated I will post something tomorrow. Sorry for the wait.
Thanks, problem solved. any mod can close this now 🙂

Original thread: https://forums.rpgmakerweb.com/threads/checking-all-party-member-levels.23123/