Help with some scripts...

Sorry for the wall of text, but I think I should explain it in the best possible way.
I am using 2 scripts which are the ones in the attached image.
scripts.png

(here is the third script)
One to have an animation when running, and another to have more frames of animation with that action.
The problem comes that, as you can see in the video, this one is buggy even if I have made space for 4 frames (I'm using an 8 characters file.)
also, now the menu crashes the game as you can see in the other attached picture, dropping a blackmorning basic module error.
blackmorning script error.png

i'm not very good with scripting language, so i'm asking for help to know if anyone knows how to fix it.
That's an easy one.
Victor Engine is overwriting Blackmorning script method for draw_character
So since that method is only called once on the exact line that you are getting the error on, you just need to change that one line. Which will remove the ani value from the script but Victor's script doesn't use it.
So that line 1017 just needs to be this
draw_character(actor.character_name, actor.character_index, x, y)

The other functions that call that value will not work properly. (advanced animated menu)
So if you want that to stay you need to copy the method for draw_actor_graphic into the advanced animated menu script where it is calling the method.
Copy this after line 385
Ruby:
  def draw_actor_graphic(actor, x, y, ani = false)
    draw_character(actor.character_name, actor.character_index, x, y, ani)
  end
  def draw_character(character_name, character_index, x, y, ani = false)
    return unless character_name
    bitmap = Cache.character(character_name)
    sign = character_name[/^[\!\$]./]
    if 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 ani
    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, ani ? 255 : translucent_alpha)
  end
that will put the Blackmorning methods right into the class where it is called.
I'm not sure whether or not my dashing script is really involved, but this might help you make the other two scripts a little bit more compatible than before.

EDIT: Let me explain what I did here.

I simply combined both script's draw_character methods so it could retain both features, the so called "ani" alpha feature and the multi frames one.

Ruby:
# * Compatibility Patch for Blackmorning Basic Module + VE Multi-Frames
#   2025-03-10

class Window_Base
  def draw_character(character_name, character_index, x, y, ani = false)
    return unless character_name
    bitmap = Cache.character(character_name)
    sign = character_name[/^[\!\$]./]
    frames = character_name[/\[F(\d+)\]/i] ? $1.to_i : 3
    if sign && sign.include?('$')
      cw = bitmap.width / frames
      ch = bitmap.height / 4
    else
      cw = bitmap.width / (frames * 4)
      ch = bitmap.height / 8
    end
    n = character_index
    step = ani ? @walk : 0
    src_rect = Rect.new((n%4*3+1+step)*cw, (n/4*4)*ch, cw, ch)
    alpha = ani ? 255 : translucent_alpha
    contents.blt(x - cw / 2, y - ch, bitmap, src_rect, alpha)
  end
end
That's an easy one.
Victor Engine is overwriting Blackmorning script method for draw_character
So since that method is only called once on the exact line that you are getting the error on, you just need to change that one line. Which will remove the ani value from the script but Victor's script doesn't use it.
So that line 1017 just needs to be this
draw_character(actor.character_name, actor.character_index, x, y)

The other functions that call that value will not work properly. (advanced animated menu)
So if you want that to stay you need to copy the method for draw_actor_graphic into the advanced animated menu script where it is calling the method.
Copy this after line 385
Ruby:
  def draw_actor_graphic(actor, x, y, ani = false)
    draw_character(actor.character_name, actor.character_index, x, y, ani)
  end
  def draw_character(character_name, character_index, x, y, ani = false)
    return unless character_name
    bitmap = Cache.character(character_name)
    sign = character_name[/^[\!\$]./]
    if 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 ani
    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, ani ? 255 : translucent_alpha)
  end
that will put the Blackmorning methods right into the class where it is called.
Ok, I just tried it, and it works! now the error is gone, thank you very much!

I'm not sure whether or not my dashing script is really involved, but this might help you make the other two scripts a little bit more compatible than before.

EDIT: Let me explain what I did here.

I simply combined both script's draw_character methods so it could retain both features, the so called "ani" alpha feature and the multi frames one.

Ruby:
# * Compatibility Patch for Blackmorning Basic Module + VE Multi-Frames
#   2025-03-10

class Window_Base
  def draw_character(character_name, character_index, x, y, ani = false)
    return unless character_name
    bitmap = Cache.character(character_name)
    sign = character_name[/^[\!\$]./]
    frames = character_name[/\[F(\d+)\]/i] ? $1.to_i : 3
    if sign && sign.include?('$')
      cw = bitmap.width / frames
      ch = bitmap.height / 4
    else
      cw = bitmap.width / (frames * 4)
      ch = bitmap.height / 8
    end
    n = character_index
    step = ani ? @walk : 0
    src_rect = Rect.new((n%4*3+1+step)*cw, (n/4*4)*ch, cw, ch)
    alpha = ani ? 255 : translucent_alpha
    contents.blt(x - cw / 2, y - ch, bitmap, src_rect, alpha)
  end
end
I just tried the patch and it had no effect, I put it in several positions, higher than any other script and it had no effect.
I think I will leave here the set with the “_dash” + [f4] with its name so you can try it.
(I have only made the dash sprites of the first character.)
What Ron was doing is annulling one of the scripts. My patch is a mix of both scripts that include that method. It should have worked if placed just as you find it in my Scripts.zip file. How curious...
What Ron was doing is annulling ome of the scripts. My patch is a mix of both scripts that include that method. It should have worked if placed just as you find it in my Scripts.zip file. How curious...
Maybe you can try now with the set of characters I left there, maybe that will guide you to find a fix.
Can't you just use typical 3x4 individual spritesets for both normal and dash animations?
Then you'd only need to check if you need the _dash filename suffix and that's it.
Plus, I noticed something weird. The file you posted on the board is a mess, to say the least.
You can find 4 bluehaired-guy columns and then just 3 for anybody else, and some unusual white space inbetween...
Can't you just use typical 3x4 individual spritesets for both normal and dash animations?
Then you'd only need to check if you need the _dash filename suffix and that's it.
Plus, I noticed something weird. The file you posted on the board is a mess, to say the least.
You can find 4 bluehaired-guy columns and then just 3 for anybody else, and some unusual white space inbetween...
Well, I had to make the sacrifice of using only 3 frames as you said, I'd rather adapt to that limitation than fight to find a way to increase the frames.
Anyway, now with 3 frames it works fine, but well, I guess that would be all, thank you very much first of all for your script, it really is something that benefits a lot for newcomers who want to have more detail in their games, and thanks for helping me, sorry if it was something annoying, but I'm still new in this world of rpg maker.😅

I send you greetings, I will give you a mention in the credits for helping me, and so on. have a nice evening.
Oh and I know why my script above didn't seem to be working... It was only applied to the Window_Base class, meaning it would only be noticeable on any window class but not on sprites being displayed on the map. Ooooops! :S

It still was needed but only if you wanted to show a single frame of the character on a given window...

Original thread: https://forums.rpgmakerweb.com/threads/help-with-some-scripts.176136/