查看: 2219|回复: 1

[已经过期] 用后知后觉横版1.7的血条定制脚本为什么刷新处出错了

[复制链接]
梦石
0
星屑
750
在线时间
228 小时
注册时间
2009-2-19
回帖
171
发表于 2016-9-17 14:35:41 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
先上图 1.png
进入战斗就是这样!
这是出错的位置

2.png
最后附上脚本
  1. #==============================================================================#02.# ※ 后知后觉横版战斗模板 增强补丁03.#------------------------------------------------------------------------------#04.#  添加了战斗时角色脚下的血槽05.#  此脚本为定制脚本06.#                                                                      影月千秋07.#                                                                   2014.01.27 #08.#==============================================================================#09. 10. 11.#==============================================================================12.# ■ Hzhj::HorizontalBattleSystem13.#------------------------------------------------------------------------------14.#  只在这里进行编辑15.#==============================================================================16.module Hzhj::HorizontalBattleSystem17. 18.  MoGB_LOC_X = "index * 30 + 300"19.  MoGB_LOC_Y = "index * 45 + 20"20.  # 值槽位置计算公式21. 22.  # ·关于图片23.  # 放在Graphics\System下24.  # ·图片名25.  # Mo_Hzhj_HBS_GB_B.png  背景26.  # Mo_Hzhj_HBS_GB_F.png  槽图27. 28.  # 值槽左上角与图片左上角位置差29.  # 分别为横纵坐标之差30.  MoGB_ADD_X = 131.  MoGB_ADD_Y = 432.end33.#==============================================================================34.# ■ SpriteSet_MoGagueBar_ForHzhjHBS35.#==============================================================================36.class SpriteSet_Mo_GB_HzhjHBS37.  include Hzhj::HorizontalBattleSystem38.  #--------------------------------------------------------------------------39.  # ● 初始化40.  #--------------------------------------------------------------------------41.  def initialize(viewport, battler)42.    [url=home.php?mod=space&uid=133701]@battler[/url] = battler43.    return if @battler.nil? || !@battler.actor?44.    @back = Sprite_Base.new(viewport)45.    @back.bitmap = Cache.system("Mo_Hzhj_HBS_GB_B") rescue nil46.    @back.x = eval("battler.#{MoGB_LOC_X}")47.    @back.y = eval("battler.#{MoGB_LOC_Y}")48.    @back.z = battler.screen_z + 5 - battler.index49.    @fore = Sprite_Base.new(viewport)50.    @fore.bitmap = Cache.system("Mo_Hzhj_HBS_GB_F") rescue nil51.    @fore.x = @back.x + MoGB_ADD_X52.    @fore.y = @back.y + MoGB_ADD_Y53.    @fore.z = @back.z + 154.    @rate = @battler.hp_rate55.    refresh56.  end57.  #--------------------------------------------------------------------------58.  # ● 刷新59.  #--------------------------------------------------------------------------60.  def update61.    refresh if @rate != @battler.hp_rate62.  end63.  #--------------------------------------------------------------------------64.  # ● 描绘65.  #--------------------------------------------------------------------------66.  def refresh67.    @rate = @battler.hp_rate68.    @fore.zoom_x = @rate69.  end70.  #--------------------------------------------------------------------------71.  # ● 释放72.  #--------------------------------------------------------------------------73.  def dispose74.    @fore.bitmap.dispose if @back.bitmap75.    @fore.dispose76.    @back.bitmap.dispose if @back.bitmap77.    @back.dispose78.  end79.end80.#==============================================================================81.# ■ Spriteset_Battle82.#==============================================================================83.class Spriteset_Battle84.  #--------------------------------------------------------------------------85.  # ● 生成角色活动块86.  #--------------------------------------------------------------------------87.  alias :mo_gb_hzhjHBS_create_actors :create_actors88.  def create_actors89.    mo_gb_hzhjHBS_create_actors    90.    create_mo_hzhjHBS_gb91.  end92.  #--------------------------------------------------------------------------93.  # ● 释放角色活动块94.  #--------------------------------------------------------------------------95.  def create_mo_hzhjHBS_gb96.    @mo_actor_gague_bar = Array.new(4){|i|97.      SpriteSet_Mo_GB_HzhjHBS.new(@viewport1, $game_party.battle_members[i])98.    }99.  end100.  #--------------------------------------------------------------------------101.  # ● 释放角色活动块102.  #--------------------------------------------------------------------------103.  alias :mo_gb_hzhjHBS_dispose_actors :dispose_actors104.  def dispose_actors105.    mo_gb_hzhjHBS_dispose_actors    106.    dispose_mo_hzhjHBS_gb107.  end108.  #--------------------------------------------------------------------------109.  # ● 释放值槽活动块110.  #--------------------------------------------------------------------------111.  def dispose_mo_hzhjHBS_gb112.    @mo_actor_gague_bar.each{|gb| gb.dispose}113.  end114.  #--------------------------------------------------------------------------115.  # ● 更新值槽活动块116.  #--------------------------------------------------------------------------117.  def update_mo_hzhjHBS_gb118.    @mo_actor_gague_bar.each{|gb| gb.update}119.  end120.end121.#==============================================================================122.# ■ Window_BattleStatus123.#==============================================================================124.class Window_BattleStatus125.  #--------------------------------------------------------------------------126.  # ● 刷新127.  #--------------------------------------------------------------------------128.  alias :mo_gb_hzhjHBS_refresh :refresh129.  def refresh130.    mo_gb_hzhjHBS_refresh131.    SceneManager.scene.instance_variable_get("@spriteset").update_mo_hzhjHBS_gb132.  end133.end#==============================================================================#
  2. # ※ 后知后觉横版战斗模板 增强补丁
  3. #------------------------------------------------------------------------------#
  4. #  添加了战斗时角色脚下的血槽
  5. #  此脚本为定制脚本
  6. #                                                                      影月千秋
  7. #                                                                   2014.01.27 #
  8. #==============================================================================#


  9. #==============================================================================
  10. # ■ Hzhj::HorizontalBattleSystem
  11. #------------------------------------------------------------------------------
  12. #  只在这里进行编辑
  13. #==============================================================================
  14. module Hzhj::HorizontalBattleSystem

  15.   MoGB_LOC_X = "index * 30 + 300"
  16.   MoGB_LOC_Y = "index * 45 + 20"
  17.   # 值槽位置计算公式

  18.   # ·关于图片
  19.   # 放在Graphics\System下
  20.   # ·图片名
  21.   # Mo_Hzhj_HBS_GB_B.png  背景
  22.   # Mo_Hzhj_HBS_GB_F.png  槽图

  23.   # 值槽左上角与图片左上角位置差
  24.   # 分别为横纵坐标之差
  25.   MoGB_ADD_X = 1
  26.   MoGB_ADD_Y = 4
  27. end
  28. #==============================================================================
  29. # ■ SpriteSet_MoGagueBar_ForHzhjHBS
  30. #==============================================================================
  31. class SpriteSet_Mo_GB_HzhjHBS
  32.   include Hzhj::HorizontalBattleSystem
  33.   #--------------------------------------------------------------------------
  34.   # ● 初始化
  35.   #--------------------------------------------------------------------------
  36.   def initialize(viewport, battler)
  37.     #[url=home.php?mod=space&uid=133701]@battler[/url] = battler
  38.     return if @battler.nil? || !@battler.actor?
  39.     @back = Sprite_Base.new(viewport)
  40.     @back.bitmap = Cache.system("Mo_Hzhj_HBS_GB_B") rescue nil
  41.     @back.x = eval("battler.#{MoGB_LOC_X}")
  42.     @back.y = eval("battler.#{MoGB_LOC_Y}")
  43.     @back.z = battler.screen_z + 5 - battler.index
  44.     @fore = Sprite_Base.new(viewport)
  45.     @fore.bitmap = Cache.system("Mo_Hzhj_HBS_GB_F") rescue nil
  46.     @fore.x = @back.x + MoGB_ADD_X
  47.     @fore.y = @back.y + MoGB_ADD_Y
  48.     @fore.z = @back.z + 1
  49.     @rate = @battler.hp_rate
  50.     refresh
  51.   end
  52.   #--------------------------------------------------------------------------
  53.   # ● 刷新
  54.   #--------------------------------------------------------------------------
  55.   def update
  56.     refresh if @rate != @battler.hp_rate
  57.   end
  58.   #--------------------------------------------------------------------------
  59.   # ● 描绘
  60.   #--------------------------------------------------------------------------
  61.   def refresh
  62.     @rate = @battler.hp_rate
  63.     @fore.zoom_x = @rate
  64.   end
  65.   #--------------------------------------------------------------------------
  66.   # ● 释放
  67.   #--------------------------------------------------------------------------
  68.   def dispose
  69.     @fore.bitmap.dispose if @back.bitmap
  70.     @fore.dispose
  71.     @back.bitmap.dispose if @back.bitmap
  72.     @back.dispose
  73.   end
  74. end
  75. #==============================================================================
  76. # ■ Spriteset_Battle
  77. #==============================================================================
  78. class Spriteset_Battle
  79.   #--------------------------------------------------------------------------
  80.   # ● 生成角色活动块
  81.   #--------------------------------------------------------------------------
  82.   alias :mo_gb_hzhjHBS_create_actors :create_actors
  83.   def create_actors
  84.     mo_gb_hzhjHBS_create_actors   
  85.     create_mo_hzhjHBS_gb
  86.   end
  87.   #--------------------------------------------------------------------------
  88.   # ● 释放角色活动块
  89.   #--------------------------------------------------------------------------
  90.   def create_mo_hzhjHBS_gb
  91.     @mo_actor_gague_bar = Array.new(4){|i|
  92.       SpriteSet_Mo_GB_HzhjHBS.new(@viewport1, $game_party.battle_members[i])
  93.     }
  94.   end
  95.   #--------------------------------------------------------------------------
  96.   # ● 释放角色活动块
  97.   #--------------------------------------------------------------------------
  98.   alias :mo_gb_hzhjHBS_dispose_actors :dispose_actors
  99.   def dispose_actors
  100.     mo_gb_hzhjHBS_dispose_actors   
  101.     dispose_mo_hzhjHBS_gb
  102.   end
  103.   #--------------------------------------------------------------------------
  104.   # ● 释放值槽活动块
  105.   #--------------------------------------------------------------------------
  106.   def dispose_mo_hzhjHBS_gb
  107.     @mo_actor_gague_bar.each{|gb| gb.dispose}
  108.   end
  109.   #--------------------------------------------------------------------------
  110.   # ● 更新值槽活动块
  111.   #--------------------------------------------------------------------------
  112.   def update_mo_hzhjHBS_gb
  113.     @mo_actor_gague_bar.each{|gb| gb.update}
  114.   end
  115. end
  116. #==============================================================================
  117. # ■ Window_BattleStatus
  118. #==============================================================================
  119. class Window_BattleStatus
  120.   #--------------------------------------------------------------------------
  121.   # ● 刷新
  122.   #--------------------------------------------------------------------------
  123.   alias :mo_gb_hzhjHBS_refresh :refresh
  124.   def refresh
  125.     mo_gb_hzhjHBS_refresh
  126.     SceneManager.scene.instance_variable_get("@spriteset").update_mo_hzhjHBS_gb
  127.   end
  128. end




复制代码
[img][/img]
梦石
0
星屑
750
在线时间
228 小时
注册时间
2009-2-19
回帖
171
 楼主| 发表于 2016-9-18 14:17:32 | 显示全部楼层
自顶一下
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部