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.

Enemy HP/SP and Name

Status
Not open for further replies.
The monsters picture is too big, maybe theres extra space at the bottom of the picture you can remove it shouldnt be that far down.

But yes, this happens with all the largest enemies even in RTP resources of RMXP, you just have to move the enemy up, and try to cut the bottom as much as possible.

Or, find the coordinates it draws the stats in the script, and move it around.
 

Anonymous

Guest

how about toggling it on and off so if its a boss monster you should toggle it off or make it a ????HP so it would be exciting to defeat how much the monster's hp left
 
Italianstal1ion;131077 said:
The monsters picture is too big, maybe theres extra space at the bottom of the picture you can remove it shouldnt be that far down.
its the same with small monsters =/

Ravenix;131253 said:
how about toggling it on and off so if its a boss monster you should toggle it off or make it a ????HP so it would be exciting to defeat how much the monster's hp left
uhhh...isnt it usually the opposite?

ahhh...i found wats wrong...its not compatible with this script im using(its made by XRXS, not me)
Code:
# ▼▲▼ XRXS_BP 8. バトルバック・Full-View+可動カメラ ver.2 ▼▲▼
# by 桜雅 在土

#==============================================================================
# □ カスタマイズポイント
#==============================================================================
module XRXS_BP8
  #
  # カメラ移動スピード基準値 (基本的に小さいほうが速い)
  #
  SPEED = 8
  #
  # グラフィックスアレイ式サイズ設定
  #
  GA = Rect.new(-192, -144, 1024, 768)  # XGA サイズ
  #GA = Rect.new(   0, -  0,  640, 480) # VGA サイズ
end
#------------------------------------------------------------------------------
#
#
#
#    ▽ 可動カメラ システム ▽
#
#
#
#==============================================================================
# â–¡ XCam
#------------------------------------------------------------------------------
#   可動カメラを扱うクラスです。
#==============================================================================
class XCam
  #--------------------------------------------------------------------------
  # ○ 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_reader   :x
  attr_reader   :y
  attr_reader   :z
  attr_accessor :x_destination
  attr_accessor :y_destination
  attr_accessor :z_destination
  attr_accessor :watch_battler
  attr_accessor :wait_count
  #--------------------------------------------------------------------------
  # ○ オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize
    # カメラ初期位置決定
    @x = 320
    @y = 240
    @z = 295
    # カメラ:センタリング
    self.centering
    # 初期化
    @wait_count = 0
  end
  #--------------------------------------------------------------------------
  # ○ フレーム更新
  #--------------------------------------------------------------------------
  def update
    @moved = false
    # カメラ位置の更新
    if @wait_count > 0
      # ウェイトカウントを減らす
      @wait_count -= 1
    else
      # スピードの取得
      speed = XRXS_BP8::SPEED
      #
      # カメラ: Z 座標 (優先)
      #
      z_dest = @z_destination
      if @z != z_dest
        if @z < z_dest
          distance = [(z_dest - @z)/speed, 1].max
        else
          distance = [(z_dest - @z)/speed, -1].min
        end
        @z = [[@z + distance, 74].max, 296].min
        @moved = true
      end
      #
      # カメラ: X 座標
      #
      x_dest = @watch_battler == nil ? @x_destination : @watch_battler.x
      if @x != x_dest
        if (@x - x_dest).abs < speed
          distance = x_dest - @x
        elsif @x < x_dest
          distance = [(x_dest - @x)/speed, 8].max
        else
          distance = [(x_dest - @x)/speed, -8].min
        end
        maximum = 192 * (296 - @z) / 111 + 320
        minimum = 640 - maximum
        @x = [[@x + distance, minimum].max, maximum].min
        @moved = true
      end
      #
      # カメラ: Y 座標
      #
      y_dest = @watch_battler == nil ? @y_destination : 88 + @watch_battler.y/2
      if @y != y_dest
        if (@y - y_dest).abs < speed
          distance = y_dest - @y
        elsif @y < y_dest
          distance = [(y_dest - @y)/speed, 4].max
        else
          distance = [(y_dest - @y)/speed, -4].min
        end
        maximum = 164 * (296 - @z) / 111 + 240
        minimum = 480 - maximum
        @y = [[@y + distance, minimum].max, maximum].min
        @moved = true
      end
    end
  end
  #--------------------------------------------------------------------------
  # ○ 動いたかどうか?
  #--------------------------------------------------------------------------
  def moved?
    return @moved
  end
  #--------------------------------------------------------------------------
  # ○ センタリング
  #--------------------------------------------------------------------------
  def centering
    @watch_battler = nil
    @x_destination = 320
    @y_destination = 240
    @z_destination = 185
  end
  #--------------------------------------------------------------------------
  # ○ 注目
  #--------------------------------------------------------------------------
  def watch(battler)
    @watch_battler = battler
    @z_destination = 176
  end
  #--------------------------------------------------------------------------
  # ○ ズームアウト
  #--------------------------------------------------------------------------
  def zoomout
    @z_destination = 222
  end
  #--------------------------------------------------------------------------
  # ○ 指定 X 位置を注目
  #--------------------------------------------------------------------------
  def watch_at(x)
    @watch_battler = nil
    @x_destination =   x
    @y_destination = 240
    @z_destination = 185
  end
end
#==============================================================================
# â–  Game_Battler
#==============================================================================
class Game_Battler
  #--------------------------------------------------------------------------
  # ○ 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_reader   :x                        # バトルフィールド 横 位置(+が右 )
  attr_reader   :y                        # バトルフィールド 高さ 位置(+が下 )
  attr_reader   :z                        # バトルフィールド奥行き位置(+が手前)
  attr_accessor :zoom                     # 現在のズーム倍率
  #--------------------------------------------------------------------------
  # ○ バトルフィールド上に居るか?
  #--------------------------------------------------------------------------
  def in_battlefield?
    return false
  end
end
#==============================================================================
# â–  Game_Enemy
#==============================================================================
class Game_Enemy < Game_Battler
  #--------------------------------------------------------------------------
  # ○ バトルフィールド上に居るか? [オーバーライド]
  #--------------------------------------------------------------------------
  def in_battlefield?
    return true
  end
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  alias xrxs_bp8_initialize initialize
  def initialize(troop_id, member_index)
    @x    = $data_troops[troop_id].members[member_index].x
    @y    = $data_troops[troop_id].members[member_index].y
    @z    = 0
    @zoom = 1.00
    # 呼び戻す
    xrxs_bp8_initialize(troop_id, member_index)
  end
  #--------------------------------------------------------------------------
  # ● バトル画面 X 座標の取得
  #--------------------------------------------------------------------------
  alias xrxs_bp8_screen_x screen_x
  def screen_x
    return xrxs_bp8_screen_x if $xcam == nil
    return 320 + (xrxs_bp8_screen_x - $xcam.x) * self.zoom
  end
  #--------------------------------------------------------------------------
  # ● バトル画面 Y 座標の取得
  #--------------------------------------------------------------------------
  alias xrxs_bp8_screen_y screen_y
  def screen_y
    return xrxs_bp8_screen_y if $xcam == nil
    return 240 + (xrxs_bp8_screen_y - $xcam.y) * self.zoom
  end
end
#==============================================================================
# â–  Spriteset_Battle
#==============================================================================
class Spriteset_Battle
  #--------------------------------------------------------------------------
  # ○ フレーム更新 (可動カメラ)
  #--------------------------------------------------------------------------
  def update_xcam
    # カメラ位置が動いた場合
    if $xcam.moved?
      # カメラ位置からズーム率を計算
      zoom = 1.00 * 185 / $xcam.z
      # 背景の設定更新
      @battleback_sprite.zoom_x = zoom
      @battleback_sprite.zoom_y = zoom
      @battleback_sprite.x      = -($xcam.x - 320) * zoom - 512 * (zoom - 1)
      @battleback_sprite.y      = -($xcam.y - 240) * zoom - 384 * (zoom - 1)
    end
  end
end
#==============================================================================
# --- バトラースプライト可動カメラズーム対応 モジュール ---
#==============================================================================
module XRXS_Cam_Deal
  def update
    # 呼び戻す
    super
    # バトラーが nil の場合は終了
    return if @battler == nil
    # バトルフィールドにいない場合も終了
    return unless @battler.in_battlefield?
    # カメラが存在しない場合も終了
    return if $xcam == nil
    # 例外補正
    @battler.z = 0 if @battler.z == nil
    # ズーム率
    zoom = 1.00 * (185 - @battler.z) / ($xcam.z - @battler.z)
    self.zoom_x   = zoom
    self.zoom_y   = zoom
    @battler.zoom = zoom
    # ズーム率の変更に伴いスプライトの座標を再設定
    self.x = @battler.screen_x
    self.y = @battler.screen_y
    self.z = @battler.screen_z
  end
end
class Sprite_Battler < RPG::Sprite
  include XRXS_Cam_Deal
end
#==============================================================================
# --- ダメージフォロー モジュール ---
#==============================================================================
module XRXS_DamageFollow
  def update
    # 呼び戻す
    super
    # カメラが存在しない場合
    return if $xcam == nil
    # バトラーが nil またはバトルフィールドにいない場合
    return if @battler == nil or not @battler.in_battlefield?
    # 直前カメラ位置から、移動量を算出
    x_moved = @last_cam_x == nil ? 0 : $xcam.x - @last_cam_x
    y_moved = @last_cam_y == nil ? 0 : $xcam.y - @last_cam_y
    # ダメージスプライト配列の作成
    damage_sprites  = [@_damage_sprite]
    damage_sprites += @damage_sprites if @damage_sprites != nil
    # カメラをフォロー
    for sprite in damage_sprites
      next if sprite == nil
      next if sprite.disposed?
      sprite.x -= x_moved
      sprite.y -= y_moved
    end
    # 直前カメラ位置の保持
    @last_cam_x = $xcam.x
    @last_cam_y = $xcam.y
  end
end
class Sprite_Battler < RPG::Sprite
  include XRXS_DamageFollow
end
#==============================================================================
# â–  Scene_Battle
#==============================================================================
class Scene_Battle
  #--------------------------------------------------------------------------
  # ● メイン処理
  #--------------------------------------------------------------------------
  alias xrxs_bp8_main main
  def main
    # 可動カメラの生成
    $xcam = XCam.new
    # 戻す
    xrxs_bp8_main
    # 可動カメラの解放
    $xcam = nil
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  alias xrxs_bp8_update update
  def update
    # 可動カメラのフレーム更新
    $xcam.update
    # 呼び戻す
    xrxs_bp8_update
  end
end
#------------------------------------------------------------------------------
# ▽ 可動カメラの動き設定
#==============================================================================
# â–  Scene_Battle
#==============================================================================
class Scene_Battle
  #--------------------------------------------------------------------------
  # ● パーティコマンドフェーズ開始
  #--------------------------------------------------------------------------
  alias xrxs_bp8_start_phase2 start_phase2
  def start_phase2
    # カメラ:センタリング
    $xcam.centering
    # 呼び戻す
    xrxs_bp8_start_phase2
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (アクターコマンドフェーズ : エネミー選択)
  #--------------------------------------------------------------------------
  alias xrxs_bp8_update_phase3_enemy_select update_phase3_enemy_select
  def update_phase3_enemy_select
    # 現在選択中のエネミーを取得
    enemy = $game_troop.enemies[@enemy_arrow.index]
    # カメラ:注目
    $xcam.watch_at(enemy.x)
    # 戻す
    xrxs_bp8_update_phase3_enemy_select
  end
  #--------------------------------------------------------------------------
  # ● エネミー選択終了
  #--------------------------------------------------------------------------
  alias xrxs_bp8_end_enemy_select end_enemy_select
  def end_enemy_select
    # カメラ:センタリング
    $xcam.centering
    # 呼び戻す
    xrxs_bp8_end_enemy_select
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
  #--------------------------------------------------------------------------
  alias xrxs_bp8_update_phase4_step2 update_phase4_step2
  def update_phase4_step2
    # 戻す
    xrxs_bp8_update_phase4_step2
    # ステップ 3 に移行する予定の場合
    if @phase4_step == 3
      # アクティブなバトラーがバトルフィールドに居る場合
      if @active_battler.in_battlefield?
        # カメラ:注目
        $xcam.watch(@active_battler)
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (メインフェーズ ステップ 3 : 行動側アニメーション)
  #--------------------------------------------------------------------------
  alias xrxs_bp8_update_phase4_step3 update_phase4_step3
  def update_phase4_step3
    # 戻す
    xrxs_bp8_update_phase4_step3
    # カメラターゲットとなりうるターゲットの X 平均値を計算
    x_average  = 0
    number     = 0
    cam_target = nil
    for target in @target_battlers
      if target.in_battlefield?
        x_average += target.x
        number    += 1
        cam_target = target
      end
    end
    # カメラターゲットが見つかった場合
    if number > 0
      # もし対象アニメが「位置:画面」の場合
      animation = $data_animations[@animation2_id]
      if animation != nil and animation.position == 3
        # カメラ:センタリング
        $xcam.centering
        # カメラ:ズームアウト
        $xcam.zoomout
      elsif number == 1
        # カメラ:注目
        $xcam.watch(cam_target)
      else
        # カメラ:指定 X 位置を注目
        $xcam.watch_at(x_average / number)
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● アフターバトルフェーズ開始
  #--------------------------------------------------------------------------
  alias xrxs_bp8_start_phase5 start_phase5
  def start_phase5
    # カメラ:センタリング
    $xcam.centering
    # 呼び戻す
    xrxs_bp8_start_phase5
  end
end






#------------------------------------------------------------------------------
#
#
#
#    ▽ Full-View システム ▽
#
#
#
#==============================================================================
# â–  Spriteset_Battle
#==============================================================================
class Spriteset_Battle
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  alias xrxs_bp8_initialize initialize
  def initialize
    # 呼び戻す
    xrxs_bp8_initialize
    # グラフィックスアレイを取得
    ga = XRXS_BP8::GA
    # ビューポート 0 を作成
    @viewport0 = Viewport.new(ga.x, ga.y, ga.width, ga.height)
    @viewport0.z  = 0
    # ビューポート 1 の設定を変更
    @viewport1.z += 1
    @viewport1.rect.height = 480
    # バトルバックスプライトを再作成 (ビューポート 0 を使用)
    @battleback_sprite.dispose
    @battleback_sprite = Sprite.new(@viewport0)
    @battleback_name = ""
    # バトルバックのフレーム更新
    update_battleback
  end
  #--------------------------------------------------------------------------
  # ● 解放
  #--------------------------------------------------------------------------
  alias xrxs_bp8_dispose dispose
  def dispose
    # 呼び戻す
    xrxs_bp8_dispose
    # ビューポートを解放
    @viewport0.dispose
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  alias xrxs_bp8_update update
  def update
    # フレーム更新 (バトルバック)
    update_battleback
    # フレーム更新 (可動カメラ)
    update_xcam if defined? update_xcam
    # 呼び戻す
    xrxs_bp8_update
  end
  #--------------------------------------------------------------------------
  # ○ フレーム更新 (バトルバック)
  #--------------------------------------------------------------------------
  def update_battleback
    # バトルバックのファイル名が現在のものと違う場合
    if @battleback_name != $game_temp.battleback_name
      @battleback_name = $game_temp.battleback_name
      if @battleback_sprite.bitmap != nil
        @battleback_sprite.bitmap.dispose
      end
      # グラフィックスアレイを取得
      ga = XRXS_BP8::GA
      # バトルバックの取得と拡大
      bg   = RPG::Cache.battleback(@battleback_name)
      xga  = Bitmap.new(ga.width, ga.height)
      xga.stretch_blt(xga.rect, bg, bg.rect)
      # XGAをバトルバックに設定
      @battleback_sprite.bitmap = xga
    end
  end
end
#==============================================================================
# ◇ RPG::Sprite「戦闘中の"画面"アニメの位置修正」 [再定義]
#==============================================================================
module RPG
  class Sprite < ::Sprite
    def animation_set_sprites(sprites, cell_data, position)
      for i in 0..15
        sprite = sprites[i]
        pattern = cell_data[i, 0]
        if sprite == nil or pattern == nil or pattern == -1
          sprite.visible = false if sprite != nil
          next
        end
        sprite.visible = true
        sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
        if position == 3
          if self.viewport != nil
            sprite.x = self.viewport.rect.width / 2
            sprite.y = 160 # この一行だけ変更
          else
            sprite.x = 320
            sprite.y = 240
          end
        else
          sprite.x  = self.x - self.ox + self.src_rect.width / 2
          sprite.y  = self.y - self.oy + self.src_rect.height / 2
          sprite.y -= self.src_rect.height / 4 if position == 0
          sprite.y += self.src_rect.height / 4 if position == 2
        end
        sprite.x += cell_data[i, 1]
        sprite.y += cell_data[i, 2]
        sprite.z = 2000
        sprite.ox = 96
        sprite.oy = 96
        sprite.zoom_x = cell_data[i, 3] / 100.0
        sprite.zoom_y = cell_data[i, 3] / 100.0
        sprite.angle = cell_data[i, 4]
        sprite.mirror = (cell_data[i, 5] == 1)
        sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
        sprite.blend_type = cell_data[i, 7]
      end
    end
  end
end

can any of u pro scripters make it so it works? it would make my game so much better...
 
I'm using this script, and I get an error when I try to heal. I changed the 'hp's to 'sp's, and now it says 'cannot convert fixnum into string'. The error still occurs on line 327, but I can't figure out what's wrong.

Oops, just realized that I must have accidentally altered the script a little after copying it into the script editor. My bad XD
 
is it possible to just have the hp bar shown, because i really dont care about the enemies sp ( or have it so you can turn it on or off through an option)

Also can you make this compatible with Tricksters Bars script? the bars dont show up with this script in my project
 
hi there, um i have a problem with this script. i actually dont know where to put it and how to name it (i mean i know i have to put it in script editor but where exactly) and it dont appear to be working, at all.
and if you gonna ask then no, i didnt use any other scripts. plese help :3
 
Well yeah, because this was originally posted 3 years ago. I could post the bars script I'm using if you need it, but I would love to know if anyone could figure out a way to do the toggling.
 
Guys, don't necropost. The OP hasn't been here for nearly a year. If you need support or want to request an add-on, create a new topic in the appropriate subforum.
 
Status
Not open for further replies.

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