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 sprites for battle and vice versa. [RESOLVED]

Well I'm using the Tankentai 3.3 English Version 2.0 Side Veiw battler script and I was wondering, is there a way to change that script or the game's original scripting so that the database set sprites for the character appear when you're walking around town but as soon as you get into a battle, the game calls up a different set of sprites for that character?

eg. Walking around town as a human girl but when she gets into a battle with a slime her sprite is that of a mecha.
 
It does not drastically affect the story however it will affect most if not all scenarios that involve any kind of combat (such as after using the Water Mirror) as well as any scenarios that do not involve combat (shoe shopping in Skadi)

Those bracketed bits might as well not be there since you don't know what they're about XD
 
No, I understand that they involve your story, but nothing more then that. Basically, for those events, just put a square of eight events around the main character indicating whether she should be in the mech or outside of the mech. That's what I would do, but it depends on what happens with your scenario's that depends on whether or not that would work.
 
Well the character which we've been calling a "she" is actually a he (not that it really matters) and I will have to go down the parallel process road because he doesn't so much get into the mech as he transforms into the demi-god-organic-mecha... XD

I guess this is sort of solved but not really, no one really bothered to help with the actual problem except you.
 
This should work
Code:
class Sprite_Battler

  #--------------------------------------------------------------------------

  # ● バトラー作成

  #--------------------------------------------------------------------------

  def make_battler_n01

    # 初期配置の取得

    @battler.base_position

    # 色相はバトラーとして認識

    @battler_hue = @battler.battler_hue

    # バトラーがアクターの場合、またはエネミーアニメがオンの場合

    if @anime_flug

      # メイン武器を用意

      @weapon_R = Sprite_Weapon.new(viewport,@battler)

      # エネミー反転がオンの場合、画像を反転させる

      self.mirror = true if !@battler.actor? && @battler.action_mirror

      # Initializes mecha setting as not working

      @mech = false

      begin

        # 味方はキャラクター名、エネミーはバトラー名を取得

        @battler_name = @battler.character_name + '_mech' if @battler.actor?

        @battler_name = @battler.battler_name unless @battler.actor?

        # 歩行グラフィックを利用するかどうかで転送元の矩形サイズの認識先を変える

        self.bitmap = Cache.character(@battler_name) if N01::WALK_ANIME

        self.bitmap = Cache.character(@battler_name + "_1") unless N01::WALK_ANIME

        # If mecha setting worked, remembers it

        @mech = true

      rescue Errno::ENOENT

        # 味方はキャラクター名、エネミーはバトラー名を取得

        @battler_name = @battler.character_name if @battler.actor?

        @battler_name = @battler.battler_name unless @battler.actor?

        # 歩行グラフィックを利用するかどうかで転送元の矩形サイズの認識先を変える

        self.bitmap = Cache.character(@battler_name) if N01::WALK_ANIME

        self.bitmap = Cache.character(@battler_name + "_1") unless N01::WALK_ANIME

      end

      # 転送元の矩形を取得

      @width = self.bitmap.width / @base_width

      @height = self.bitmap.height / @base_height

      # 矩形を設定

      @sx = @pattern * @width

      @sy = @anime_kind * @height

      # バトラー本体を描画

      self.src_rect.set(@sx, @sy, @width, @height)

    # アニメしないバトラーの場合

    else

      # ビットマップを取得、設定

      @battler_name = @battler.battler_name

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

      @width = bitmap.width

      @height = bitmap.height

    end

    # バックアタック時には画像を反転させる

    if $back_attack && @battler.actor?

      self.mirror = true

    elsif $back_attack && !@battler.actor? 

      self.mirror = true

      self.mirror = false if @battler.action_mirror

    else

      self.mirror = false

      self.mirror = true if !@battler.actor? && @battler.action_mirror

    end

    # 武器画像に反映

    @weapon_R.mirroring if self.mirror && @weapon_R != nil

    # 位置を初期化

    @battler.reset_coordinate

    # 原点を決定

    self.ox = @width / 2

    self.oy = @height * 2 / 3

    # スプライトの座標を設定

    update_move

    # アニメ飛ばし用スプライトを用意

    @move_anime = Sprite_MoveAnime.new(viewport,battler)

    # ピクチャ用スプライトを用意

    @picture = Sprite.new

    # ダメージスプライト作成

    @damage = Sprite_Damage.new(viewport,battler)

  end

  #--------------------------------------------------------------------------

  # ● 転送元ビットマップの更新 ※再定義

  #--------------------------------------------------------------------------

  def update_battler_bitmap

    if @battler.actor?

      if (@battler.character_name != @battler_name and

            @battler.character_name + '_mech' != @battler_name) or

            @battler.battler_hue != @battler_hue

        @battler_name =  @battler.character_name + (@mech ? '_mech' : '')

        @battler_hue = @battler.battler_hue

      end

    else

      if @battler.battler_name != @battler_name or @battler.battler_hue != @battler_hue

        @battler_name = @battler.battler_name

        @battler_hue = @battler.battler_hue

      end

      if !@battler.exist?

        self.opacity = 0 if @effect_duration == 0 && @battler.collapse_type != 1

      end  

    end  

  end

end

Just put _mech at the end of the mech version's filename. (guy_mech.png or whatever)
This goes after ATB (1.1).
 
BwdYeti":3md0an14 said:
This should work
Code:
class Sprite_Battler

  #--------------------------------------------------------------------------

  # ● バトラー作成

  #--------------------------------------------------------------------------

  def make_battler_n01

    # 初期配置の取得

    @battler.base_position

    # 色相はバトラーとして認識

    @battler_hue = @battler.battler_hue

    # バトラーがアクターの場合、またはエネミーアニメがオンの場合

    if @anime_flug

      # メイン武器を用意

      @weapon_R = Sprite_Weapon.new(viewport,@battler)

      # エネミー反転がオンの場合、画像を反転させる

      self.mirror = true if !@battler.actor? && @battler.action_mirror

      # Initializes mecha setting as not working

      @mech = false

      begin

        # 味方はキャラクター名、エネミーはバトラー名を取得

        @battler_name = @battler.character_name + '_mech' if @battler.actor?

        @battler_name = @battler.battler_name unless @battler.actor?

        # 歩行グラフィックを利用するかどうかで転送元の矩形サイズの認識先を変える

        self.bitmap = Cache.character(@battler_name) if N01::WALK_ANIME

        self.bitmap = Cache.character(@battler_name + "_1") unless N01::WALK_ANIME

        # If mecha setting worked, remembers it

        @mech = true

      rescue Errno::ENOENT

        # 味方はキャラクター名、エネミーはバトラー名を取得

        @battler_name = @battler.character_name if @battler.actor?

        @battler_name = @battler.battler_name unless @battler.actor?

        # 歩行グラフィックを利用するかどうかで転送元の矩形サイズの認識先を変える

        self.bitmap = Cache.character(@battler_name) if N01::WALK_ANIME

        self.bitmap = Cache.character(@battler_name + "_1") unless N01::WALK_ANIME

      end

      # 転送元の矩形を取得

      @width = self.bitmap.width / @base_width

      @height = self.bitmap.height / @base_height

      # 矩形を設定

      @sx = @pattern * @width

      @sy = @anime_kind * @height

      # バトラー本体を描画

      self.src_rect.set(@sx, @sy, @width, @height)

    # アニメしないバトラーの場合

    else

      # ビットマップを取得、設定

      @battler_name = @battler.battler_name

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

      @width = bitmap.width

      @height = bitmap.height

    end

    # バックアタック時には画像を反転させる

    if $back_attack && @battler.actor?

      self.mirror = true

    elsif $back_attack && !@battler.actor? 

      self.mirror = true

      self.mirror = false if @battler.action_mirror

    else

      self.mirror = false

      self.mirror = true if !@battler.actor? && @battler.action_mirror

    end

    # 武器画像に反映

    @weapon_R.mirroring if self.mirror && @weapon_R != nil

    # 位置を初期化

    @battler.reset_coordinate

    # 原点を決定

    self.ox = @width / 2

    self.oy = @height * 2 / 3

    # スプライトの座標を設定

    update_move

    # アニメ飛ばし用スプライトを用意

    @move_anime = Sprite_MoveAnime.new(viewport,battler)

    # ピクチャ用スプライトを用意

    @picture = Sprite.new

    # ダメージスプライト作成

    @damage = Sprite_Damage.new(viewport,battler)

  end

  #--------------------------------------------------------------------------

  # ● 転送元ビットマップの更新 ※再定義

  #--------------------------------------------------------------------------

  def update_battler_bitmap

    if @battler.actor?

      if (@battler.character_name != @battler_name and

            @battler.character_name + '_mech' != @battler_name) or

            @battler.battler_hue != @battler_hue

        @battler_name =  @battler.character_name + (@mech ? '_mech' : '')

        @battler_hue = @battler.battler_hue

      end

    else

      if @battler.battler_name != @battler_name or @battler.battler_hue != @battler_hue

        @battler_name = @battler.battler_name

        @battler_hue = @battler.battler_hue

      end

      if !@battler.exist?

        self.opacity = 0 if @effect_duration == 0 && @battler.collapse_type != 1

      end  

    end  

  end

end

Just put _mech at the end of the mech version's filename. (guy_mech.png or whatever)
This goes after ATB (1.1).

Unfortunately it doesn't work, for one there is no ATB (1.1) in my Script Editor, so I tried placing it in the add ons section, just above main, and below both the Sideview 1 and Sideview 2 scripts and it did not work, and yes I imported a graphic called $lawrence_mech which was of a tank and the non battle sprite was $lawrence

@alphaao
Part of the Tanekntai script is still in Japanese and it works fine.
 
In that case
Code:
class Sprite_Battler

  #--------------------------------------------------------------------------

  # ● バトラー作成

  #--------------------------------------------------------------------------

  def make_battler

    # 初期配置の取得

    @battler.base_position

    # 色相はバトラーとして認識

    @battler_hue = @battler.battler_hue

    # バトラーがアクターの場合、またはエネミーアニメがオンの場合

    if @anime_flug

      # メイン武器を用意

      @weapon_R = Sprite_Weapon.new(viewport,@battler)

      # エネミー反転がオンの場合、画像を反転させる

      self.mirror = true if !@battler.actor? && @battler.action_mirror

      # Initializes mecha setting as not working

      @mech = false

      begin

        # 味方はキャラクター名、エネミーはバトラー名を取得

        @battler_name = @battler.character_name + '_mech' if @battler.actor?

        @battler_name = @battler.battler_name unless @battler.actor?

        # 歩行グラフィックを利用するかどうかで転送元の矩形サイズの認識先を変える

        self.bitmap = Cache.character(@battler_name) if N01::WALK_ANIME

        self.bitmap = Cache.character(@battler_name + "_1") unless N01::WALK_ANIME

        # If mecha setting worked, remembers it

        @mech = true

      rescue Errno::ENOENT

        # 味方はキャラクター名、エネミーはバトラー名を取得

        @battler_name = @battler.character_name if @battler.actor?

        @battler_name = @battler.battler_name unless @battler.actor?

        # 歩行グラフィックを利用するかどうかで転送元の矩形サイズの認識先を変える

        self.bitmap = Cache.character(@battler_name) if N01::WALK_ANIME

        self.bitmap = Cache.character(@battler_name + "_1") unless N01::WALK_ANIME

      end

      # 転送元の矩形を取得

      @width = self.bitmap.width / @base_width

      @height = self.bitmap.height / @base_height

      # 矩形を設定

      @sx = @pattern * @width

      @sy = @anime_kind * @height

      # バトラー本体を描画

      self.src_rect.set(@sx, @sy, @width, @height)

    # アニメしないバトラーの場合

    else

      # ビットマップを取得、設定

      @battler_name = @battler.battler_name

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

      @width = bitmap.width

      @height = bitmap.height

    end

    # バックアタック時には画像を反転させる

    if $back_attack && @battler.actor?

      self.mirror = true

    elsif $back_attack && !@battler.actor? 

      self.mirror = true

      self.mirror = false if @battler.action_mirror

    else

      self.mirror = false

      self.mirror = true if !@battler.actor? && @battler.action_mirror

    end

    # 武器画像に反映

    @weapon_R.mirroring if self.mirror && @weapon_R != nil

    # 位置を初期化

    @battler.reset_coordinate

    # 原点を決定

    self.ox = @width / 2

    self.oy = @height * 2 / 3

    # スプライトの座標を設定

    update_move

    # アニメ飛ばし用スプライトを用意

    @move_anime = Sprite_MoveAnime.new(viewport,battler)

    # ピクチャ用スプライトを用意

    @picture = Sprite.new

    # ダメージスプライト作成

    @damage = Sprite_Damage.new(viewport,battler)

  end

  #--------------------------------------------------------------------------

  # ● 転送元ビットマップの更新 ※再定義

  #--------------------------------------------------------------------------

  def update_battler_bitmap

    if @battler.actor?

      if (@battler.character_name != @battler_name and

            @battler.character_name + '_mech' != @battler_name) or

            @battler.battler_hue != @battler_hue

        @battler_name =  @battler.character_name + (@mech ? '_mech' : '')

        @battler_hue = @battler.battler_hue

      end

    else

      if @battler.battler_name != @battler_name or @battler.battler_hue != @battler_hue

        @battler_name = @battler.battler_name

        @battler_hue = @battler.battler_hue

      end

      if !@battler.exist?

        self.opacity = 0 if @effect_duration == 0 && @battler.collapse_type != 1

      end  

    end  

  end

end

ATB aliased the make_battler method so I rewrote the original. Without it we need the original method name.
Does it work with this one?
 

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