VXAce modern algebra's ATS Face Options and large faceset files

Been messing around in a test project with some scripts I found in Archeia's VXA script repo on github, and came across modern algebra's ATS scripts. Since in my main project I've been looking for an animated message box faces script, I figured I'd plug it into a blank test project to see how it works. While testing, I noticed that it isn't playing nice with my current faceset setup.

I read in another thread a while back that facesets can have as many rows as you want them to have, the individual cells just need to be the default 96x96 pixel size, and so I've been separating my facesets based on mood for each character, with some 'moods' taking up as many as five or six rows. Including an example:

brooke_worry.png

When using modern algebra's Face Options script, however, I've noticed that the blinking animation functionality doesn't quite seem to work if the faceset has more than two rows, and using the \fb{4} tag for example will instead draw the face in cell 12. I've triple-checked to make sure the syntax I'm using is correct according to the script instructions, so my only guess is that when it divides the bitmap into cells, it for some reason skips over the second and third rows because the image is larger than the standard 4x2 cell format.

EDIT: Also, it looks like setting the message face graphic to anything other than a face in the first row will just, not draw the correct graphic entirely.

It isn't a huge deal if there's no fix since I already have an alternative, but I still figured I'd ask just in case.

The script here.
Hello, ATS script assumes that faces may have bigger size but are limited to 2 rows and 4 columns (much like charsets) with $ being a single face.

I've modified a few lines to reintroduce the vanilla behavior for faces without the $ in their names:
Ruby:
class Window_ATS_Face < Window_Base
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # alias method: draw_face (replace the default case)
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias tim_draw_face draw_face
  def draw_face(face_name, face_index, x, y, enabled = true, *args)
    return tim_draw_face(face_name, face_index, x, y, enabled, *args) if face_name[/\A\$/] != nil # SINGLE
    bitmap = Cache.face(face_name)
    #fw, fh = bmp.width, bmp.height
    #fw /= 4
    #fh /= 2
    fw = fh = 96
    rect = Rect.new(face_index % 4 * fw, face_index / 4 * fh, fw, fh)
    contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
    bitmap.dispose
  end
end #Window_ATS_Face
class Spriteset_ATS_Face
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # overwrite method: resize_face -> now takes only 96 rows
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def resize_face(face_name, face_index = 0)
    # Get set size
    wdth, hght = $game_message.face_width, $game_message.face_height
    face = Cache.face(face_name)
    fw, fh = face.width, face.height
    face.dispose
    # Adjust face width and height if faceset not single
    if face_name[/\A\$/] == nil
      #modified:
      fw = fh = 96
      #fw /= 4
      #fh /= 2
      #/modified
    else
      fw /= $1.to_i if face_name[/\%\[\s*(\d+)\s*\]/]
    end
    wdth = wdth <= 0 ? fw : [fw, wdth].min
    hght = hght <= 0 ? fh : [fh, hght].min
    @face_window.resize([wdth, $game_message.face_width].max, [hght, $game_message.face_height].max)
  end
end #Spriteset_ATS_Face

Can you tell me if it works well for you?
Hello, ATS script assumes that faces may have bigger size but are limited to 2 rows and 4 columns (much like charsets) with $ being a single face.

I've modified a few lines to reintroduce the vanilla behavior for faces without the $ in their names:
Ruby:
class Window_ATS_Face < Window_Base
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # alias method: draw_face (replace the default case)
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias tim_draw_face draw_face
  def draw_face(face_name, face_index, x, y, enabled = true, *args)
    return tim_draw_face(face_name, face_index, x, y, enabled, *args) if face_name[/\A\$/] != nil # SINGLE
    bitmap = Cache.face(face_name)
    #fw, fh = bmp.width, bmp.height
    #fw /= 4
    #fh /= 2
    fw = fh = 96
    rect = Rect.new(face_index % 4 * fw, face_index / 4 * fh, fw, fh)
    contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
    bitmap.dispose
  end
end #Window_ATS_Face
class Spriteset_ATS_Face
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # overwrite method: resize_face -> now takes only 96 rows
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def resize_face(face_name, face_index = 0)
    # Get set size
    wdth, hght = $game_message.face_width, $game_message.face_height
    face = Cache.face(face_name)
    fw, fh = face.width, face.height
    face.dispose
    # Adjust face width and height if faceset not single
    if face_name[/\A\$/] == nil
      #modified:
      fw = fh = 96
      #fw /= 4
      #fh /= 2
      #/modified
    else
      fw /= $1.to_i if face_name[/\%\[\s*(\d+)\s*\]/]
    end
    wdth = wdth <= 0 ? fw : [fw, wdth].min
    hght = hght <= 0 ? fh : [fh, hght].min
    @face_window.resize([wdth, $game_message.face_width].max, [hght, $game_message.face_height].max)
  end
end #Spriteset_ATS_Face

Can you tell me if it works well for you?
Yep, as far as I can tell that works! Thank you! ^^

Original thread: https://forums.rpgmakerweb.com/threads/modern-algebras-ats-face-options-and-large-faceset-files.180967/