Freebird Games Community

Games & Design => RM[XP/VX/MV] and Game Design => Topic started by: Raxus on October 15, 2011, 05:14:41 PM

Title: Anyone got a battle system that...?
Post by: Raxus on October 15, 2011, 05:14:41 PM
Anyone got a battle system that uses sprites but is turn-based? :salbrow:
Title: Re: Anyone got a battle system that...?
Post by: Sarkilas on October 15, 2011, 05:18:18 PM
You mean just like the default except it uses character sets rather than battlers? There was one made by Paradog but the site's down, so I found it in my collection, believe it or not. Hoping this is what you were looking for.

Spoiler: show
Code: [Select]
#==============================================================================
# ++ サイドビューバトル(歩行グラフィック版) ver. 1.14 ++
#  Script by Paradog
#  http://para.j-mx.com/
#------------------------------------------------------------------------------
# バトルフィールドに歩行グラフィックを表示します。
#==============================================================================

module SDVA
 
  X_LINE = 280       # 横位置のバトラー表示座標
  Y_LINE = 300        # 縦位置のバトラー表示座標
  X_SPACE = 32       # 横位置のバトラー同士の間隔
  Y_SPACE = 0        # 縦位置のバトラー同士の間隔
  X_POSITION = 0     # 隊列[前衛・中衛・後衛]の横間隔
  Y_POSITION = 10      # 隊列[前衛・中衛・後衛]の縦間隔
 
  ATTACK_MOVE = true  # 攻撃時に前へ踏み出すか( true / false )
  SKILL_MOVE = true   # スキル使用時に前へ踏み出すか( true / false )
  ITEM_MOVE = true   # アイテム使用時に前へ踏み出すか( true / false )
  MOVE_STEP = 3       # 移動歩数
  MOVE_PIXEL = 8     # 一歩あたりのピクセル数
 
  PARTY_POS = 3       # キャラクターの向き( 0:下 / 1:左 / 2:右 / 3:上 )
  ENEMY_POS = 0

  WINDOWPOS_CHANGE = true   # コマンドウインドウをバトラーの横に表示するか( true / false )

  end
 
#==============================================================================
# ■ Game_Actor
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # ● バトル画面 X 座標の取得
  #--------------------------------------------------------------------------
  def screen_x
    if self.index != nil
      # 隊列を取得
      pos = $data_classes[self.class_id].position
      x_pos = pos * SDVA::X_POSITION
      scr_x = self.index * SDVA::X_SPACE + SDVA::X_LINE + x_pos
      # 移動アクションのとき
      if self.current_action.move_action == true
        # 横に移動
        scr_x += @shift_x
      end
      return scr_x
    else
      return 0
    end
  end
  #--------------------------------------------------------------------------
  # ● バトル画面 Y 座標の取得
  #--------------------------------------------------------------------------
  def screen_y
    if self.index != nil
      # 隊列を取得
      pos = $data_classes[self.class_id].position
      y_pos = pos * SDVA::Y_POSITION
      scr_y = self.index * SDVA::Y_SPACE + SDVA::Y_LINE + y_pos
      # 移動アクションのとき
      if self.current_action.move_action == true
        # 縦に移動
        scr_y += @shift_y
      end
      return scr_y
    else
      return 0
    end
  end
  #--------------------------------------------------------------------------
  # ● バトル画面 Z 座標の取得
  #--------------------------------------------------------------------------
  def screen_z
    if self.index != nil
      return self.index
    else
      return 0
    end
  end
end

class Game_Enemy < Game_Battler
  def screen_y_obtain
    return $data_troops[@troop_id].members[@member_index].y
  end
  #--------------------------------------------------------------------------
  # ● バトル画面 Y 座標の取得
  #--------------------------------------------------------------------------
  def screen_y
    if self.index != nil
      # 隊列を取得
      y_pos = screen_y_obtain
      scr_y = y_pos
      # 移動アクションのとき
      if self.current_action.move_action == true
        # 縦に移動
        scr_y += @shift_y
      end
      return scr_y
    else
      return 0
    end
  end
  #--------------------------------------------------------------------------
  # ● バトル画面 Z 座標の取得
  #--------------------------------------------------------------------------
  def screen_z
    if self.index != nil
      return self.index
    else
      return 0
    end
  end
end

#==============================================================================
# ■ Game_Battler (分割定義 1)
#==============================================================================

class Game_Battler
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_reader   :pattern        # 歩行パターン
  attr_reader   :trans_x        # X方向の移動距離
  attr_reader   :moving         # 移動中フラグ
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  alias initialize_sdva initialize
  def initialize
    initialize_sdva
    move_reset
  end
  #--------------------------------------------------------------------------
  # ○ 移動カウント
  #--------------------------------------------------------------------------
  def move_hero
    @moving = 1
      if @step < SDVA::MOVE_STEP
        # 歩数を満たすまで移動
        @pattern = (@pattern + 1) % 4
        @step += 1
        move_step
      else
        # 移動終了
        @pattern = 1
        @moving = 2
      end
    end
   
  def move_enemy
    @moving = 1
      if @step < SDVA::MOVE_STEP
        # 歩数を満たすまで移動
        @pattern = (@pattern + 1) % 4
        @step += 1
        move_enemy_step
      else
        # 移動終了
        @pattern = 1
        @moving = 2
      end
  end
  #--------------------------------------------------------------------------
  # ○ 移動処理
  #--------------------------------------------------------------------------
  def move_step
  # パーティの向きによって移動座標を変える
  case SDVA::PARTY_POS
    when 0
      @shift_y = @step * SDVA::MOVE_PIXEL
    when 1
      @shift_x = -(@step * SDVA::MOVE_PIXEL)
    when 2
      @shift_x = @step * SDVA::MOVE_PIXEL
    when 3
      @shift_y = -(@step * SDVA::MOVE_PIXEL)
    end       
  end
  #--------------------------------------------------------------------------
  # ○ 移動処理
  #--------------------------------------------------------------------------
  def move_enemy_step
  # パーティの向きによって移動座標を変える
  case SDVA::ENEMY_POS
    when 0
      @shift_y = @step * SDVA::MOVE_PIXEL
    when 1
      @shift_x = -(@step * SDVA::MOVE_PIXEL)
    when 2
      @shift_x = @step * SDVA::MOVE_PIXEL
    when 3
      @shift_y = -(@step * SDVA::MOVE_PIXEL)
    end       
  end
  #--------------------------------------------------------------------------
  # ○ 移動のリセット
  #--------------------------------------------------------------------------
  def move_reset
    @moving = 0
    @pattern = 0
    @step = 0
    @shift_x = 0
    @shift_y = 0
  end
end

#==============================================================================
# ■ Game_BattleAction
#==============================================================================

class Game_BattleAction
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :move_action             # 移動するアクションか
  #--------------------------------------------------------------------------
  # ● クリア
  #--------------------------------------------------------------------------
  alias clear_sdva clear
  def clear
    clear_sdva
    @move_action = false
  end
end

#==============================================================================
# ■ Sprite_Battler
#==============================================================================

class Sprite_Battler < RPG::Sprite
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  alias update_sdva update
  def update
    # バトラーがアクターに含まれるとき
    if @battler.is_a?(Game_Actor) or @battler.is_a?(Game_Enemy)
      # ファイル名か色相が現在のものと異なる場合
      # 行動中の場合
      if @battler.battler_name != @battler_name or
         @battler.battler_hue != @battler_hue or
         @battler.current_action.basic == 0 or
         @battler.current_action.kind != 3
        # 歩行グラフィックを描画
        if @battler.is_a?(Game_Actor)
          @character_name = @battler.character_name
          @character_hue = @battler.character_hue
          self.bitmap = RPG::Cache.character(@character_name, @character_hue)
          cw = self.bitmap.width / 4
          ch = self.bitmap.height / 4
          @width = cw
          @height = ch
          if @battler.current_action.move_action == true
            # 歩かせる
            @battler.move_hero
          else
            @battler.move_reset
          end
          # 転送元の矩形を設定
          sx = @battler.pattern * cw
          sy = SDVA::PARTY_POS * ch
          self.src_rect.set(sx, sy, cw, ch)
          self.ox = @width / 2
          self.oy = @height
          # 隠れ状態なら不透明度を 0 にする
          if @battler.hidden
            self.opacity = 0
          end
        elsif @battler.is_a?(Game_Enemy)
          self.bitmap = RPG::Cache.character(@battler.battler_name, @battler.battler_hue)
          cw = self.bitmap.width / 4
          ch = self.bitmap.height / 4
          @width = cw
          @height = ch
          if @battler.current_action.move_action == true
            # 歩かせる
            @battler.move_enemy
          else
            @battler.move_reset
          end
          # 転送元の矩形を設定
          sx = @battler.pattern * cw
          sy = SDVA::ENEMY_POS * ch
          self.src_rect.set(sx, sy, cw, ch)
          self.ox = @width / 2
          self.oy = @height
          # 隠れ状態なら不透明度を 0 にする
          if @battler.hidden
            self.opacity = 0
          end
          end
      end
    end
    update_sdva
  end
end
 
#==============================================================================
# ■ Scene_Battle
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # ● アクターコマンドウィンドウのセットアップ
  #--------------------------------------------------------------------------
  alias phase3_setup_command_window_sdva phase3_setup_command_window
  def phase3_setup_command_window
    phase3_setup_command_window_sdva
    if SDVA::WINDOWPOS_CHANGE
      # アクターコマンドウィンドウの位置を設定
      case SDVA::PARTY_POS
        when 0
          x_pos = @active_battler.screen_x - (@actor_command_window.width/2)
          y_pos = @active_battler.screen_y
        when 1
          x_pos = @active_battler.screen_x - @actor_command_window.width - 16
          y_pos = @active_battler.screen_y - @actor_command_window.height
        when 2
          x_pos = @active_battler.screen_x + 16
          y_pos = @active_battler.screen_y - @actor_command_window.height
        when 3
          x_pos = @active_battler.screen_x - (@actor_command_window.width/2)
          y_pos = @active_battler.screen_y - @actor_command_window.height - 48
      end
      @actor_command_window.x = x_pos >= 0 ? x_pos : 0
      @actor_command_window.x = x_pos+@actor_command_window.width <= 640 ? x_pos : 640-@actor_command_window.width
      @actor_command_window.y = y_pos >= 0 ? y_pos : 0
      @actor_command_window.y = y_pos+@actor_command_window.height <= 480 ? y_pos : 480-@actor_command_window.height
      # ステータスウインドウに隠れないように
      @actor_command_window.z = 9999
    end
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (メインフェーズ ステップ 3 : 行動側アニメーション)
  #--------------------------------------------------------------------------
  alias update_phase4_step3_sdva update_phase4_step3
  def update_phase4_step3
    if SDVA::ATTACK_MOVE
      if @active_battler.current_action.basic == 0
        @active_battler.current_action.move_action = true
      end
    end
    if SDVA::SKILL_MOVE
      if @active_battler.current_action.kind == 1
        @active_battler.current_action.move_action = true
      end
    end
    if SDVA::ITEM_MOVE
      if @active_battler.current_action.kind == 2
        @active_battler.current_action.move_action = true
      end
    end
    # バトラーがアクターに含まれ、移動アクション中
    if @active_battler.is_a?(Game_Actor) and
     @active_battler.current_action.move_action
      # 移動終了時
      if @active_battler.moving == 2
        update_phase4_step3_sdva
      end
    elsif @active_battler.moving == 0
      update_phase4_step3_sdva
    end
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
  #--------------------------------------------------------------------------
  alias update_phase4_step6_sdva update_phase4_step6
  def update_phase4_step6
    @active_battler.current_action.move_action = false
    @active_battler.move_reset
    update_phase4_step6_sdva
  end
end

#==============================================================================
# ■ Spriteset_Battle
#==============================================================================

class Spriteset_Battle
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  alias initialize_sdva initialize
  def initialize
    initialize_sdva
    @viewport2.z = 1
  end
end

#==============================================================================
# ■ Arrow_Actor
#==============================================================================

class Arrow_Actor < Arrow_Base
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  alias update_sdva update
  def update
    update_sdva
    # カーソル下
    if Input.repeat?(Input::DOWN)
      $game_system.se_play($data_system.cursor_se)
      @index += 1
      @index %= $game_party.actors.size
    end
    # カーソル上
    if Input.repeat?(Input::UP)
      $game_system.se_play($data_system.cursor_se)
      @index += $game_party.actors.size - 1
      @index %= $game_party.actors.size
    end
  end
end

#==============================================================================
# ■ Arrow_Enemy
#==============================================================================

class Arrow_Enemy < Arrow_Base
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  alias update_sdva update
  def update
    update_sdva
    # カーソル下
    if Input.repeat?(Input::DOWN)
      $game_system.se_play($data_system.cursor_se)
      $game_troop.enemies.size.times do
        @index += 1
        @index %= $game_troop.enemies.size
        break if self.enemy.exist?
      end
    end
    # カーソル上
    if Input.repeat?(Input::UP)
      $game_system.se_play($data_system.cursor_se)
      $game_troop.enemies.size.times do
        @index += $game_troop.enemies.size - 1
        @index %= $game_troop.enemies.size
        break if self.enemy.exist?
      end
    end
  end
end
Title: Re: Anyone got a battle system that...?
Post by: Raxus on October 15, 2011, 05:21:48 PM
Yup, like that but I've got a few questions:

1. Where do I put this script? I put it below everything and above main and it's not doing anything.

2. Is it possible to edit it so that the allies and enemies have weapons by editing the sprites?
Title: Re: Anyone got a battle system that...?
Post by: Sarkilas on October 15, 2011, 05:26:11 PM
How did you find out it was what you wanted if it didn't work when you added it above Main? Because it works fine for me when I do that. Do you use any other scripts that may interfere with Scene_Battle?

That should technically be possible, but the script only uses one sprite. And it only uses the second frame of the moving animation when an ally/enemy attacks. It would need modifications if you want complete animations for attacks and the likes.

Also, the class setting in the database for front, back, middle will also decide where the allies will stand in formation in the battle screens, so you can put your vulnerable mages in the back and your tanks in front to make it seem a bit "smarter" :p
Title: Re: Anyone got a battle system that...?
Post by: Raxus on October 15, 2011, 05:38:42 PM
How did you find out it was what you wanted if it didn't work when you added it above Main?

HA! You don't know me all that well. XD I knew what you were talking about and was able to figure that, yes, that was it.

I figured out my own stupidity... Instead of trying to start the battle via a Test Map, I did it via the database, and that didn't work.

Now that I see it in act, I really like how it is set up! really neat and I figured out how to move the enemies and...yeah, cool.

I want some modifications with the whole GIANT menu at the bottom with the characters' health and such. Any suggestions?

(Oh, and really, thank you.)
Title: Re: Anyone got a battle system that...?
Post by: Sarkilas on October 15, 2011, 05:48:23 PM
You would need to expand the battleback viewport and stretch battlebacks to fit the whole screen and then you can start messing with the rest of the layout. If you replace "Spriteset_Battle" with this quick change, it should make all battlebacks fill the screen completely.

Code: [Select]
#==============================================================================
# ** Spriteset_Battle
#------------------------------------------------------------------------------
#  This class brings together battle screen sprites. It's used within
#  the Scene_Battle class.
#==============================================================================

class Spriteset_Battle
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader   :viewport1                # enemy viewport
  attr_reader   :viewport2                # actor viewport
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    # Make viewports
    @viewport1 = Viewport.new(0, 0, 640, 480)
    @viewport2 = Viewport.new(0, 0, 640, 480)
    @viewport3 = Viewport.new(0, 0, 640, 480)
    @viewport4 = Viewport.new(0, 0, 640, 480)
    @viewport2.z = 101
    @viewport3.z = 200
    @viewport4.z = 5000
    # Make battleback sprite
    @battleback_sprite = Sprite.new(@viewport1)
    # Make enemy sprites
    @enemy_sprites = []
    for enemy in $game_troop.enemies.reverse
      @enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
    end
    # Make actor sprites
    @actor_sprites = []
    @actor_sprites.push(Sprite_Battler.new(@viewport2))
    @actor_sprites.push(Sprite_Battler.new(@viewport2))
    @actor_sprites.push(Sprite_Battler.new(@viewport2))
    @actor_sprites.push(Sprite_Battler.new(@viewport2))
    # Make weather
    @weather = RPG::Weather.new(@viewport1)
    # Make picture sprites
    @picture_sprites = []
    for i in 51..100
      @picture_sprites.push(Sprite_Picture.new(@viewport3,
        $game_screen.pictures[i]))
    end
    # Make timer sprite
    @timer_sprite = Sprite_Timer.new
    # Frame update
    update
  end
  #--------------------------------------------------------------------------
  # * Dispose
  #--------------------------------------------------------------------------
  def dispose
    # If battleback bit map exists, dispose of it
    if @battleback_sprite.bitmap != nil
      @battleback_sprite.bitmap.dispose
    end
    # Dispose of battleback sprite
    @battleback_sprite.dispose
    # Dispose of enemy sprites and actor sprites
    for sprite in @enemy_sprites + @actor_sprites
      sprite.dispose
    end
    # Dispose of weather
    @weather.dispose
    # Dispose of picture sprites
    for sprite in @picture_sprites
      sprite.dispose
    end
    # Dispose of timer sprite
    @timer_sprite.dispose
    # Dispose of viewports
    @viewport1.dispose
    @viewport2.dispose
    @viewport3.dispose
    @viewport4.dispose
  end
  #--------------------------------------------------------------------------
  # * Determine if Effects are Displayed
  #--------------------------------------------------------------------------
  def effect?
    # Return true if even 1 effect is being displayed
    for sprite in @enemy_sprites + @actor_sprites
      return true if sprite.effect?
    end
    return false
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update actor sprite contents (corresponds with actor switching)
    @actor_sprites[0].battler = $game_party.actors[0]
    @actor_sprites[1].battler = $game_party.actors[1]
    @actor_sprites[2].battler = $game_party.actors[2]
    @actor_sprites[3].battler = $game_party.actors[3]
    # If battleback file name is different from current one
    if @battleback_name != $game_temp.battleback_name
      @battleback_name = $game_temp.battleback_name
      if @battleback_sprite.bitmap != nil
        @battleback_sprite.bitmap.dispose
      end
      @battleback_sprite.bitmap = Bitmap.new
      b = RPG::Cache.battleback(@battleback_name)
      rect = Rect.new(0, 0, 640, 480)
      @battleback_sprite.bitmap.stretch_blt(rect, b, rect)
      @battleback_sprite.src_rect.set(0, 0, 640, 480)
    end
    # Update battler sprites
    for sprite in @enemy_sprites + @actor_sprites
      sprite.update
    end
    # Update weather graphic
    @weather.type = $game_screen.weather_type
    @weather.max = $game_screen.weather_max
    @weather.update
    # Update picture sprites
    for sprite in @picture_sprites
      sprite.update
    end
    # Update timer sprite
    @timer_sprite.update
    # Set screen color tone and shake position
    @viewport1.tone = $game_screen.tone
    @viewport1.ox = $game_screen.shake
    # Set screen flash color
    @viewport4.color = $game_screen.flash_color
    # Update viewports
    @viewport1.update
    @viewport2.update
    @viewport4.update
  end
end

The huge window at the bottom with all character details is "Window_BattleStatus". Mess with that if you want to change it.
Title: Re: Anyone got a battle system that...?
Post by: Merlandese on October 15, 2011, 05:51:37 PM
Oh noes, Rax is getting back into game making!

I've liked all the project ideas I've seen of yours, man. Especially the one about the guy in cryo-sleep. I hope you finish 'em up.

And why not make your own custom battle?
Title: Re: Anyone got a battle system that...?
Post by: Raxus on October 15, 2011, 05:58:40 PM
You would need to expand the battleback viewport and stretch battlebacks to fit the whole screen and then you can start messing with the rest of the layout. If you replace "Spriteset_Battle" with this quick change, it should make all battlebacks fill the screen completely.

Code: [Select]
#==============================================================================
# ** Spriteset_Battle
#------------------------------------------------------------------------------
#  This class brings together battle screen sprites. It's used within
#  the Scene_Battle class.
#==============================================================================

class Spriteset_Battle
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader   :viewport1                # enemy viewport
  attr_reader   :viewport2                # actor viewport
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    # Make viewports
    @viewport1 = Viewport.new(0, 0, 640, 480)
    @viewport2 = Viewport.new(0, 0, 640, 480)
    @viewport3 = Viewport.new(0, 0, 640, 480)
    @viewport4 = Viewport.new(0, 0, 640, 480)
    @viewport2.z = 101
    @viewport3.z = 200
    @viewport4.z = 5000
    # Make battleback sprite
    @battleback_sprite = Sprite.new(@viewport1)
    # Make enemy sprites
    @enemy_sprites = []
    for enemy in $game_troop.enemies.reverse
      @enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
    end
    # Make actor sprites
    @actor_sprites = []
    @actor_sprites.push(Sprite_Battler.new(@viewport2))
    @actor_sprites.push(Sprite_Battler.new(@viewport2))
    @actor_sprites.push(Sprite_Battler.new(@viewport2))
    @actor_sprites.push(Sprite_Battler.new(@viewport2))
    # Make weather
    @weather = RPG::Weather.new(@viewport1)
    # Make picture sprites
    @picture_sprites = []
    for i in 51..100
      @picture_sprites.push(Sprite_Picture.new(@viewport3,
        $game_screen.pictures[i]))
    end
    # Make timer sprite
    @timer_sprite = Sprite_Timer.new
    # Frame update
    update
  end
  #--------------------------------------------------------------------------
  # * Dispose
  #--------------------------------------------------------------------------
  def dispose
    # If battleback bit map exists, dispose of it
    if @battleback_sprite.bitmap != nil
      @battleback_sprite.bitmap.dispose
    end
    # Dispose of battleback sprite
    @battleback_sprite.dispose
    # Dispose of enemy sprites and actor sprites
    for sprite in @enemy_sprites + @actor_sprites
      sprite.dispose
    end
    # Dispose of weather
    @weather.dispose
    # Dispose of picture sprites
    for sprite in @picture_sprites
      sprite.dispose
    end
    # Dispose of timer sprite
    @timer_sprite.dispose
    # Dispose of viewports
    @viewport1.dispose
    @viewport2.dispose
    @viewport3.dispose
    @viewport4.dispose
  end
  #--------------------------------------------------------------------------
  # * Determine if Effects are Displayed
  #--------------------------------------------------------------------------
  def effect?
    # Return true if even 1 effect is being displayed
    for sprite in @enemy_sprites + @actor_sprites
      return true if sprite.effect?
    end
    return false
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update actor sprite contents (corresponds with actor switching)
    @actor_sprites[0].battler = $game_party.actors[0]
    @actor_sprites[1].battler = $game_party.actors[1]
    @actor_sprites[2].battler = $game_party.actors[2]
    @actor_sprites[3].battler = $game_party.actors[3]
    # If battleback file name is different from current one
    if @battleback_name != $game_temp.battleback_name
      @battleback_name = $game_temp.battleback_name
      if @battleback_sprite.bitmap != nil
        @battleback_sprite.bitmap.dispose
      end
      @battleback_sprite.bitmap = Bitmap.new
      b = RPG::Cache.battleback(@battleback_name)
      rect = Rect.new(0, 0, 640, 480)
      @battleback_sprite.bitmap.stretch_blt(rect, b, rect)
      @battleback_sprite.src_rect.set(0, 0, 640, 480)
    end
    # Update battler sprites
    for sprite in @enemy_sprites + @actor_sprites
      sprite.update
    end
    # Update weather graphic
    @weather.type = $game_screen.weather_type
    @weather.max = $game_screen.weather_max
    @weather.update
    # Update picture sprites
    for sprite in @picture_sprites
      sprite.update
    end
    # Update timer sprite
    @timer_sprite.update
    # Set screen color tone and shake position
    @viewport1.tone = $game_screen.tone
    @viewport1.ox = $game_screen.shake
    # Set screen flash color
    @viewport4.color = $game_screen.flash_color
    # Update viewports
    @viewport1.update
    @viewport2.update
    @viewport4.update
  end
end

The huge window at the bottom with all character details is "Window_BattleStatus". Mess with that if you want to change it.

I have no clue what went wrong, but it just shuts down the window when the game starts! D':

I plan on taking a screenshot of a map I make and then using that as the Battle Background... Does that change anything about stretching it out?

Oh noes, Rax is getting back into game making!

I've liked all the project ideas I've seen of yours, man. Especially the one about the guy in cryo-sleep. I hope you finish 'em up.

And why not make your own custom battle?

Heh, thanks. This one's an old one, so I have an idea of what's going on. I'm still int eh beginning stages, but I might just throw a topic out there if you're really interested.

I don't know ANYTHING about scripts other than copy and pasting so I can't figure out a SINGLE THING about making my own battle system. I wish I did know how.
Title: Re: Anyone got a battle system that...?
Post by: Merlandese on October 15, 2011, 06:09:33 PM
I'm still int eh beginning stages, but I might just throw a topic out there if you're really interested.

I would love to see a thread when you feel comfortable posting it, but only if you plan on finishing it.  :stare: All these projects that don't get finished tease me to distress.  D:
Title: Re: Anyone got a battle system that...?
Post by: Sarkilas on October 15, 2011, 06:15:20 PM
It works fine for me. There's no unsafe code used and I don't see why it would crash, and it didn't when I used it. Are you using any other additional scripts? I don't see how it would change anything, but you never know. Also just to clarify, make sure you replace the script I added completely with the original one. Don't leave anything from the default one to remain, and don't touch anything else, just "Spriteset_Battle".

And no, using map screenshots for that won't change anything. Basically what it does is that it makes whatever image you use for your battle backgrounds to fit exactly 640x480. So if its larger or smaller, it will be contracted or stretched to fit those exact portions.
Title: Re: Anyone got a battle system that...?
Post by: Raxus on October 15, 2011, 06:20:30 PM
It works fine for me. There's no unsafe code used and I don't see why it would crash, and it didn't when I used it. Are you using any other additional scripts? I don't see how it would change anything, but you never know. Also just to clarify, make sure you replace the script I added completely with the original one. Don't leave anything from the default one to remain, and don't touch anything else, just "Spriteset_Battle".

And no, using map screenshots for that won't change anything. Basically what it does is that it makes whatever image you use for your battle backgrounds to fit exactly 640x480. So if its larger or smaller, it will be contracted or stretched to fit those exact portions.

It's claiming that  "@battleback_sprite.bitmap = Bitmap.new" on Line 105 is a problem. I'm using a couple of other scripts, not that really deal with battles though. I am using: "Ccoa's Advanced Weather", "Ccoa's UMS", "Near Fantastica's Anti Lag System", "fukuyama's Caterpillar System", and "SephirothSpawn's Screenshot Maker".

Oh, and I did replace the whole thing.

I'm still int eh beginning stages, but I might just throw a topic out there if you're really interested.

I would love to see a thread when you feel comfortable posting it, but only if you plan on finishing it.  :stare: All these projects that don't get finished tease me to distress.  D:

I do plan on finishing it. In fact, this one has the most promise of being finished because of my newly LEVELED UP organization skills.
Title: Re: Anyone got a battle system that...?
Post by: Sarkilas on October 15, 2011, 06:29:22 PM
It's because I am a noob. The game with this CBS in it used the SDK which overwrote the additional that I gave you.
I fixed it, though, worked like a charm in a fresh project. Here it is:
Code: [Select]
#==============================================================================
# ** Spriteset_Battle
#------------------------------------------------------------------------------
#  This class brings together battle screen sprites. It's used within
#  the Scene_Battle class.
#==============================================================================

class Spriteset_Battle
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader   :viewport1                # enemy viewport
  attr_reader   :viewport2                # actor viewport
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    # Make viewports
    @viewport1 = Viewport.new(0, 0, 640, 480)
    @viewport2 = Viewport.new(0, 0, 640, 480)
    @viewport3 = Viewport.new(0, 0, 640, 480)
    @viewport4 = Viewport.new(0, 0, 640, 480)
    @viewport2.z = 101
    @viewport3.z = 200
    @viewport4.z = 5000
    # Make battleback sprite
    @battleback_sprite = Sprite.new(@viewport1)
    # Make enemy sprites
    @enemy_sprites = []
    for enemy in $game_troop.enemies.reverse
      @enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
    end
    # Make actor sprites
    @actor_sprites = []
    @actor_sprites.push(Sprite_Battler.new(@viewport2))
    @actor_sprites.push(Sprite_Battler.new(@viewport2))
    @actor_sprites.push(Sprite_Battler.new(@viewport2))
    @actor_sprites.push(Sprite_Battler.new(@viewport2))
    # Make weather
    @weather = RPG::Weather.new(@viewport1)
    # Make picture sprites
    @picture_sprites = []
    for i in 51..100
      @picture_sprites.push(Sprite_Picture.new(@viewport3,
        $game_screen.pictures[i]))
    end
    # Make timer sprite
    @timer_sprite = Sprite_Timer.new
    # Frame update
    update
  end
  #--------------------------------------------------------------------------
  # * Dispose
  #--------------------------------------------------------------------------
  def dispose
    # If battleback bit map exists, dispose of it
    if @battleback_sprite.bitmap != nil
      @battleback_sprite.bitmap.dispose
    end
    # Dispose of battleback sprite
    @battleback_sprite.dispose
    # Dispose of enemy sprites and actor sprites
    for sprite in @enemy_sprites + @actor_sprites
      sprite.dispose
    end
    # Dispose of weather
    @weather.dispose
    # Dispose of picture sprites
    for sprite in @picture_sprites
      sprite.dispose
    end
    # Dispose of timer sprite
    @timer_sprite.dispose
    # Dispose of viewports
    @viewport1.dispose
    @viewport2.dispose
    @viewport3.dispose
    @viewport4.dispose
  end
  #--------------------------------------------------------------------------
  # * Determine if Effects are Displayed
  #--------------------------------------------------------------------------
  def effect?
    # Return true if even 1 effect is being displayed
    for sprite in @enemy_sprites + @actor_sprites
      return true if sprite.effect?
    end
    return false
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update actor sprite contents (corresponds with actor switching)
    @actor_sprites[0].battler = $game_party.actors[0]
    @actor_sprites[1].battler = $game_party.actors[1]
    @actor_sprites[2].battler = $game_party.actors[2]
    @actor_sprites[3].battler = $game_party.actors[3]
    # If battleback file name is different from current one
    if @battleback_name != $game_temp.battleback_name
      @battleback_name = $game_temp.battleback_name
      if @battleback_sprite.bitmap != nil
        @battleback_sprite.bitmap.dispose
      end
      @battleback_sprite.bitmap = Bitmap.new(640,480)
      b = RPG::Cache.battleback(@battleback_name)
      rect = Rect.new(0, 0, 640, 480)
      rect2 = Rect.new(0, 0, b.width, b.height)
      @battleback_sprite.bitmap.stretch_blt(rect, b, rect2)
    end
    # Update battler sprites
    for sprite in @enemy_sprites + @actor_sprites
      sprite.update
    end
    # Update weather graphic
    @weather.type = $game_screen.weather_type
    @weather.max = $game_screen.weather_max
    @weather.update
    # Update picture sprites
    for sprite in @picture_sprites
      sprite.update
    end
    # Update timer sprite
    @timer_sprite.update
    # Set screen color tone and shake position
    @viewport1.tone = $game_screen.tone
    @viewport1.ox = $game_screen.shake
    # Set screen flash color
    @viewport4.color = $game_screen.flash_color
    # Update viewports
    @viewport1.update
    @viewport2.update
    @viewport4.update
  end
end
Title: Re: Anyone got a battle system that...?
Post by: Raxus on October 15, 2011, 07:05:59 PM
YAY! It worked!

Now to just pull the window down!

Thanks so much! <3
Title: Re: Anyone got a battle system that...?
Post by: Raxus on October 15, 2011, 08:51:01 PM
http://freebirdgames.com/forum/index.php?topic=886.msg139764#msg139764 (http://freebirdgames.com/forum/index.php?topic=886.msg139764#msg139764)

All due to you, Sarkilas!
Title: Re: Anyone got a battle system that...?
Post by: Sarkilas on October 16, 2011, 07:56:34 AM
Sweet. Looks fairly neat! But it looks fairly weird that the soldiers are so incredibly far apart when they are supposedly meant to be a "team"? :P But it works very well with map screenshots; I like it a lot more than the default, even though the system is the same, just visually different.
Title: Re: Anyone got a battle system that...?
Post by: Raxus on October 16, 2011, 05:25:36 PM
I'll be sure to put them closer together for the actual game. XD My mistake. But thanks for everything! Problem ended; let's lock 'er down, people...

[\Lockdown Initiate...

                                     ...Commenced.>/]