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.

Changing the battle graphics?

Hey, I was wondering if anyone knew how to change the battle graphics (when your in battle) from the normal battle graphic (just the person standing there), to a sprite (like when you are walking about).... I don't know if theres just something you can easily change in a script, but I couldn't find anything,

Thanks :D
 
you could either get my Multi-View Battle System and set all of movement options to false or add this in a new script above main (the script I did for a request that was the base of that CBS)

Code:
class Sprite_Battler
#--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    # If battler is nil
    if @battler == nil
      self.bitmap = nil
      loop_animation(nil)
      return
    end
    # If file name or hue are different than current ones
    if @battler.is_a?(Game_Enemy) and (@battler.battler_name != @battler_name or
       @battler.battler_hue != @battler_hue)
      # Get and set bitmap
      if @battler.is_a?(Game_Enemy)
        @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
        # Change opacity level to 0 when dead or hidden
        if @battler.dead? or @battler.hidden
          self.opacity = 0
        end
      end
    elsif @battler.is_a?(Game_Actor) and (@battler.character_name != @battler_name or
      @battler.character_hue != @battler_hue)
      @battler_name = @battler.character_name
      @battler_hue = @battler.character_hue
      self.bitmap = RPG::Cache.character(@battler_name, @battler_hue)
      self.src_rect = Rect.new(0,0,bitmap.width/4,bitmap.height/4)
      self.zoom_x = 2.0
      self.zoom_y = 2.0
      self.x = @battler.screen_x
      self.y = @battler.screen_y
      @width = bitmap.width / 4
      @height = bitmap.height / 4
      self.ox = @width / 2
      self.oy = @height
      # Change opacity level to 0 when dead or hidden
      if @battler.dead? or @battler.hidden
        self.opacity = 0
      end
    end
    # If animation ID is different than current one
    if @battler.damage == nil and
       @battler.state_animation_id != @state_animation_id
      @state_animation_id = @battler.state_animation_id
      loop_animation($data_animations[@state_animation_id])
    end
    # If actor which should be displayed
    if @battler.is_a?(Game_Actor) and @battler_visible
      # Bring opacity level down a bit when not in main phase
      if $game_temp.battle_main_phase
        self.opacity += 3 if self.opacity < 255
      else
        self.opacity -= 3 if self.opacity > 207
      end
    end
    # Blink
    if @battler.blink
      blink_on
    else
      blink_off
    end
    # If invisible
    unless @battler_visible
      # Appear
      if not @battler.hidden and not @battler.dead? and
         (@battler.damage == nil or @battler.damage_pop)
        appear
        @battler_visible = true
      end
    end
    # If visible
    if @battler_visible
      # Escape
      if @battler.hidden
        $game_system.se_play($data_system.escape_se)
        escape
        @battler_visible = false
      end
      # White flash
      if @battler.white_flash
        whiten
        @battler.white_flash = false
      end
      # Animation
      if @battler.animation_id != 0
        animation = $data_animations[@battler.animation_id]
        animation(animation, @battler.animation_hit)
        @battler.animation_id = 0
      end
      # Damage
      if @battler.damage_pop
        damage(@battler.damage, @battler.critical)
        @battler.damage = nil
        @battler.critical = false
        @battler.damage_pop = false
      end
      # Collapse
      if @battler.damage == nil and @battler.dead?
        if @battler.is_a?(Game_Enemy)
          $game_system.se_play($data_system.enemy_collapse_se)
        else
          $game_system.se_play($data_system.actor_collapse_se)
        end
        collapse
        @battler_visible = false
      end
    end
    # Set sprite coordinates
    self.x = @battler.screen_x
    self.y = @battler.screen_y
    self.z = @battler.screen_z
  end
end
 
This is great, thanks! But is there a way to add to that, so that every 4 frames it changes the sprite, e.g.

self.src_rect = Rect.new(0,48,bitmap.width/4,bitmap.height/4)
wait 4 frames
self.src_rect = Rect.new(30,48,bitmap.width/4,bitmap.height/4)
wait 4 frames
self.src_rect = Rect.new(60,48,bitmap.width/4,bitmap.height/4)
wait 4 frames
self.src_rect = Rect.new(90,48,bitmap.width/4,bitmap.height/4)
wait 4 frames
back to the beginning

Thanks very much :D
 

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