赞 | 1 |
VIP | 255 |
好人卡 | 52 |
积分 | 1 |
经验 | 77416 |
最后登录 | 2016-1-18 |
在线时间 | 1269 小时 |
Lv1.梦旅人 薄凉看客
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 1269 小时
- 注册时间
- 2010-6-20
- 帖子
- 1316
|
本帖最后由 恋′挂机 于 2014-2-12 22:37 编辑
不可能冲突吧?
75行报错!new_x == nil 这不太可能吧。。
发现此脚本的一个小BUG 如果没有角色 会因为 actor 是nil 不具有 sp 而报错
但如果是因为没有角色,那么报错不应该在75行而应该在34行
也就是有角色
但 new_x 没有赋值 无法理解!
还有另一种可能
就是自己修改过
比如把之前的new_x 改成 x_new 那么 赋值 的是 x_new 而不是 new_x 所以报错!
但我觉得这种可能性几乎不存在!
总之 我依然认为脚本应该是没有问题的,也不是因为冲突
能上传个工程么?
另外 我不是高手
认真说的话其实我也算新手。。。毕竟13年9月才开始尝试改窗口的。。。
被你工程吓到了。。。
调了好长好长时间坐标 总不对
最后终于发现!!!!!!!!!!!!!!!!!我也太。。。
你的i大了1
都是 for i in 0...$game_party.actors.size
你是 for i in 1..$game_party.actors.size
坐标大概调好了。。。 表示抱歉!- #==============================================================================
- # ■ Window_BattleStatus
- #------------------------------------------------------------------------------
- # 显示战斗画面同伴状态的窗口。
- #==============================================================================
- #有问题,找蚂蚁 redant修改
- class Window_BattleStatus < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, 640, 480)
- self.contents = Bitmap.new(width - 32, height - 32)
- @level_up_flags = [false, false, false, false]
- #........................................................................
- self.opacity = 0
- @sta_back = []
- @sta_output = []
- # @cp_output = []
- # @hp_bitmap = RPG::Cache.picture("../system/battle/hmcp/hp_bar.png")
- #@mp_bitmap = RPG::Cache.picture("../system/battle/hmcp/mp_bar.png")
- # @bitmap3 = RPG::Cache.picture("../system/battle/hmcp/底.png")
- # @cp_bitmap = RPG::Cache.picture("../system/battle/hmcp/cp_bar.png")
- # @cp_output = []
- # @cp_back_bar = Sprite.new
- #@cp_back_bar.bitmap = Bitmap.new("Graphics/system/battle/hmcp/cp_back_bar")
- ## @cp_back_bar.x = 450
- # @cp_back_bar.y = 25
- #@cp_back_bar.z = self.z + 1
- # @actor_cp_sprite = []
- # @actor_cp_sprite_back = []
- # @xy_window.visible = true
- @xy_window = Window_xy.new
- @xy_window.x = -16
- @xy_window.y = -16
- @xy_window.opacity = 0
- for actor_index in 0...$game_party.actors.size
- # @cp_output[actor_index] = Sprite.new
- # @cp_output[actor_index].bitmap = Bitmap.new(133, 78)
- # @cp_output[actor_index].x = 100 + (actor_index - 1) * 133
- # @cp_output[actor_index].y = 480 - 78 - 10
- # @cp_output[actor_index].z = self.z + 2
- # @cp_output[actor_index].bitmap.clear
-
- ###########角色底图
- @sta_back[actor_index] = Sprite.new
- @sta_back[actor_index].bitmap = Bitmap.new("Graphics/System/Battle/sta_back/" + $game_party.actors[actor_index].name + "战斗.png")
- @sta_back[actor_index].x = 4 + actor_index % 2 * 382
- @sta_back[actor_index].y = (actor_index / 2) * 100 + 260
- @sta_back[actor_index].z = self.z + 1
-
-
- ##############
- @sta_output[actor_index] = Sprite.new
- @sta_output[actor_index].bitmap = Bitmap.new(133, 78)
- @sta_output[actor_index].x = 4 + actor_index % 2 * 382 + 80
- @sta_output[actor_index].y = (actor_index / 2) * 100 + 280
- @sta_output[actor_index].z = self.z + 2
- @sta_output[actor_index].bitmap.clear
- @sta_output[actor_index].bitmap.font.size = 11
- @sta_output[actor_index].bitmap.font.name = "黑体"
-
- # hp_width = $game_party.actors[actor_index - 1].hp * @hp_bitmap.width/$game_party.actors[actor_index - 1].maxhp
- # hp_rect = Rect.new(0, 0, hp_width, 5)
- # mp_width = $game_party.actors[actor_index - 1].sp * @mp_bitmap.width/$game_party.actors[actor_index - 1].maxsp
- # mp_rect = Rect.new(0, 0, mp_width, 5)
-
- # @src_rect3 = Rect.new(0,0,@bitmap3.width, @bitmap3.height)
- # self.contents.blt(10,220, @bitmap3, @src_rect3)
-
- # @sta_output[actor_index].bitmap.blt(66, 44, @hp_bitmap, hp_rect)
- # @sta_output[actor_index].bitmap.blt(66, 64, @mp_bitmap, mp_rect)
- # @sta_output[actor_index].bitmap.blt(66, 54, @bitmap3, @src_rect3)
-
- @sta_output[actor_index].bitmap.font.color.set(255, 0, 0)
- @sta_output[actor_index].bitmap.draw_text(80, 31, 77, 11,$game_party.actors[actor_index - 1].hp.to_s + "/" + $game_party.actors[actor_index - 1].maxhp.to_s)
- @sta_output[actor_index].bitmap.font.color.set(0, 0, 255)
- @sta_output[actor_index].bitmap.draw_text(80, 51, 77, 11,$game_party.actors[actor_index - 1].sp.to_s + "/" + $game_party.actors[actor_index - 1].maxsp.to_s)
- end
- #........................................................................
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 释放
- #--------------------------------------------------------------------------
- def dispose
- super
- @xy_window.dispose
- # @hp_bitmap.bitmap.dispose
- #@hp_bitmap.dispose
- # @mp_bitmap.bitmap.dispose
- # @mp_bitmap.dispose
- #@cp_bitmap.bitmap.dispose
- # @cp_bitmap.dispose
- for actor_index in 1..$game_party.actors.size
- @sta_back[actor_index].bitmap.dispose
- @sta_back[actor_index].dispose
- @sta_output[actor_index].bitmap.dispose
- @sta_output[actor_index].dispose
- # @cp_output[actor_index].bitmap.dispose
- # @cp_output[actor_index].dispose
- end
- end
- #--------------------------------------------------------------------------
- # ● 设置升级标志
- # actor_index : 角色索引
- #--------------------------------------------------------------------------
- def level_up(actor_index)
- @level_up_flags[actor_index] = true
- end
- #......................................................................
- #--------------------------------------------------------------------------
- # ● 设置正在攻击标志
- # actor_index : 角色索引
- #--------------------------------------------------------------------------
- def in_atk(actor_index)
- @sta_back[actor_index + 1].bitmap = Bitmap.new("Graphics/System/Battle/sta_back/" + $game_party.actors[actor_index].name + "战斗1.png")
- end
- #--------------------------------------------------------------------------
- # ● 设置不在攻击标志
- # actor_index : 角色索引
- #--------------------------------------------------------------------------
- def out_atk(actor_index)
- @sta_back[actor_index + 1].bitmap = Bitmap.new("Graphics/System/Battle/sta_back/" + $game_party.actors[actor_index].name + "战斗.png")
- end
- #......................................................................
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- @item_max = $game_party.actors.size
- for i in 0...$game_party.actors.size
- actor = $game_party.actors[i]
- #......................................................................
- actor_x = i * 160 + 145
- actor_y = i * 80 + 220
- @sta_output[i].bitmap.clear
- # hp_width = $game_party.actors[i].hp * @hp_bitmap.width/$game_party.actors[i].maxhp
- # hp_rect = Rect.new(0, 0, hp_width, 5)
- # mp_width = $game_party.actors[i].sp * @mp_bitmap.width/$game_party.actors[i].maxsp
- # mp_rect = Rect.new(0, 0, mp_width, 5)
- # @sta_output[i + 1].bitmap.blt(66, 44, @hp_bitmap, hp_rect)
- # @sta_output[i + 1].bitmap.blt(66, 64, @mp_bitmap, mp_rect)
- @sta_output[i].bitmap.font.color.set(255, 0, 0)
- @sta_output[i].bitmap.draw_text(80, 31, 77, 11,$game_party.actors[i].hp.to_s + "/" + $game_party.actors[i].maxhp.to_s)
- @sta_output[i].bitmap.font.color.set(0, 0, 255)
- @sta_output[i].bitmap.draw_text(80, 51, 77, 11,$game_party.actors[i].sp.to_s + "/" + $game_party.actors[i].maxsp.to_s)
- #......................................................................
- if @level_up_flags[i]
- self.contents.font.color = Color.new(255,5,5)
- self.contents.font.size = 16
- self.contents.draw_text(100, actor_y - 220, 640 , 480, "等级提升!")
- $data_system_level_up_me = "Audio/ME/dengji"
- Audio.me_play($data_system_level_up_me)
- else
- draw_actor_state(actor, 120, actor_y)
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- super
- # 主界面的不透明度下降
- if $game_temp.battle_main_phase
- self.contents_opacity = 255 #if self.contents_opacity > 1
- else
- self.contents_opacity = 255 #if self.contents_opacity < 255
- end
- end
- end
- #图片血槽显示Ver 1.0(清爽版)
- # by逐月
- #描画HP槽
- def HP (actor,x,y)
- @bitmap3 = Bitmap.new("Graphics/Pictures/底")
- @src_rect3 = Rect.new(0,0,@bitmap3.width, @bitmap3.height)
- self.contents.blt(x,y, @bitmap3, @src_rect3)
- #HP显示
- @bitmap3 = Bitmap.new("Graphics/Pictures/hp")
- w3 = @bitmap3.width * actor.hp/actor.maxhp
- @src_rect3 = Rect.new(0,0,w3, @bitmap3.height)
- self.contents.blt(x+4,y+2, @bitmap3, @src_rect3)
- end
- #描画SP槽
- def SP (actor,x,y)
- @bitmap1 = Bitmap.new("Graphics/Pictures/底")
- @src_rect1 = Rect.new(0,0,@bitmap1.width, @bitmap1.height)
- self.contents.blt(x,y, @bitmap1, @src_rect1)
- #SP显示
- @bitmap1 = Bitmap.new("Graphics/Pictures/sp")
- w1 = @bitmap1.width * actor.sp/actor.maxsp
- @src_rect1 = Rect.new(0,0,w1, @bitmap1.height)
- self.contents.blt(x+4,y+2, @bitmap1, @src_rect1)
- end
- #==============================================================================
- # ■ Window_BattleStatus
- #==============================================================================
- class Window_BattleStatus < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化
- #--------------------------------------------------------------------------
- alias xrxs_bp3_refresh refresh
- def refresh
- xrxs_bp3_refresh
- @item_max = $game_party.actors.size
- for i in 0...$game_party.actors.size
- actor = $game_party.actors[i]
- bitmap = Bitmap.new("Graphics/system/menu/back/" + actor.name + "_name.png")
- src_rect = Rect.new(0, 0, 120, 66)
- x = 4 + i % 2 * 382 + 140
- y = (i / 2) * 100 + 300
- case i
- when 0
-
- #draw_actor_name(actor, 400 - 40,420-5)
-
- self.contents.blt(345, 405 , bitmap, src_rect)
-
- when 1
- #x = 150
- #y = 489
- # draw_actor_name(actor, 470 - 40,350-15 )
- self.contents.blt(420, 330 , bitmap, src_rect)
- when 2
- # x = 345
- # y = 339
- # draw_actor_name(actor, 540 - 30,280-20)
- self.contents.blt(500, 255 , bitmap, src_rect)
- when 3
- # x = 345
- # y = 419
- #draw_actor_name(actor, 610 - 40 ,210 )
- self.contents.blt(560, 190 , bitmap, src_rect)
- end
- ###########################一切自改##############################
- HP(actor, x-10, y)
- SP(actor, x-10, y + 18)
- # draw_actor_name(actor, x ,y )
-
- #######################################一切自改###############
- end
- end
- end
复制代码 瞬移那个 和 停止时动画确实有点问题
稍后重新写个给你好了 |
|