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.

Change battler size?

Hey guys, I'd like to know how I can change this piece of code to make the size of battlers smaller in RPG Maker XP:

Code:
    # If file name or hue are different than current ones

    if @battler.battler_name != @battler_name or

       @battler.battler_hue != @battler_hue

      # Get and set bitmap

      @battler_name = @battler.battler_name

      @battler_hue = @battler.battler_hue

      self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)

      @width = bitmap.width

      @height = bitmap.height

      self.ox = @width / 2

      self.oy = @height / 1.2

      # Change opacity level to 0 when dead or hidden

      if @battler.dead? or @battler.hidden

        self.opacity = 0

      end

    end

Or, can some one give me the link to a script that lets you change battler sizes? I thought I saw one but I can't find it now. Thanks in advance!
 
Actually, a good chunk of the code you have in the box is not related to battler size. Lemme overcomment it for you, to show what it does.

Code:
    # If file name or hue are different than current ones

    if @battler.battler_name != @battler_name or

       @battler.battler_hue != @battler_hue

      # Get and set bitmap

      # This line sets the name of the bitmap it will look for

      @battler_name = @battler.battler_name

      # This line sets the hue that it will load the bitmap with

      # (That color slider bit for when you pick a battler)

      @battler_hue = @battler.battler_hue

      # This line loads the battler image from file

      self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)

      # These two lines get the height and width of the battler it loaded

      @width = bitmap.width

      @height = bitmap.height

      # These two lines are used to help position the battler after loading it

      # (They need to do this because the editor doesn't use the upper left corner as the position)

      self.ox = @width / 2

      self.oy = @height / 1.2

      # Change opacity level to 0 when dead or hidden

      # These lines make the battler invisible if it's dead or hidden

      if @battler.dead? or @battler.hidden

        self.opacity = 0

      end

    end

That said, if you want to change the actual size of the battler, you can do the following:


Code:
    # If file name or hue are different than current ones

    if @battler.battler_name != @battler_name or

       @battler.battler_hue != @battler_hue

      # Get and set bitmap

      @battler_name = @battler.battler_name

      @battler_hue = @battler.battler_hue

      self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)

      @width = bitmap.width

      @height = bitmap.height

      self.ox = @width / 2

      self.oy = @height / 1.2

      self.zoom_x = 2

      self.zoom_y = 2

      # Change opacity level to 0 when dead or hidden

      if @battler.dead? or @battler.hidden

        self.opacity = 0

      end

    end

The bit I added will double the size of the battlers when they load. Think of that number I set them to as being used to change their height and width via a multiplication problem. If you set it to 2, and the sprite is 10 pixels tall normally, it will go to 20 pixels in height. If you set it to 0.5 instead, it would go to 5 pixels in height.
 
Hey glitch, thanks a lot. I thought I tried zoom before but I guess not. This wasn't exactly what I was looking for but the information you gave me was enough for me to figure out what I needed to do. I really wanted to decrease the size of my battlers so the base image could be bigger so it would have better quality (because I hate pixel art). Thanks again.
 

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