iPhone App Directory
RPG Maker VX
 
Gallery Members Search Calendar Help


Welcome Guest ( Log In | Register )

Collapse

>Announcement

Keep an eye out for the upcoming 3rd Quarter Contest!
 
Reply to this topicStart new topic
> Fridgecrisis' EXP Controller (EXPC), Version 1.2
Fridgecrisis
post Mar 18 2010, 11:15 PM
Post #1


We're out of milk?!
Group Icon


Type: Coder
Alignment: Lawful Good




EXP Controller v1.2
Fridgecrisis

This, my very first script, allows greater control over actors' EXP tables, breaking free of the database and allowing for a much bigger scope and different formulas. It was created out of a desire to have smaller numbers in my game, and the lowest settings in the database just weren't low enough. I have included a few simple formulas in the script and plan on adding more over time. Suggestions for future additions are welcome!

Current Formulas
- Set: Requires the same amount of EXP per level (think Fire Emblem or Paper Mario). Now includes a function that reduces enemy EXP as your party's levels go up.
- Steady: Requires the same amount of EXP per level as the level before, plus a certain amount.
- Compound: Same as Steady, only the amount it increases goes up with each level, creating a steeper slope. See script for an example.

Other Features
- Split EXP: splits the total EXP earned from battle between your party members.

Future Features
- Allow different formulas/tables for each actor or class.
- More formulas.

How to Use
Copy and paste the script into its own page above Main. Then edit the variables as the script says and you're good to go!

Script
Spoiler:
CODE
################################################################################
  # Fridgecrisis's EXP Controller (EXPC)                                         #
  #------------------------------------------------------------------------------#
  # Version 1.2
  #
  # This script allows you to easily edit the standard formula for your actors'
  # EXP tables. Place it anywhere below the default scripts and above Main. Then
  # simply edit the variables to your liking and test it out.
  #
  # Version Details:
  # 1.2 - 04/17/10 - Expanded the Set method and added Split EXP.
  # 1.1 - 03/18/10 - Minor format changes.
  # 1.0 - ??/??/10 - Finished Set, Steady, and Compound Methods.
  #
  # Future Features:
  # - Different formulas for different actors.
  # - More methods.
  #
  # Overwrites:
  # - Game_Actor: make_exp_list
  # - Game_Enemy: exp
  # - Game_Troop: exp_total
  #
  ################################################################################
  # Instructions                                                                 #
  #------------------------------------------------------------------------------#
  #
  #-Split EXP--------------#
  # SPLIT_EXP = true/false #
  #------------------------#
  # Setting this to true will split the final EXP received from battle between
  # party members. Setting it to false will use the default method, where each
  # member gets the full amount of EXP.
  #
  #-Choose Method--#
  # EXP_METHOD = x #
  #----------------#
  # This variable sets the method of EXP growth you'd like to use. See below for
  # descriptions of each method.
  #
  #-Method 1: Set------#
  # SET_NEED = x       #
  # SET_LEVEL_TYPE = x #
  # <exp at level x>   #
  #--------------------#
  # The Set method simply requires a certain amount of EXP for each level up, like
  # Fire Emblem or Paper Mario. Enemies will also drop less experience as your
  # levels go up, and SET_LEVEL_TYPE lets you choose how you want your levels to
  # be looked at. Add the <exp at level x> tag into the noteboxes of enemies for
  # them to yield the EXP you set in their database entry when the variable chosen
  # by LEVEL_TYPE is x. There are three options for LEVEL_TYPE: average, highest,
  # and lowest.
  #
  # Here, just look at the formula:
  # exp gained = enemy's regular exp drop * (exp at level / party's average or
  # highest or lowest level)
  #
  # For example, say SET_NEED is 100, LEVEL_TYPE is set to 1 (average), and a
  # Slime is set to drop 25 EXP. You add the tag <exp at level 2> into its
  # notebox. Ralph comes along at level 1 and kills the Slime. He receives 50 EXP,
  # because the normal EXP drop (25) is multiplied by the number in the
  # <exp at level> tag (2), over the party's average level (1). You're basically
  # doubling the experience. At level 2, Ralph will get the 25 EXP the database
  # says he will. But if Ralph comes back at level 5 and kills the Slime, he'll
  # get 2/5 of 25 EXP, or 10 EXP.
  #
  #-Method 2: Steady-#
  # STEADY_NEED = x  #
  # STEADY_ADD  = x  #
  #------------------#
  # The Steady method takes the EXP needed for the previous level and adds a set
  # amount each level.
  #
  #-Method 3: Compound--#
  # COMPOUND_NEED   = x #
  # COMPOUND_ADD    = x #
  # COMPOUND_GROWTH = x #
  #---------------------#
  # The Compound method is like the Steady method, except that the growth gets
  # bigger with each level.
  #
  # For example:
  # base_need = 10, compound_total = 2, and compound_growth = 2:
  # 10 needed for level 2
  # 12 needed for level 3 (10 + 2)
  # 16 needed for level 4 (12 + 4)
  # 22 needed for level 5 (16 + 6)
  # 30 needed for level 6 (22 + 8)
  # and so on.
  #
  #-EDIT HERE!-------------------------------------------------------------------#
  
  module FC
    module EXPC_CUSTOM
  
      SPLIT_EXP         = true # Split final EXP amount between party members?
      
      # Choose Method
      EXP_METHOD        = 1
    
      # Set Method: 1
      SET_NEED          = 100  # How much needed per level?
      SET_LEVEL_TYPE    = 1    # Use what level to determine EXP gain?
                               # 1 = average, 2 = highest, 3 = lowest.
    
      # Steady Method: 2
      STEADY_NEED       = 10   # How much for level 2?
      STEADY_ADD        = 10   # Add how much each level?
    
      # Compound Method: 3
      COMPOUND_NEED     = 10   # How much for level 2?
      COMPOUND_ADD      = 0    # Start additions at what value?
      COMPOUND_GROWTH   = 2    # Grow COMPOUND_ADD how much each level?
    
    end
  end
  
  #-STOP EDITING! (Unless you know what you're doing)----------------------------#
  ################################################################################
  # Import                                                                       #
  #------------------------------------------------------------------------------#
  
  $imported = {} if $imported == nil
  $imported["FC_EXPC"] = true
  
  ################################################################################
  # Note Interpreter                                                             #
  #------------------------------------------------------------------------------#
  
  module FC
    module EXPC
    EXP_AT_LEVEL        = /<(?:EXP_AT_LEVEL|exp at level)[ ]*(\d+)>/i
    end
  end
  
  class RPG::Enemy
    def fc_note_interpreter_expc
      
      @exp_at_level=1
      
      self.note.split(/[\r\n]+/).each { |line|
        case line
        when FC::EXPC::EXP_AT_LEVEL
          @exp_at_level = $1.to_f
        end
      }
    end
  
  #----------------#
  # Applying Notes #
  #----------------#
    
    def exp_at_level
      fc_note_interpreter_expc if @exp_at_level == nil
      return @exp_at_level
    end
  
  end
  
  ################################################################################
  # Game_Actor                                                                   #
  #------------------------------------------------------------------------------#
  
  class Game_Actor < Game_Battler
    
  #---------------------------#
  # Make EXP List (Overwrite) #
  #---------------------------#  
    
    def make_exp_list
      @exp_list[1] = @exp_list[100] = 0
      
      exp_method      = FC::EXPC_CUSTOM::EXP_METHOD
      set_need        = FC::EXPC_CUSTOM::SET_NEED
      steady_need     = FC::EXPC_CUSTOM::STEADY_NEED
      steady_add      = FC::EXPC_CUSTOM::STEADY_ADD
      compound_need   = FC::EXPC_CUSTOM::COMPOUND_NEED
      compound_add    = FC::EXPC_CUSTOM::COMPOUND_ADD
      compound_growth = FC::EXPC_CUSTOM::COMPOUND_GROWTH
      
      case exp_method
      when 1 # Set
        for i in 2..99
          @exp_list[i] = @exp_list[i-1] + set_need
        end
        
      when 2 # Steady
        @exp_list[2] = steady_need
        for i in 3..99
          steady_need += steady_add
          @exp_list[i] = @exp_list[i-1] + Integer(steady_need)
        end
        
      when 3 # Compound
        @exp_list[2] = compound_need
        for i in 3..99
          compound_add += compound_growth
          compound_need += compound_add
          @exp_list[i] = @exp_list[i-1] + Integer(compound_need)
        end
        
      end
    end
  
  end
  
  ################################################################################
  # Game_Enemy                                                                   #
  #------------------------------------------------------------------------------#
  
  class Game_Enemy < Game_Battler
  
  #-----------------#
  # EXP (Overwrite) #
  #-----------------#  
    
    def exp
      result = enemy.exp
      if FC::EXPC_CUSTOM::EXP_METHOD == 1
  
        # Average #
        if FC::EXPC_CUSTOM::SET_LEVEL_TYPE == 1
          level_var = 0
          for actor in $game_party.members do
            level_var += actor.level
          end
          level_var /= $game_party.members.size
          
        # Highest #  
        elsif FC::EXPC_CUSTOM::SET_LEVEL_TYPE == 2
          level_var = 0
          for actor in $game_party.members do
            next if actor.level <= level_var
            level_var = actor.level
          end
          
        # Lowest #
        elsif FC::EXPC_CUSTOM::SET_LEVEL_TYPE == 3
          level_var = 100
          for actor in $game_party.members do
            next if actor.level >= level_var
            level_var = actor.level
          end
        end
        
        exp_yield = enemy.exp_at_level / level_var
        
        result *= exp_yield
      end
      return result.to_i
    end
  
  end
  
  ################################################################################
  # Game_Troop                                                                   #
  #------------------------------------------------------------------------------#
  
  class Game_Troop < Game_Unit
  
  #-----------------------#
  # EXP Total (Overwrite) #
  #-----------------------#  
    
    def exp_total
      exp = 0
      for enemy in dead_members
        exp += enemy.exp unless enemy.hidden
      end
      if FC::EXPC_CUSTOM::SPLIT_EXP
        return exp / $game_party.members.size
      else
        return exp
      end
    end
    
  end
  
  ################################################################################
  # End.                                                                         #
  ################################################################################


Credits/Usage
Written by me, Fridgecrisis. You are free to use this in any project; however, I would like credit! Leave a comment with any questions, suggestions, or problems!

This post has been edited by Fridgecrisis: Apr 17 2010, 08:21 PM


--------------------
My project:

Spoiler:
[||||||||--] Story/Characters
[||--------] Sprites/Tiles
[||--------] Other Graphics
[||--------] Music/Sound
[||--------] Maps/Events
[|||||-----] Database
[|||-------] Scripting
[||--------] Overall

My Scripts:
I support:
Go to the top of the page
 
+Quote Post
   
kogetsuwar
post Mar 19 2010, 06:36 AM
Post #2



Group Icon


Type: Undisclosed




This seems pretty useful. I love the Set exp option. Won't be able to test it out now though.
Go to the top of the page
 
+Quote Post
   
Cyl
post Mar 19 2010, 08:25 AM
Post #3


inactive.
Group Icon


Type: Coder
Alignment: Neutral Good




Nice work. I learned something new again.

But I really don't know why you have to use two modules...
I guess that's just your style.


--------------------
One word:
Paradichlorobenzene

(Currently inactive)
Go to the top of the page
 
+Quote Post
   
Fridgecrisis
post Mar 19 2010, 02:32 PM
Post #4


We're out of milk?!
Group Icon


Type: Coder
Alignment: Lawful Good




I didn't really have to use two modules, you're right. But I just want it to be consistent for all my scripts, you know? In another script I did, I have a module for the user to edit and then a module that's not meant to be edited. This one didn't really need that non-edit module, but I wanted it to be consistent in format with the others.

Anyway, thanks for the feedback! smile.gif I hope somebody finds it useful!


--------------------
My project:

Spoiler:
[||||||||--] Story/Characters
[||--------] Sprites/Tiles
[||--------] Other Graphics
[||--------] Music/Sound
[||--------] Maps/Events
[|||||-----] Database
[|||-------] Scripting
[||--------] Overall

My Scripts:
I support:
Go to the top of the page
 
+Quote Post
   
Riokogen
post Mar 19 2010, 03:45 PM
Post #5


継続は力なり。
Group Icon


Type: Designer
Alignment: Neutral Good




This is great! I don't really like the way VX sets its experience curves so this will be helpful.


--------------------
Go to the top of the page
 
+Quote Post
   
Ultimartix
post Mar 20 2010, 12:41 PM
Post #6


The developer who doesn't listen to himself.
Group Icon


Type: Designer
Alignment: Lawful Good




is this compatable with GTBS?


--------------------
Go to the top of the page
 
+Quote Post
   
IceDragon
post Mar 21 2010, 06:47 PM
Post #7


I demand cookies.
Group Icon


Type: Coder
Alignment: Neutral Good




Yes It is...
You can check the GTBS I posted for that.
If you don't believe that is.


--------------------
Spoiler:





To be Hexa-fied


Spoiler:
Other/Reminders--
Support your cookie loving dragon!

CODE
[url="http://www.rpgmakervx.net/index.php?showuser=52960"][img]http://i56.tinypic.com/2d1pfmw.png[/img][/url]


http://www.rpgmakervx.net/index.php?showto...amp;#entry48215 HA AUTOTILES
Pine's Birthday is the 2th of July

WORK ON YOUR TIME MEMORY @___@
Go to the top of the page
 
+Quote Post
   
Fridgecrisis
post Mar 22 2010, 02:38 PM
Post #8


We're out of milk?!
Group Icon


Type: Coder
Alignment: Lawful Good




Chances are, this script will be compatible with most other scripts, simply because it only redefines one method. If you've got another script that explicitly does something to alter an actor's EXP table, then obviously there will be a problem, but if that function isn't present on your other scripts, you're most likely good to go.


--------------------
My project:

Spoiler:
[||||||||--] Story/Characters
[||--------] Sprites/Tiles
[||--------] Other Graphics
[||--------] Music/Sound
[||--------] Maps/Events
[|||||-----] Database
[|||-------] Scripting
[||--------] Overall

My Scripts:
I support:
Go to the top of the page
 
+Quote Post
   
las Plagues
post Mar 28 2010, 11:07 AM
Post #9



Group Icon






QUOTE (Riokogen @ Mar 19 2010, 04:45 PM) *
This is great! I don't really like the way VX sets its experience curves so this will be helpful.


yea i agree vx exp curves are horrible, i hope it gets an update soon cause i like it!
Go to the top of the page
 
+Quote Post
   
aba3k
post Apr 6 2010, 11:54 PM
Post #10



Group Icon


Type: Undisclosed
Alignment: Chaotic Good




Great work, i was searching for something like this.


--------------------
Go for the eyes Boo, go for the eyes!
Go to the top of the page
 
+Quote Post
   
Fridgecrisis
post Apr 17 2010, 07:57 PM
Post #11


We're out of milk?!
Group Icon


Type: Coder
Alignment: Lawful Good




Updated to version 1.2! Includes reducing enemy EXP drops as your level goes up when using the Set method, and includes the Split EXP function, to allow the total EXP given after battle to be split between your party members.


--------------------
My project:

Spoiler:
[||||||||--] Story/Characters
[||--------] Sprites/Tiles
[||--------] Other Graphics
[||--------] Music/Sound
[||--------] Maps/Events
[|||||-----] Database
[|||-------] Scripting
[||--------] Overall

My Scripts:
I support:
Go to the top of the page
 
+Quote Post
   
aba3k
post Apr 17 2010, 09:56 PM
Post #12



Group Icon


Type: Undisclosed
Alignment: Chaotic Good




QUOTE (Fridgecrisis @ Apr 17 2010, 04:57 PM) *
Updated to version 1.2! Includes reducing enemy EXP drops as your level goes up when using the Set method, and includes the Split EXP function, to allow the total EXP given after battle to be split between your party members.


Guy i was thinking about the split exp... and you got it done before i suggested, hahaha!
Reducing enemy exp by lvl is very handy...........


--------------------
Go for the eyes Boo, go for the eyes!
Go to the top of the page
 
+Quote Post
   
crazedanimekid
post Apr 18 2010, 10:44 PM
Post #13



Group Icon


Type: Designer
Alignment: Unaligned




This is a great script! Thanks much!


--------------------


Go to the top of the page
 
+Quote Post
   
CyanZack
post Nov 27 2010, 06:58 PM
Post #14



Group Icon


Type: Artist




Now this is a script I can live with for the long run. thanks, pal. :3


--------------------
How could you go on living, knowing everything you do is a waste of time?
Go to the top of the page
 
+Quote Post
   
rathgar
post Apr 27 2011, 06:20 AM
Post #15



Group Icon


Type: Designer




How would i go about editing the part of the script that is editable for characters that have specific starting levels? Ex: One or more start at level 2, and need x amount to go up a level, but have a set amount of xp already gained, same for ones that would start at lv. 3?


--------------------
Go to the top of the page
 
+Quote Post
   
rathgar
post May 3 2011, 06:06 PM
Post #16



Group Icon


Type: Designer




I feel the need to bump this, i really need the input.


--------------------
Go to the top of the page
 
+Quote Post
   
solaris32
post Nov 8 2011, 12:04 AM
Post #17



Group Icon


Type: Designer
Alignment: Neutral Good




Why isn't this script more popular? It's the only one I can find that does this! Thank you very much for this script! When you're giving out exp for completing quests, this makes it a lot easier to control how much the player levels.
Go to the top of the page
 
+Quote Post
   
Jessrond
post Feb 1 2012, 08:15 AM
Post #18



Group Icon


Type: Writer




How easy would it be to remove dead players from XP splitting?

If one member dies, the XP is split the same but they do not get any... I think it'd go between the others.
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 1st September 2014 - 05:38 PM

RPGMakerVX.net is an Privacy Policy, Legal.