Help with editing Galv shop menu and Blackmorning menu script

I've been using Modern Algebra's extra movement frames script but found issues when using Blackmorning's advanced animated menu script and Galv's shop menu script. Essentially, the problem is that since I have added extra frames using Modern Algebra's script, the animated sprites no longer match up to how it's supposed to function. For Blackmorning's script, whenever I try to load up the menu it causes my project to crash. And for Galv's script, it improperly shows the animated sprites when showing the parameters for equipping armour, weapons, etc. (Also to note, that I am using the four frame animation for the actors.)

So per request, I'd like a few changes to be included for Blackmorning and Galv's shop menu script, so that it can help support those changes. Thank you.
You may need to provide a demo. Putting those three script in a test demo doesn't give any errors, unless I'm not doing something that is required.
You may need to provide a demo. Putting those three script in a test demo doesn't give any errors, unless I'm not doing something that is required.


Thank you for your time. I've included the demo here:

So when I use Blackmorning's menu script, it includes a walking sprite animation at the bottom of the menu. But due to changes, where actor1 uses the four animated sprite sheet, it causes this error whenever I try to load the menu.


The other issue I have is shown in Galv's shop menu script. Where the actors are shown at the bottom of the screen and you see double, instead of the usual walking animation.
The first is an easy fix, but then you get to see all of the problems that you see in the shop scene
Moving the Extra Movement script to the top will let you load the menu but doesn't really fix the issue.

Add this below the Extra movement script in your list.
Ruby:
class Window_ShopStatus < Window_Base
  def draw_character(character_name, character_index, x, y, enabled)
    return unless character_name
    bitmap = Cache.character(character_name)
    sign = character_name[/^[\!\$]./]
    if sign && sign.include?('$') && character_name.include?('%')
      cw = bitmap.width / 4
      ch = bitmap.height / 4
    elsif sign && sign.include?('$')
      cw = bitmap.width / 3
      ch = bitmap.height / 4
    else
      cw = bitmap.width / 12
      ch = bitmap.height / 8
    end
    n = character_index
    step = 0
    step = @walk if enabled
    src_rect = Rect.new((n%4*3+1+step)*cw, (n/4*4)*ch, cw, ch)
    contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
  end
end
class Window_Base
  def ma_draw_emf_character(character_name, character_index, x, y, ani = false)
    return unless character_name
    if !ma_char_is_emf_sprite?(character_name)
      # Draw regular if there is no frame specification in the name
      maemf_drawcharct_3kq6(character_name, character_index, x, y, ani)
    else
      bitmap = Cache.character(character_name)
      frames = maemf_get_frames(character_name)
      cw, ch = maemf_calc_frame_size(character_name, bitmap, frames)
      n = character_index
      if ani == true
        @next_step ||= 0
        src_rect = Rect.new((n%4*frames[0]+@next_step)*cw, (n/4*4)*ch, cw, ch)
        @next_step += 1
        @next_step = 0 if @next_step > (frames.size - 2)
      else
        src_rect = Rect.new((n%4*frames[0]+frames[1])*cw, (n/4*4)*ch, cw, ch)
      end
      contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
    end
  end
end

This take the % symbol that is in the filename for the character sheet and specify if it is to use it.
You will notice that your character is not centered on the sheet properly once you play test in the shop. The menu doesn't seem to walk. Might be another thing to fix if you want that.
Fixed that now as well. I understand the intent of what Modern Algebra was doing but the code does not iterate through the numbers so I added in a variable to control that.
The first is an easy fix, but then you get to see all of the problems that you see in the shop scene
Moving the Extra Movement script to the top will let you load the menu but doesn't really fix the issue.

Add this below the Extra movement script in your list.
Ruby:
class Window_ShopStatus < Window_Base
  def draw_character(character_name, character_index, x, y, enabled)
    return unless character_name
    bitmap = Cache.character(character_name)
    sign = character_name[/^[\!\$]./]
    if sign && sign.include?('$') && character_name.include?('%')
      cw = bitmap.width / 4
      ch = bitmap.height / 4
    elsif sign && sign.include?('$')
      cw = bitmap.width / 3
      ch = bitmap.height / 4
    else
      cw = bitmap.width / 12
      ch = bitmap.height / 8
    end
    n = character_index
    step = 0
    step = @walk if enabled
    src_rect = Rect.new((n%4*3+1+step)*cw, (n/4*4)*ch, cw, ch)
    contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
  end
end
class Window_Base
  def ma_draw_emf_character(character_name, character_index, x, y, ani = false)
    return unless character_name
    if !ma_char_is_emf_sprite?(character_name)
      # Draw regular if there is no frame specification in the name
      maemf_drawcharct_3kq6(character_name, character_index, x, y, ani)
    else
      bitmap = Cache.character(character_name)
      frames = maemf_get_frames(character_name)
      cw, ch = maemf_calc_frame_size(character_name, bitmap, frames)
      n = character_index
      if ani == true
        @next_step ||= 0
        src_rect = Rect.new((n%4*frames[0]+@next_step)*cw, (n/4*4)*ch, cw, ch)
        @next_step += 1
        @next_step = 0 if @next_step > (frames.size - 2)
      else
        src_rect = Rect.new((n%4*frames[0]+frames[1])*cw, (n/4*4)*ch, cw, ch)
      end
      contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
    end
  end
end

This take the % symbol that is in the filename for the character sheet and specify if it is to use it.
You will notice that your character is not centered on the sheet properly once you play test in the shop. The menu doesn't seem to walk. Might be another thing to fix if you want that.
Fixed that now as well. I understand the intent of what Modern Algebra was doing but the code does not iterate through the numbers so I added in a variable to control that.
Thank you very much! Tested it and it worked fine for the menu and the Galv shop. But yeah, like you said the other issue is just the alignment of my sprite.

Original thread: https://forums.rpgmakerweb.com/threads/help-with-editing-galv-shop-menu-and-blackmorning-menu-script.156612/