Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

FFX-2 Edit help

as the title states im using the FFX-2 and im also using the Minkoff sidview and RTAB now...problem is that the status screen shows the whole sprite sheet i just want it to show 1 frame of the sprite sheet. now i was wondering if anyone could provide me the code?
 
Just post one of your sprite sheets and also circle which one you'd like to use. Also, when showing the sprite sheet, the sprite sheet is the battler for the actor not the character set, correct? I don't know exactly how these side-view battle systems are set up exactly.
 
It doesn't matter what you use, if it's an image then you can crop a portion out for whatever in a script, that's why I'm asking.

Well here's what they do with the character set in the Window_Base script.
Code:
#--------------------------------------------------------------------------
  # * Draw Graphic
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #--------------------------------------------------------------------------
  def draw_actor_graphic(actor, x, y)
    bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
    cw = bitmap.width / 4
    ch = bitmap.height / 4
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
  end

Change the first line of that method to this, or just create a new method just like that but with this for the first line. This shows the battler instead of the characterset.
Code:
bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)

For the next line, change the 4 to the number of columns there are on the sprite sheet, for example, on the RTP charactersets there are 4 across, thus being a 4 there. For example if there are 6 across on your spritesheet, change it to 6 like this.
Code:
cw = bitmap.width / 6

For the next line, change the 4 to the number of rows there are on the sprite sheet, for example, on the RTP charactersets there are 4 down, thus being a 4 there. For example if there are 10 down on your spritesheet, change it to 10 like this.
Code:
ch = bitmap.height / 10

For the next line, change the 0s to the x and y pixel location of where the sprite starts. For the top left of a 128 by 192 sprite you just keep the 0s, but for the bottom right sprite of a 4 by 4 128 by 192 pixel sprite, you'd change it to this.
Code:
src_rect = Rect.new(96, 144, cw, ch)

Sorry if I didn't help you enough earlier, I was just going to do it for you, myself, but I guess not.

Here's just an example of showing the 3rd down, 4th sprite across on a 8 by 10 sprite, 256 by 320 pixel spritesheet.
Code:
#--------------------------------------------------------------------------
  # * Draw Sprite Battler
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #--------------------------------------------------------------------------
  def draw_actor_sprite_battler(actor, x, y)
    bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
    cw = bitmap.width / 8
    ch = bitmap.height / 10
    src_rect = Rect.new(64, 96, cw, ch)
    self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
  end

Don't worry about editing that last line, from what I can see, it should be fine. Just add this method to Window_Base and in the Window_Status script, just change draw_actor_graphic to draw_actor_sprite_battler, or whatever you named the new method.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top