Subclass Leveling System

I am having a weird glitch problem with the subclass gaining exp. When i get done with a battle the subclass looks something like this:

Top- What it looks like when the subclass is gaining exp
Middle- What it is supposed to look like when it levels up
Bottom- The text that shows when the subclass levels up
The problem I am having is that when the subclass starts to get exp it will stop at around 44% and will tell me that the subclass has leveled up. When I get exp the subclass and primary class level up sometimes even if i get exp that is not enough for them to level up. If anyone is able to help me out, here is a copy of my game to see what can be done to help: http://www.mediafire.com/file/o664a25cffacch8/Guardians_Of_Darkness.zip/file
I really do appreciate it. The download will be different in a little bit, i had to get the newest one that i have uploaded.
The issue is that the tick counter is not continuing from it's last position.
When starting a new battle the tick counter for the subclass is getting 105% subtracted from it
First battle gains 77% exp
second battle should get level up, but it show 50% exp. So it's going down at the starting point.
So the starting point was something like -27%
You subclass still levels up normally but the gauge is not reporting the correct value.
The issue is that the tick counter is not continuing from it's last position.
When starting a new battle the tick counter for the subclass is getting 105% subtracted from it
First battle gains 77% exp
second battle should get level up, but it show 50% exp. So it's going down at the starting point.
So the starting point was something like -27%
You subclass still levels up normally but the gauge is not reporting the correct value.
How do i fix that? BTW, what is up with the Blank class thing in the subclass JP script you did? Do i actually have to have a blank class in the database?
How do i fix that
not sure yet.
what is up with the Blank class thing
I'll revisit that, but it was a part that made it work. You could have sent that message to me in the private message we were having.
I'm working on optimizing the script before releasing it to the public.
not sure yet.
ok, let me know if you figure it out.
I'll revisit that, but it was a part that made it work. You could have sent that message to me in the private message we were having.
I'm working on optimizing the script before releasing it to the public.
ok, let me know how that goes, You are amazing BTW.
Try this out @slickdeath97
Spoiler: Estriole + Yanfly Aftermath patch
Code:
#==============================================================================
#
# ▼ EST - YEA - SUBCLASS ADD ON - Yanfly Engine Ace - Victory Aftermath - Patch
# -- Last Updated: 2019.10.12
# -- Requires: Yanfly Victory Aftermath
# -- addon created by: Roninator2
#==============================================================================
# ▼ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2019.10.12 - Started Script & finished
#==============================================================================
# ▼ Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Corrects a bug where the tick counter resets for the subclass
# Adds in position adjustments for the gauge and text
#==============================================================================

class Game_Actor < Game_Battler
  def sub_exp
    return @exp[@subclass_id]
  end
end
 
class Window_VictoryEXP_Back < Window_Selectable

  def draw_exp_gain(actor, rect)
    dw = rect.width - (rect.width - [rect.width, 96].min) / 2
    dy = rect.y + line_height * 3 + 96
    fmt = YEA::VICTORY_AFTERMATH::VICTORY_EXP
    text = sprintf(fmt, actor_exp_gain(actor).group)
    contents.font.size = YEA::VICTORY_AFTERMATH::FONTSIZE_EXP
    change_color(power_up_color)
    draw_text(rect.x, dy, dw, line_height, text, 2)
  end
 
  def draw_sub_exp_gain(actor, rect)
    return if !actor_sub_exp_gain(actor)
    return if YEA::CLASS_SYSTEM::MAINTAIN_LEVELS
    dw = rect.width - (rect.width - [rect.width, 96].min) / 2
    dy = rect.y + line_height * 5 + 96
    fmt = ESTRIOLE::VICTORY_AFTERMATH::VICTORY_SUB_EXP
    text = sprintf(fmt, actor_sub_exp_gain(actor).group)
    contents.font.size = YEA::VICTORY_AFTERMATH::FONTSIZE_EXP
    change_color(power_up_color)
    draw_text(rect.x, dy, dw, line_height, text, 2)
  end
end

class Window_VictoryEXP_Front < Window_VictoryEXP_Back

  def draw_actor_sub_exp(actor, rect)
    return if !actor.subclass
    return if YEA::CLASS_SYSTEM::MAINTAIN_LEVELS
    rect.y += line_height * 2
    if actor.subclass_level == actor.subclass_max_level
      draw_sub_exp_gauge(actor, rect, 1.0)
      return
    end
    total_ticks = YEA::VICTORY_AFTERMATH::EXP_TICKS
    bonus_exp = actor_sub_exp_gain(actor) * @ticks / total_ticks
    now_exp = (actor.sub_exp - actor.subclass.exp_for_level(actor.subclass_level) + bonus_exp)
    next_exp = actor.subclass.exp_for_level(actor.subclass_level+1) - actor.subclass.exp_for_level(actor.subclass_level)
    rate = now_exp * 1.0 / next_exp
    draw_sub_exp_gauge(actor, rect, rate)
  end
 
  def draw_exp_gauge(actor, rect, rate)
    rate = [[rate, 1.0].min, 0.0].max
    dx = (rect.width - [rect.width, 96].min) / 2 + rect.x
    dy = rect.y + line_height * 2 + 96
    dw = [rect.width, 96].min
    colour1 = rate >= 1.0 ? lvl_gauge1 : exp_gauge1
    colour2 = rate >= 1.0 ? lvl_gauge2 : exp_gauge2
    draw_gauge(dx, dy, dw, rate, colour1, colour2)
    fmt = YEA::VICTORY_AFTERMATH::EXP_PERCENT
    text = sprintf(fmt, [rate * 100, 100.00].min)
    if [rate * 100, 100.00].min == 100.00
      text = YEA::VICTORY_AFTERMATH::LEVELUP_TEXT
      text = YEA::VICTORY_AFTERMATH::MAX_LVL_TEXT if actor.max_level?
    end
    draw_text(dx, dy, dw, line_height, text, 1)
  end
 
  def draw_sub_exp_gauge(actor, rect, rate)
    rate = [[rate, 1.0].min, 0.0].max
    dx = (rect.width - [rect.width, 96].min) / 2 + rect.x
    dy = rect.y + line_height * 2 + 96
    dw = [rect.width, 96].min
    colour1 = rate >= 1.0 ? lvl_gauge1 : exp_gauge1
    colour2 = rate >= 1.0 ? lvl_gauge2 : exp_gauge2
    draw_gauge(dx, dy, dw, rate, colour1, colour2)
    fmt = YEA::VICTORY_AFTERMATH::EXP_PERCENT
    text = sprintf(fmt, [rate * 100, 100.00].min)
    if [rate * 100, 100.00].min == 100.00
      text = YEA::VICTORY_AFTERMATH::LEVELUP_TEXT
      text = YEA::VICTORY_AFTERMATH::MAX_LVL_TEXT if actor.subclass_level == actor.subclass_max_level
    end
    draw_text(dx, dy, dw, line_height, text, 1)
  end

end

Original thread: https://forums.rpgmakerweb.com/threads/subclass-leveling-system.114091/