[XP] Average Actor Level

Started by G_G, August 30, 2009, 02:00:17 am

Previous topic - Next topic

G_G

August 30, 2009, 02:00:17 am Last Edit: September 01, 2009, 07:23:13 pm by game_guy
Average Actor Level
Authors: game_guy
Version: 1.0
Type: Level Add-On
Key Term: Actor Add-on



Introduction

What this script does is when you add an actor to the party instead of the actors level being 1 this will average the total level amount of the party and make it so the actor will have the same level area of the party.


Features


  • Makes new party member have level equal to party's averaged level
  • Easy to use
  • Makes it so you can still normally add actors without level averaging



Screenshots

N/A


Demo

Demo


Script

Spoiler: ShowHide

#===============================================================================
# Average Actor Level
# Author game_guy
# Version 1.0
#-------------------------------------------------------------------------------
# Intro:
# What this script does is when you add an actor to the party instead of the
# actors level being 1 this will average the total level amount of the party
# and make it so the actor will have the same level area of the party.
#
# Features:
# Makes new party member have level equal to party's averaged level
# Easy to use
# Makes it so you can still normally add actors without level averaging
#
# Instructions:
# In a script call command just type this in
# a_add_actor(actor_id)
# actor_id = id of the actor in database
# to average the level.
#
# Side Notes:
# This can be easily evented but who cares. I like making things more
# easy.
#
# Credits:
# game_guy ~ for making it
#===============================================================================
class Game_Party
 alias gg_average_levels add_actor
 def add_actor(actor_id, average=false)
   if average
     actor = $game_actors[actor_id]
     level = 0
     for i in 0...$game_party.actors.size
       level += $game_actors[$game_party.actors[i].id].level
     end
     level = level / $game_party.actors.size
     actor.level = level
   end
   gg_average_levels(actor_id)
 end
end
class Game_Actor
 attr_accessor :level
end
class Interpreter
 def a_add_actor(id)
   $game_party.add_actor(id, true)
 end
end



Instructions

In the script.


Compatibility

Should work with everything.
Not tested with SDK


Credits and Thanks


  • game_guy ~ for making it



Author's Notes

Give credits and enjoy.

This can be easily evented but who cares this makes it easier.

Starrodkirby86

Cool script bro, but...can't this be Evented easily?

Set Variable 001 to Actor 01's level
Add Actor 02's level to Variable 001
Add Actor 03's level to Variable 001
Divide Variable 001 by 3
Add New Party Member
Subtract Variable 001 by One (This is because the Party Member will be Level 1)
Set Level of New Party Member by Variable 001

...I guess?

I can see some uses where this script beats eventing though, mainly on parts where Party member count cannot be determined.

What's osu!? It's a rhythm game. Thought I should have a signature with a working rank. ;P It's now clickable!
Still Aqua's biggest fan (Or am I?).




G_G

Yea but didnt you see the side notes in the script? Maybe I should add those.

Blizzard

Quote from: game_guy on August 30, 2009, 02:00:17 am
This can be easily evented but who cares this makes it easier.


Lol, beat me to it. I wanted to say that. xD

It does makes things easier if you don't know who's in your party, though.
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.


ForeverZer0

I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.