Jump to content
Sign in to follow this  
lonequeso

Average Party Level

Recommended Posts

Hi. I want to make a variable fro a conditional branch that checks what the party's average level is. I'm sure there's some little line

of code that'll do it. Thanks!  ^_^

Share this post


Link to post
Share on other sites


avg_lvl = 0
$game_party.members.each {|actor| avg_lvl += actor.level}
avg_lvl /= $game_party.members.length
$game_variables[YOUR_VARIABLE_ID] = avg_lvl


 

obviously replace YOUR_VARIABLE_ID with the id of your variable.

  • Like 1

Share this post


Link to post
Share on other sites

A little more than a line, but it worked!  :P

 

Thanks for the quick response  :) This one is solved.  :lock:

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted