Author Topic: [XP] Level Difference Based Exp... Misc Add-on  (Read 21196 times)

Offline Satoh

  • Ethereal Devastator
  • ****
  • Posts: 267
  • LV: 34
  • Yes.
    • View Profile
[XP] Level Difference Based Exp... Misc Add-on
« on: October 24, 2008, 03:10:37 AM »
Fluctuating Experience
Authors: Satoh, Blizzard
Version: 1.01
Type: Experience and Level-up system modification
Key Term: Misc Add-on

Introduction

This script mimics the .hack//Infection-Quarantine leveling system.


Features

  • Level up every 1000 EXP
  • EXP gain is determined by the difference in your level versus that of your enemy

Screenshots

I can't imagine a way to take a screenshot of EXP gaining... O.o

Demo

Basic Demo of a .hack game I'm making which utilizes my script
http://www.megaupload.com/?d=VS42HB7G


Script

(click to show/hide)

Instructions

Instructions are in the script

Compatibility

Put it Between BlizzABS and Main somewhere.

Might not work with CBS's but is compatible with BlizzABS and Standard Battle System.

Credits and Thanks

  • Satoh
  • Boris "Blizzard" Mikić

Author's Notes

At this time, I have not found any current errors, and it should be fine...
If you find any errors, please document them here, and I will attempt to get them fixed.
« Last Edit: March 23, 2019, 06:35:05 PM by Blizzard »
Requesting Rule #1: BE SPECIFIC!!

Light a man a fire and he'll be warm for a night...
Light a man afire and he'll be warm for the rest of his life... ¬ ¬;

My Resources

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20013
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: [XP]Level Difference Based Exp... Misc System/Misc Add-on
« Reply #1 on: October 24, 2008, 03:13:53 AM »
Seems like you did something wrong. *points at script title* ^_^ Also, only one key term works. I suggest Misc Add-on since Misc System is for rather bigger and more complicated stuff. I'll move it into the database already. You will know that you did it right when it appears here properly. ^_^
« Last Edit: October 24, 2008, 03:16:59 AM by Blizzard »
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline winkio

  • Epiq
  • Administrator
  • Guardian of Chaos
  • *****
  • Posts: 4505
  • LV: 199
  • Gender: Male
  • I am lying.
    • View Profile
Re: [XP]Level Difference Based Exp... Misc System/Misc Add-on
« Reply #2 on: October 24, 2008, 03:21:05 AM »
Good job on making this script.  I actually already implemented this concept into my game, but just in the enemies' events, since it uses blizz-abs.  nice work.

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20013
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: [XP]Level Difference Based Exp... Misc Add-on
« Reply #3 on: October 24, 2008, 03:26:09 AM »
You should also put into "Compatibility" that this script goes BELOW Blizz-ABS if it is being used.
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline Satoh

  • Ethereal Devastator
  • ****
  • Posts: 267
  • LV: 34
  • Yes.
    • View Profile
Re: [XP]Level Difference Based Exp... Misc Add-on
« Reply #4 on: October 24, 2008, 03:27:29 AM »
Thanks for the compliment, but as I've said in the script, Blizzard deserves a hefty bit of the credit for the initial error solving...
Perhaps it'll help if you decide to expand your game some then.

I hope it serves anyone who uses it well... It's certainly fulfilling the task I needed it for.

EDIT: @ Blizzard, I thought I did that... perhaps I only mentioned it in the script.... I'll fix it...

EDIT2: ok... it looks like I got everything this time XD... checking one last time....
« Last Edit: October 24, 2008, 03:31:42 AM by Satoh »
Requesting Rule #1: BE SPECIFIC!!

Light a man a fire and he'll be warm for a night...
Light a man afire and he'll be warm for the rest of his life... ¬ ¬;

My Resources

Offline ozoke

  • Trained Member
  • *
  • Posts: 32
  • LV: 3
    • View Profile
Re: [XP] Level Difference Based Exp... Misc Add-on
« Reply #5 on: October 26, 2008, 11:04:24 PM »
this is a great script, just the kind of thing ive been looking for.

i was wondering that instead of comparing against the enemies exp, is it possible to setup a seperate database where the user can assign the enemy id a level and compare against that instead?

just wanted to know if that was possible so that instead of set amounts of xp the player gets a bonus on top of the normal xp they would get. eg you kill a lvl 20 mob, ur lvl 15 so u get base exp + bonus of 30.

thanks.

Offline Satoh

  • Ethereal Devastator
  • ****
  • Posts: 267
  • LV: 34
  • Yes.
    • View Profile
Re: [XP] Level Difference Based Exp... Misc Add-on
« Reply #6 on: October 27, 2008, 01:00:03 AM »
I'm sure it's possible, I'll keep it in mind....

But it'll likely involve reworking a large part of the script... Maybe I'll do it as a separate script... (but don't get your hopes up too much, I'm still kinda new at scripting... I had a lot of help)
Requesting Rule #1: BE SPECIFIC!!

Light a man a fire and he'll be warm for a night...
Light a man afire and he'll be warm for the rest of his life... ¬ ¬;

My Resources

Offline ozoke

  • Trained Member
  • *
  • Posts: 32
  • LV: 3
    • View Profile
Re: [XP] Level Difference Based Exp... Misc Add-on
« Reply #7 on: October 27, 2008, 01:14:24 AM »
np, i worked out how to get it to give you a bonus instead of just a set amount, but im new to the whole RMXP let alone RGSS, havent got a clue even how to start making an enemy level database. if i knew how to to do that then i would probably be able to do it.


Offline Kagutsuchi

  • Ethereal Devastator
  • ****
  • Posts: 468
  • LV: 2
  • Gender: Male
  • The God of .. eating souls?
    • View Profile
    • University Hosted Web Page - In Norwegian
Re: [XP] Level Difference Based Exp... Misc Add-on
« Reply #8 on: December 07, 2008, 02:23:18 AM »
Could you please update it to be compatible with the newest version of blizz-abs?

Offline Jragyn

  • Ethereal Devastator
  • ****
  • Posts: 311
  • LV: 20
  • Gender: Male
  • A prodigy... maybe? Hoo hah.
    • View Profile
    • facenbooken.
Re: [XP] Level Difference Based Exp... Misc Add-on
« Reply #9 on: March 16, 2010, 09:49:02 PM »
So I looked at the script, and perhaps because I'm still rather n00b-esque when it comes to scripting, but I don't understand why this -doesn't- work with blizzABS?

This script in and of itself is pretty amazing, completely re-defines the leveling system AND gives the impression of levels for enemies. I was aiming to create something along these lines sometime soon myself, at least if anything I can use this for reference :D


--JeR
A bright light can either illuminate or blind, but how will you know which until you open your eyes?

Offline Landith

  • Astral Trancist
  • *****
  • Posts: 947
  • LV: 59
  • Gender: Male
    • View Profile
Re: [XP] Level Difference Based Exp... Misc Add-on
« Reply #10 on: March 16, 2010, 10:20:02 PM »
Wow necropost...

Ok one thing, it says it's compatible with Blizz-ABS and unless Blizzard overwrote any of the methods above recently(use a ctrl/shift/F to search for the class) then it is still compatible. Make sure your scripts are in the right order.

Next time check the date of the last post and if it's a long time go ahead and make a new topic. (at least I think that's how it works :^_^':)

Offline G_G

  • Green Gmod Game_Guy AKA G4 AKA hyper-G AKA G-force
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 6591
  • LV: 407
  • Gender: Male
    • View Profile
Re: [XP] Level Difference Based Exp... Misc Add-on
« Reply #11 on: March 17, 2010, 12:24:15 AM »
Quote
Next time check the date of the last post and if it's a long time go ahead and make a new topic. (at least I think that's how it works :^_^'
If it has to do with the topic in general like if you need help its okay. Dont necropost if you're only going to say nice script or good job. But he needed help and asked a simple question about it. So I think its fine xD

Offline Jragyn

  • Ethereal Devastator
  • ****
  • Posts: 311
  • LV: 20
  • Gender: Male
  • A prodigy... maybe? Hoo hah.
    • View Profile
    • facenbooken.
Re: [XP] Level Difference Based Exp... Misc Add-on
« Reply #12 on: March 17, 2010, 09:04:18 AM »
Aye, well, either way, even in a naked project with just blizzABS and the exp modifier script Satoh presents here, above or below the ABS, it will correctly modify the amount of XP to next level, but completely ignores the comparison of enemy.exp to actor.level, and thus ignores the idea of gaining varied exp by the "level" of the monster.

Anyone have any thought? I haven't seen Satoh been very active lately...
A bright light can either illuminate or blind, but how will you know which until you open your eyes?

Offline Jragyn

  • Ethereal Devastator
  • ****
  • Posts: 311
  • LV: 20
  • Gender: Male
  • A prodigy... maybe? Hoo hah.
    • View Profile
    • facenbooken.
Re: [XP] Level Difference Based Exp... Misc Add-on
« Reply #13 on: May 16, 2010, 08:01:47 PM »
Tadaa!
Fixed!

May everyone know and hopefully utilize it as needed. :D
(at least, I know it was working with the version of 2.6 blizzABS,
and so long as the exp_result doesn't change, this should stay functional.)
A bright light can either illuminate or blind, but how will you know which until you open your eyes?

Offline Taiine

  • Ethereal Devastator
  • ****
  • Posts: 311
  • LV: 14
  • Gender: Female
    • View Profile
Re: [XP] Level Difference Based Exp... Misc Add-on
« Reply #14 on: October 03, 2010, 02:21:19 PM »
Sorry for the necropost. But as if the latest version of BABS, (2.80) it's again ignoring the comparison of enemy.exp to actor.level, and is just giving you the 'exp' as per normal.
Hoping someone can update this, as my game has been using this and having it broke is a bit of a set back. Either gong to an older BABS or taking this out fully and enjoying the fun of re-balancing -everythying- :D

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20013
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: [XP] Level Difference Based Exp... Misc Add-on
« Reply #15 on: October 03, 2010, 02:28:09 PM »
Did you put this script below Blizz-ABS?
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline Taiine

  • Ethereal Devastator
  • ****
  • Posts: 311
  • LV: 14
  • Gender: Female
    • View Profile
Re: [XP] Level Difference Based Exp... Misc Add-on
« Reply #16 on: October 03, 2010, 04:28:24 PM »
Yes I did, that is where it has been this whole time. But as soon as I updated the battle system I noted I wasn't gaining levels as I normally did.. taking track of the exp gain.. mobs set at 2exp (a.k.a lv 2) were indeed.. just giving 2 exp.

I just recopied and pasted it in, thinking perhaps there was an update to this that I failed to notice, and now  I get a NameError.
Line 220
undefined method 'setup' for class: 'Scene_Battle::Game_Actor'

That being
  alias setup_satoh_expmod_aliased setup
under calculate.

also have to add an extra 'end' to the bottom or it throws out a syntax error for the very last end of the script.

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20013
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: [XP] Level Difference Based Exp... Misc Add-on
« Reply #17 on: October 03, 2010, 08:32:52 PM »
"Scene_Battle::Game_Actor"? I don't think you copy-pasted the script properly.
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline Taiine

  • Ethereal Devastator
  • ****
  • Posts: 311
  • LV: 14
  • Gender: Female
    • View Profile
Re: [XP] Level Difference Based Exp... Misc Add-on
« Reply #18 on: October 04, 2010, 07:40:35 AM »
Yeah I have. I even set up a fresh game, popped in the BABS and then this right below, even checked to be sure that yes, the whole script is c&ped right, and get the same error.
(click to show/hide)

Offline Jragyn

  • Ethereal Devastator
  • ****
  • Posts: 311
  • LV: 20
  • Gender: Male
  • A prodigy... maybe? Hoo hah.
    • View Profile
    • facenbooken.
Re: [XP] Level Difference Based Exp... Misc Add-on
« Reply #19 on: October 04, 2010, 07:16:11 PM »
It looks like it has something to do with 'end' placement.
I put an end after scene_battle, and it worked just dandy in my 2.8 BABS.

Try this:
Code: [Select]
#==========================================================================
  #--------------------------------------------------------------------------
  # * Fluctuating Experience
  #--------------------------------------------------------------------------
  #   BlizzABS Compatible!!
  #==========================================================================

=begin

Author: Satoh
with massive support from Blizzard
Fixed: J & G_G

So the manner of which this script works, is that Experience-to-next-level
is fixed at 1000. Similer to the Dot.Hack games if you've ever played them.
The experience gained is factored against the difference in level between
you and the foe.

What?
You can't set the level of the enemies?
Well now you can!
All ya gotta do is put the desired level of the foe into the enemies' EXP field.
Seeing as XP-to-next is fixed, XP gained is also somewhat fixed. Therefor, the
EXP field of foes is now used for levels instead.

So fixed XP gain goes as one might guess:
The higher level of a monster you fight over yourself, the greater the XP you
gain. If you really like, you can edit these exact numbers a bit below, but I
suggest you don't bother unless you really know what your doing.


It seems this script was originally written by Mr. Satoh~san, however, when
Blizz-ABS took several steps further, this script did not.

So with G_G as my reference, I took it upon myself to repair its functionality.
Now, it seems to work.
Hurray!


--J

PS_ If you want to edit the actual amounts of experience gained,
jump down to "XP::Setup" for the layout.

=end
  #--------------------------------------------------------------------------
  # * Start After Battle Phase
  #--------------------------------------------------------------------------
class Scene_Battle
  def start_phase5
    if !$BlizzABS
    # Shift to phase 5
    @phase = 5
    # Play battle end ME
    $game_system.me_play($game_system.battle_end_me)
    # Return to BGM before battle started
    $game_system.bgm_play($game_temp.map_bgm)
    # Initialize EXP, amount of gold, and treasure
    exp = 0
    gold = 0
    treasures = []
    # Loop
    for enemy in $game_troop.enemies
      # If enemy is not hidden
      unless enemy.hidden
        # Add EXP and amount of gold obtained
        exp += enemy.exp
        gold += enemy.gold
        # Determine if treasure appears
        if rand(100) < enemy.treasure_prob
          if enemy.item_id > 0
            treasures.push($data_items[enemy.item_id])
          end
          if enemy.weapon_id > 0
            treasures.push($data_weapons[enemy.weapon_id])
          end
          if enemy.armor_id > 0
            treasures.push($data_armors[enemy.armor_id])
          end
        end
      end
    end
    # Treasure is limited to a maximum of 6 items
    treasures = treasures[0..5]
    # Obtaining EXP
        for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      if actor.cant_get_exp? == false
        last_level = actor.level
        for enemy in $game_troop.enemies
          actor.exp += $BlizzABS.Processor.exp_factor(actor, enemy.exp)
        end
      end
    end
    # Obtaining gold
    $game_party.gain_gold(gold)
    # Obtaining treasure
    for item in treasures
      case item
      when RPG::Item
        $game_party.gain_item(item.id, 1)
      when RPG::Weapon
        $game_party.gain_weapon(item.id, 1)
      when RPG::Armor
        $game_party.gain_armor(item.id, 1)
      end
    end
    # Make battle result window
    @result_window = Window_BattleResult.new(exp, gold, treasures)
    # Set wait count
    @phase5_wait_count = 100
    end
  end
end   # The new end that shoulda been there all along :P
  #--------------------------------------------------------------------------
  # * Determine the EXP gained from foes.
  #     renamed method to "exp_factor"
  #     This entire method is merely the difference in level between you
  #     and the foe. The greater the difference, the greater the xp mod.
  #
  #    XP::Setup
  #
  #--------------------------------------------------------------------------
if $BlizzABS
class BlizzABS::Processor
  def exp_factor(actor, exp)
    lvl = exp - actor.level #compare the Enemy Level(EXP field)
                              #with the actor's current level
    sexp = 0
        case lvl
    when 10..100000 # The instance where enemies are 10+ levels higher than you.
      sexp = 520
    when 9
      sexp = 430
    when 8
      sexp = 350
    when 7
      sexp = 280
    when 6
      sexp = 220
    when 5
      sexp = 170
    when 4
      sexp = 130  # enemy levels are higher than yours.
    when 3
      sexp = 100  #^
    when 2        #|
      sexp = 80   #|
    when 1        #|
      sexp = 70
    when 0         # The instance where enemeis and yourself are the same level.
      sexp = 60
    when -1       #|
      sexp = 50   #|
    when -2       #|
      sexp = 40   #V
    when -3
      sexp = 28   #enemy levels are lower than yours.
    when -4
      sexp = 13
    when -5
      sexp = 8
    when -6
      sexp = 6
    when -7
      sexp = 4
    when -8
      sexp = 3
    when -9
      sexp = 2
    when -100000..-10 # The instance where you are 10+ levels higher than the foe.
      sexp = 1
    end
  return sexp
end
  #----------------------------------------------------------------------------
  # exp_result
  #  enemy - the killed enemy event
  #  Processes EXP gain after the death of an enemy.
  #----------------------------------------------------------------------------
  def exp_result(enemy)
      # get EXP
      exp = enemy.exp if enemy.exp != nil
        # All the stuff dealing with Tons
        if $tons_version != nil
          # if version is correct and using Different Difficulties
          if $tons_version >= 6.4 && TONS_OF_ADDONS::DIFFICULTY
            # multiply gained gold
            exp = exp * $game_system.exp_rate / 100
          end
          # if version is correct and using Passive Skills
          if $tons_version >= 6.5 && $game_system.PASSIVE_SKILLS
            # multiply gained gold with each actor's rate
            $game_party.actors.each {|actor| exp *= actor.exp_rate}
            exp = exp.to_i
          end
        end

      # iterate through all party members
      $game_party.actors.each {|actor|
          # increase EXP except if actor can't get EXP
          actor.exp += exp_factor(actor, exp) unless actor.cant_get_exp?}
    # return exp value for further processing
    return exp
  end#def
end#class
$BlizzABS = BlizzABS::Processor.new
end#if
  #--------------------------------------------------------------------------
  # * Calculate EXP
  #--------------------------------------------------------------------------
=begin

This is to prevent character not starting at Lvl 1 from having an EXP boost.

=end
class Game_Actor < Game_Battler
  def make_exp_list
    @exp_list[1] = 0
    for i in 2..100
      @exp_list[i] = 1000
    end
  end
  
  alias setup_satoh_expmod_aliased setup
  def setup(actor_id)
    setup_satoh_expmod_aliased(actor_id)
    @exp = 0
  end
  #--------------------------------------------------------------------------
  # * Change EXP
  #     exp : new EXP
  #--------------------------------------------------------------------------
=begin

Ok, this portion of the script rewrites the Level-up process. Now, anytime you
gain 1000 or more exp you gain a level. Then 1000 exp is subtracted from that
and any leftover exp is saved for your next level.
EXAMPLE:
Markus gains 1040 exp.
Markus levels up once and 1000 is subtracted.
Markus has 40 saved, and only needs 960 for his next level.

=end
  def exp=(exp)
    @exp = [[exp, 9999999].min, 0].max
    # Level up
    if @level <= ($data_actors[@actor_id].final_level - 1)
      while @exp >= 1000
        @level += 1 #unless @level >= $data_actors[@actor_id].final_level
        @exp -= 1000
        # Learn skill
        for j in $data_classes[@class_id].learnings
          if j.level == @level
          learn_skill(j.skill_id)
          end
        end
      end
    else
    @exp = 0
    end
  end
  #--------------------------------------------------------------------------
  # * Get EXP String
  #--------------------------------------------------------------------------
  def exp_s
    if @level != $data_actors[@actor_id].final_level
    return @exp_list[@level+1] > 0 ? @exp.to_s : "-------"
    else
    return "0"
    end
  end
  #--------------------------------------------------------------------------
  # * Get Next Level EXP String
  #--------------------------------------------------------------------------
  def next_exp_s
    if @level != $data_actors[@actor_id].final_level
    return @exp_list[@level+1] > 0 ? @exp_list[@level+1].to_s : "-------"
    else
    return "1000"
    end
  end
  #--------------------------------------------------------------------------
  # * Get Until Next Level EXP String
  #--------------------------------------------------------------------------
  def next_rest_exp_s
    if @level != $data_actors[@actor_id].final_level
    return @exp_list[@level+1] > 0 ?
      (@exp_list[@level+1] - @exp).to_s : "-------"
    else
    return "1000"
    end
  end
end

I probably never got that error because I editted my version of it and omitted that section entirely.
It doesn't seem to be necessary in regards to BABS.
« Last Edit: October 04, 2010, 07:18:44 PM by jragyn00 »
A bright light can either illuminate or blind, but how will you know which until you open your eyes?