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.

How do Rmxp read Character Sheets?

That's it, I just need to know how does the rmxp reads the Character sheets, and how to to change them (The pose in the character sheet, and to load a different character sheet depending in the end like hero.png hero_sword.png.THat kind of things you know..;)), I know it is simple but i can't find it all by myself! Yes I am dumb...and i am starting to learn Ruby.;)

Hope you answer Thanx!
 
Look in Sprite_Character under the update method:
Code:
        self.bitmap = RPG::Cache.character(@character.character_name,
          @character.character_hue)
        @cw = bitmap.width / 4
        @ch = bitmap.height / 4
        self.ox = @cw / 2
        self.oy = @ch


#...

    # If graphic is character
    if @tile_id == 0
      # Set rectangular transfer
      sx = @character.pattern * @cw
      sy = (@character.direction - 2) / 2 * @ch
      self.src_rect.set(sx, sy, @cw, @ch)
    end

Basically, it first gathers the spriteset file, and gets a rectangle portion of the spriteset equal to the width and height / 4.

it then takes the pattern (movement animation) and the direction and finds the area on the spriteset to set as the graphic portion.
 
Thanx for the help, I was realy needing this.
SO if i want to change the sprite sheet, i just use for ex. @charater.character_name + "_a"?
This way it would search for the bitmap called, basil_a?
 
It would use "016-Theif01_a." If you wanted "Basil_a," you'd have to use something like @actor.name + "_a" and be sure to make an attr_reader in $game_actors and put this in a scene where @actor is defined. You couldn't refer to "Basil_a" in an event as there's no way of linking a sprite graphic with a actor's name in the database.
 

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