Jump to content
Sign in to follow this  
tobbecool53

Show character sprites in battle menu instead of faces

Recommended Posts

Hi!

 

I'm in need of a script which shows the actors' sprites instead of the actors' faces during battles. I already found a script which does all that but it only works for the name input window, the menu window, the skill window and the status window. I've attached a file which containes that script to this post, maybe it'll be enough to just edit it a bit? 

 

Unfortunately I can't really offer anything in return, I'm no artist or such, I mostly just write things. 

 

I'd be really grateful if somebody would help me out. :)

 

Thanks!

Edited by tobbecool53

Share this post


Link to post
Share on other sites

You could always insert a cropped picture of your sprite into the actor's "Face Graphic" field, yanno?

 

Actually, no. It looks weird. Sorry.

Edited by INDOJIN

Share this post


Link to post
Share on other sites

Haha, yeah I know. :P But, I need the script to check for the sprites and such automatically and make the changes accordingly, because the sprites change a lot during the game. There's also quite a lot of sprites. xD

Share this post


Link to post
Share on other sites

It would help if you told us which script you're currently using that shows the characters' faces in battle so we can modify/add-onto it for you. I'm assuming it's Yanfly's Battle Engine? Or are you not using one?

Edited by Gambit.

Share this post


Link to post
Share on other sites

Add this below your battle menu script:

 

 

class Window_BattleStatus < Window_Selectable
  def draw_basic_area(rect, actor)
    draw_actor_graphic(actor, rect.x + 48, rect.y + rect.height - 1)
    if $data_system.opt_display_tp
      draw_actor_icons(actor, rect.x, rect.y, rect.width)
    else
      if $game_party.members.size <= 2
        draw_actor_name(actor, rect.x + 100, rect.y, rect.width - 100)
        draw_actor_icons(actor, rect.x + 100, rect.y + line_height, rect.width - 100)
      else
        draw_actor_name(actor, rect.x, rect.y, rect.width)
        draw_actor_icons(actor, rect.x, rect.y + line_height, rect.width)
      end
    end
  end
  def draw_character(character_name, character_index, x, y, frame = 1)
    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
    src_rect = Rect.new((n%4*3+frame)*cw, (n/4*4)*ch, cw, ch)
    ret_rect = Rect.new(x - cw, y - cw * 2, cw * 2, ch * 2)
    contents.stretch_blt(ret_rect, bitmap, src_rect)
  end
end

 

 

Edited by Gambit.

Share this post


Link to post
Share on other sites

Thank you so much! It worked! :D The sprite comes up a bit low though, how would I change the Y value of the sprites position?  :)

Edited by tobbecool53

Share this post


Link to post
Share on other sites

Yeah I originally had it centered but then it looks odd compared to the gauges... But if you want the centered version, use this.

 

 

 

class Window_BattleStatus < Window_Selectable
  def draw_basic_area(rect, actor)
    draw_actor_graphic(actor, rect.x + 48, rect.y + 80)
    if $data_system.opt_display_tp
      draw_actor_icons(actor, rect.x, rect.y, rect.width)
    else
      if $game_party.members.size <= 2
        draw_actor_name(actor, rect.x + 100, rect.y, rect.width - 100)
        draw_actor_icons(actor, rect.x + 100, rect.y + line_height, rect.width - 100)
      else
        draw_actor_name(actor, rect.x, rect.y, rect.width)
        draw_actor_icons(actor, rect.x, rect.y + line_height, rect.width)
      end
    end
  end
  def draw_character(character_name, character_index, x, y, frame = 1)
    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
    src_rect = Rect.new((n%4*3+frame)*cw, (n/4*4)*ch, cw, ch)
    ret_rect = Rect.new(x - cw, y - cw * 2, cw * 2, ch * 2)
    contents.stretch_blt(ret_rect, bitmap, src_rect)
  end
end

 

 

 

If you want to manually adjust its position, look at line 3:

draw_actor_graphic(actor, rect.x + 48, rect.y + 80)

Increase the 80 to lower the sprite or decrease it to raise it.

Edited by Gambit.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted