赞 | 76 |
VIP | 0 |
好人卡 | 0 |
积分 | 144 |
经验 | 0 |
最后登录 | 2025-3-31 |
在线时间 | 2127 小时 |
Lv4.逐梦者
- 梦石
- 0
- 星屑
- 14392
- 在线时间
- 2127 小时
- 注册时间
- 2016-9-20
- 帖子
- 857
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 ppspssss 于 2025-3-10 22:42 编辑
由于此贴为之前电脑有的草稿存档,被我找到出来,但注释的是没有存档,因而没注释 (原贴发贴日期2024.8.8)
Rpgmakerxp内建动画 bug? 触发此bug时播放动画1个就会卡至PPT掉帧至个位数,按sailcat说的可能vx va也是存在此问题,但我只试过xp
好像使用内建脚本的话才会卡,如不使用也不卡就不用改 (触发卡的原因不知道)
修改不知会造成什么影响这个方法仅测试用 : 方法 修改1 为2 或其他比如3
原内建脚本可在F1里找,这脚本是修改了一些参数不是原版
@SailCat 贴子 [讨论] RGSS1(2、3也同样)中一个并不会触发的奇怪bug 发表于 2021-3-22
https://rpg.blue/thread-485074-1-1.html
module RPG #40*2 = 80,X距離, 25*2 = 50,Y距離 #左上格X,Y轴 为120,225 ,X轴平移80,Y轴50 class Sprite < ::Sprite def loop_animation(animation,ggreen,zzzz,mirr=0,oopacity=nil) #if ggreen.is_a? == true @ggreen = ggreen #无效? @ggreen = 200 if @ggreen == nil @oopacity = 255 if @oopacity == nil #else #end @zzzz = zzzz #无效?->更正,要不与取相同名字,否则会覆盖 @mirr = mirr return if animation == @_loop_animation dispose_loop_animation @_loop_animation = animation return if @_loop_animation == nil @_loop_animation_index = 0 animation_name = @_loop_animation.animation_name animation_hue = @_loop_animation.animation_hue bitmap = RPG::Cache.animation(animation_name, animation_hue) if @@_reference_count.include?(bitmap) @@_reference_count[bitmap] += 1 else @@_reference_count[bitmap] = 2#b 原来是1 修改不知会造成什么影响这个方法仅测试用 *************************** end @_loop_animation_sprites = [] for i in 0..15 sprite = ::Sprite.new(self.viewport) sprite.bitmap = bitmap sprite.visible = false @_loop_animation_sprites.push(sprite) end update_loop_animation end 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 = self.viewport.rect.height - 160 else sprite.x = $Screen_X_2 sprite.y = $Screen_Y_2 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 x_是否负 = 0 if @mirr == 0 mirr = false x_是否负 = 1 elsif @mirr == 1 x_是否负 = -1 mirr = true end #p i,cell_data[i] #错误,cell_data p 出来是一个指针 #p cell_data sprite.x += (cell_data[i, 1] * x_是否负) sprite.y += cell_data[i, 2] @zzzz = 1002 if @zzzz == nil#普通动画没有zzz sprite.z = @zzzz #运用自设Z轴,第三位 sprite.ox = 96 sprite.oy = 96 #sprite.tone=Tone.new(0,@ggreen,@ggreen) #运用自设色调,第二位 #sprite.tone=Tone.new(0,$无敌_2,$无敌_2) #9/28 #p @ggreen#is_a if @ggreen != 200 and @ggreen !=nil and @ggreen !=[] #b暂时无时也是 sprite.tone=Tone.new(@ggreen[0],@ggreen[1],@ggreen[2],@ggreen[3]) end #end #if # $anime = 11 #b动画 #sprite.zoom_x = cell_data[i, 3] / 100.0 sprite.zoom_x = cell_data[i, 3]*2 / 100.0 sprite.zoom_y = cell_data[i, 3]*2 / 100.0 #sprite.zoom_y = cell_data[i, 3] / 100.0 sprite.angle = cell_data[i, 4] #cell_data[i, 5] = 1 sprite.mirror = mirr#(cell_data[i, 5] == 1) #true为反向 sprite.opacity = cell_data[i, 6] * self.opacity / 255.0 sprite.blend_type = 0#cell_data[i, 7] end end def get_animationfps #获取最大动画之值 return @_loop_animation.frames.size end end #class end #moudle
module RPG #40*2 = 80,X距離, 25*2 = 50,Y距離 #左上格X,Y轴 为120,225 ,X轴平移80,Y轴50
class Sprite < ::Sprite
def loop_animation(animation,ggreen,zzzz,mirr=0,oopacity=nil)
#if ggreen.is_a? == true
@ggreen = ggreen #无效?
@ggreen = 200 if @ggreen == nil
@oopacity = 255 if @oopacity == nil
#else
#end
@zzzz = zzzz #无效?->更正,要不与取相同名字,否则会覆盖
@mirr = mirr
return if animation == @_loop_animation
dispose_loop_animation
@_loop_animation = animation
return if @_loop_animation == nil
@_loop_animation_index = 0
animation_name = @_loop_animation.animation_name
animation_hue = @_loop_animation.animation_hue
bitmap = RPG::Cache.animation(animation_name, animation_hue)
if @@_reference_count.include?(bitmap)
@@_reference_count[bitmap] += 1
else
@@_reference_count[bitmap] = 2#b 原来是1 修改不知会造成什么影响这个方法仅测试用 ***************************
end
@_loop_animation_sprites = []
for i in 0..15
sprite = ::Sprite.new(self.viewport)
sprite.bitmap = bitmap
sprite.visible = false
@_loop_animation_sprites.push(sprite)
end
update_loop_animation
end
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 = self.viewport.rect.height - 160
else
sprite.x = $Screen_X_2
sprite.y = $Screen_Y_2
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
x_是否负 = 0
if @mirr == 0
mirr = false
x_是否负 = 1
elsif @mirr == 1
x_是否负 = -1
mirr = true
end
#p i,cell_data[i] #错误,cell_data p 出来是一个指针
#p cell_data
sprite.x += (cell_data[i, 1] * x_是否负)
sprite.y += cell_data[i, 2]
@zzzz = 1002 if @zzzz == nil#普通动画没有zzz
sprite.z = @zzzz #运用自设Z轴,第三位
sprite.ox = 96
sprite.oy = 96
#sprite.tone=Tone.new(0,@ggreen,@ggreen) #运用自设色调,第二位
#sprite.tone=Tone.new(0,$无敌_2,$无敌_2)
#9/28
#p @ggreen#is_a
if @ggreen != 200 and @ggreen !=nil and @ggreen !=[] #b暂时无时也是
sprite.tone=Tone.new(@ggreen[0],@ggreen[1],@ggreen[2],@ggreen[3])
end
#end #if
# $anime = 11 #b动画
#sprite.zoom_x = cell_data[i, 3] / 100.0
sprite.zoom_x = cell_data[i, 3]*2 / 100.0
sprite.zoom_y = cell_data[i, 3]*2 / 100.0
#sprite.zoom_y = cell_data[i, 3] / 100.0
sprite.angle = cell_data[i, 4]
#cell_data[i, 5] = 1
sprite.mirror = mirr#(cell_data[i, 5] == 1) #true为反向
sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
sprite.blend_type = 0#cell_data[i, 7]
end
end
def get_animationfps #获取最大动画之值
return @_loop_animation.frames.size
end
end #class
end #moudle
|
|