RPG Maker Forums

Troop EXP Multiplier


by lilyWhite


This script allows you to set a multiplier to the total experience points gained from defeated enemies for each troop. This can be used to give different amounts of EXP for troops composed of the same enemies (e.g. a boss encounter with an enemy can give doubled EXP, while later random encounters give normal EXP) or give greater EXP based on the size of the enemy troop.


How to Use: On the first page of the troop's Battle Event list, create a Comment with the notetag:

Code:
<expmulti: x>
where "x" is the EXP multiplier. The resulting total is rounded to the nearest integer value. If no multiplier is designated for a troop, it will give the normal totalled EXP value.


script.png


Free for use in any commercial or non-commercial project! Credit to "lilyWhite"; I reserve the right to be slightly miffed if you get the capitalization wrong. :3


The script is within the spoiler below. Just copy into the Script Editor, and set multipliers in the Troops tab of the Database.

Code:
=begin

  = Troop EXP Multiplier, by lilyWhite =
  This script allows you to set a multiplier to gained EXP for each enemy
  troop. This can let you create different troops composed of the same
  enemies that rewards different amounts of EXP for whatever reason, or you
  can have larger troops reward greater EXP. The result after the multiplier
  is applied is rounded to the nearest integer value. If no multiplier is
  designated, it will give the totalled EXP as normal.
  
  To use, create a comment on the first page of the troop's Battle Events and
  add this:
  
    <expmulti: x>
    
  where x is the desired multiplier.
  
    For example, with two enemies that give 10 EXP each and a notetag of
    <expmulti: 1.48>, the resulting EXP gain would be 30 EXP.
  
  Usage: Free to use in any commercial or non-commercial project! Credit to
  "lilyWhite"; I reserve the right to be slightly miffed if you get the
  capitalization wrong. :3
    
=end

module RPG
  class Troop
    #------------------------------------------------------------------------
    # Gets troop EXP multiplier
    #------------------------------------------------------------------------
    def troop_exp_multiplier
      exp_multiplier = 1
      @pages[0].list.each do |cmd|
        if cmd.code == 108 && cmd.parameters[0] =~ /<expmulti: (.*)>/i
          exp_multiplier = $1.to_f
        end
      end
      return exp_multiplier
    end
  end
end

class Game_Troop < Game_Unit
  #--------------------------------------------------------------------------
  # * Overwrite exp_total
  #--------------------------------------------------------------------------
  def exp_total
    (dead_members.inject(0) {|r, enemy| r += (enemy.exp * exp_multiplier) }).round
  end
  
  #--------------------------------------------------------------------------
  # Gets troop EXP multiplier
  #--------------------------------------------------------------------------
  def exp_multiplier
    return troop.troop_exp_multiplier
  end
end

Latest Threads

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,450
Members
137,820
Latest member
georg09byron
Top