Jump to content

Recommended Posts

Author: Mr Trivel
Idea from: here

Name: Static EXP

 

Version: 1.2

Version History: 

1.1a - Reserve Members now properly gain XP if specified.

1.1 - Fixed overflow XP bug and a crash if you had inactive party members.

 

Features: 
Every level now requires same amount of EXP. And enemies give xp based on their level. If enemy is below your character's level, it gives less xp and vice versa.

 

Screenshots: 
No?

 

Instructions: 

EXP box in Enemy database now denotes the Enemies level. E.g. an Enemy with EXP set to 3 will be thought as level 3 enemy.

 

Compatibility fixes:
Yanfly's Victory Aftermath:

 

 

Script order:

--Yanfly's_Aftermath

--Static_EXP

--Static_EXP_Aftermath_Fix

 

Static_EXP_Aftermath_Fix <Link>

 

 

 

 

Script: <Link: Pastebin>

Blog: <Link: On blog>

Edited by Mr. Trivel

Share this post


Link to post
Share on other sites

Thank you so much for this!

 

Now, it doesn't appear to work with Yanfly's Victory Aftermath. I'm getting the error:

Script 'Victory_Aftermath' line 421: NoMethod Error occured

undefined mathod 'name' for nil: NilClass

 

Is there a way these two scripts can become compatible?

Share this post


Link to post
Share on other sites

Quick makeshift compatibility fix:

 

Make sure Static Exp script is below Yanfly's Aftermath script.

Get rid of my display_exp method. (delete it)

Replace Yanfly's self.skip_aftermath with

  def self.skip_aftermath
    $game_party.all_members.each do |actor|
      actor.gain_exp($game_troop.exp_total[$game_party.members.index(actor)])
    end
    $game_party.gain_gold($game_troop.gold_total)
    $game_troop.make_drop_items.each do |item|
      $game_party.gain_item(item, 1)
    end
    close_windows
    SceneManager.return
    replay_bgm_and_bgs
    battle_end(0)
  end

And actor_exp_gain with

def actor_exp_gain(actor)
  n = @exp_total[$game_party.members.index(actor)] * actor.final_exp_rate
  return n.to_i
end

And it works.

Share this post


Link to post
Share on other sites

Okay I'm pretty sure I followed the Aftermath fix correctly, but now I'm getting this error:

 

Script 'Victory_Aftermath' line 251: NameError occured.

 

undefined local variable or method 'close_windows' for Switch:Module

Share this post


Link to post
Share on other sites

My bad. There were 2 self.skip_aftermath methods. One in Switch module another in BattleManager module. Replace the BattleManager one, not Switch one.

 

Or to make it more friendly.

Keep the yanfly script unmoded with my makeshift code.

Just delete display_exp method in my script. And add this on the bottom of my script.

 

 

module BattleManager
  #-----------------------------------
  # new method: self.skip_aftermath
  #--------------------------------------------------------------------------
  def self.skip_aftermath
    $game_party.all_members.each do |actor|
      actor.gain_exp($game_troop.exp_total[$game_party.members.index(actor)])
    end
    $game_party.gain_gold($game_troop.gold_total)
    $game_troop.make_drop_items.each do |item|
      $game_party.gain_item(item, 1)
    end
    close_windows
    SceneManager.return
    replay_bgm_and_bgs
    battle_end(0)
  end
end

class Window_VictoryEXP_Back < Window_Selectable
  #--------------------------------------------------------------------------
  # actor_exp_gain
  #--------------------------------------------------------------------------
  def actor_exp_gain(actor)
    n = @exp_total[$game_party.members.index(actor)] * actor.final_exp_rate
    return n.to_i
  end
end

 

 

Edited by Mr Trivel

Share this post


Link to post
Share on other sites

@Stefan

Fix:

 

module BattleManager  
  def self.gain_exp
    i = 0
    $game_party.all_members.each do |actor|
      temp_actor = Marshal.load(Marshal.dump(actor))
      actor.gain_exp($game_troop.exp_total[i]) if $game_party.battle_members.include?(actor)
      next if actor.level == temp_actor.level
      SceneManager.scene.show_victory_level_up(actor, temp_actor)
      set_victory_text(actor, :level)
      wait_for_message
      i += 1
    end
  end
end 

 

 

 

Or complete one-file fix is updated in OP.

Share this post


Link to post
Share on other sites

 

Mr. Trivel, this is a great script and is exactly what I was looking for.

 

I am having an issue though. It seems whenever I kill an enemy my reserve party members do not gain experience from the kills. I have the box in systems for reserve member exp checked as well.

 

Any help would be appreciated.

 

Share this post


Link to post
Share on other sites

@Stefan

Fix:

 

 

module BattleManager  
  def self.gain_exp
    i = 0
    $game_party.all_members.each do |actor|
      temp_actor = Marshal.load(Marshal.dump(actor))
      actor.gain_exp($game_troop.exp_total[i]) if $game_party.battle_members.include?(actor)
      next if actor.level == temp_actor.level
      SceneManager.scene.show_victory_level_up(actor, temp_actor)
      set_victory_text(actor, :level)
      wait_for_message
      i += 1
    end
  end
end 

 

 

 

Or complete one-file fix is updated in OP.

 

 

Works like a charm! Thx

Share this post


Link to post
Share on other sites

I found another compatibly issue with yanfly's victory aftermath.

Even through the exp-rates are shown correctly after the battle, every actor actualy gets the exp-rate of the current leader of your party.

 

This seems to be handled in the line 507 of victory aftermath

 

 change_exp(self.exp + (exp * final_exp_rate).to_i, enabled)

 

the method does not accept an array witch is build in the static exp-script.

 

Stefan

Share this post


Link to post
Share on other sites

It seems that i found the solution.

 

It mostly works now, when you rewrite the overwrite method gain_exp in yanfly's victory aftermath to:

 

 

def gain_exp(exp)
enabled = !SceneManager.scene_is?(Scene_Battle)
f = 0


$game_party.all_members.each do |actor|

$game_party.members[f].change_exp($game_party.members[f].exp + ($game_troop.exp_total[f]/$game_party.members.size),enabled)


f += 1
end

end

 

 

Weirdly the last member of the party always gets 1 exp less tha he/she should.

Edited by Stefan

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted