设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 143|回复: 0
打印 上一主题 下一主题

[讨论] 疑似内建动画的掉帧BUG,改了个数字便不卡【补档]

[复制链接]

Lv4.逐梦者

梦石
0
星屑
14392
在线时间
2127 小时
注册时间
2016-9-20
帖子
857
跳转到指定楼层
1
发表于 2025-3-7 22:29:24 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

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
RUBY 代码复制
  1. module RPG #40*2 = 80,X距離, 25*2 = 50,Y距離  #左上格X,Y轴 为120,225 ,X轴平移80,Y轴50
  2.   class Sprite < ::Sprite
  3.  
  4. def loop_animation(animation,ggreen,zzzz,mirr=0,oopacity=nil)
  5.      #if ggreen.is_a? == true
  6.       @ggreen = ggreen #无效?
  7.       @ggreen = 200 if @ggreen == nil
  8.       @oopacity = 255 if @oopacity == nil
  9.       #else
  10.  
  11.       #end
  12.       @zzzz = zzzz #无效?->更正,要不与取相同名字,否则会覆盖
  13.       @mirr = mirr
  14.       return if animation == @_loop_animation
  15.       dispose_loop_animation
  16.       @_loop_animation = animation
  17.       return if @_loop_animation == nil
  18.       @_loop_animation_index = 0
  19.  
  20.       animation_name = @_loop_animation.animation_name
  21.       animation_hue = @_loop_animation.animation_hue
  22.       bitmap = RPG::Cache.animation(animation_name, animation_hue)
  23.       if @@_reference_count.include?(bitmap)
  24.         @@_reference_count[bitmap] += 1
  25.       else
  26.         @@_reference_count[bitmap] = 2#b 原来是1 修改不知会造成什么影响这个方法仅测试用 ***************************
  27.       end
  28.       @_loop_animation_sprites = []
  29.       for i in 0..15
  30.         sprite = ::Sprite.new(self.viewport)
  31.         sprite.bitmap = bitmap
  32.         sprite.visible = false
  33.         @_loop_animation_sprites.push(sprite)
  34.       end
  35.  
  36.       update_loop_animation
  37.  
  38.     end
  39.     def animation_set_sprites(sprites, cell_data, position)
  40.       for i in 0..15
  41.         sprite = sprites[i]
  42.         pattern = cell_data[i, 0]
  43.         if sprite == nil or pattern == nil or pattern == -1
  44.           sprite.visible = false if sprite != nil
  45.           next
  46.         end
  47.         sprite.visible = true
  48.         sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
  49.         if position == 3
  50.           if self.viewport != nil
  51.             sprite.x = self.viewport.rect.width / 2
  52.             sprite.y = self.viewport.rect.height - 160
  53.           else
  54.             sprite.x = $Screen_X_2
  55.             sprite.y = $Screen_Y_2
  56.           end
  57.         else
  58.           sprite.x = self.x - self.ox + self.src_rect.width / 2
  59.           sprite.y = self.y - self.oy + self.src_rect.height / 2
  60.           sprite.y -= self.src_rect.height / 4 if position == 0
  61.           sprite.y += self.src_rect.height / 4 if position == 2
  62.         end
  63.         x_是否负 = 0
  64.         if @mirr == 0
  65.        mirr = false
  66.        x_是否负 = 1
  67.      elsif @mirr == 1
  68.        x_是否负 = -1
  69.         mirr = true  
  70.       end
  71. #p i,cell_data[i] #错误,cell_data p 出来是一个指针
  72. #p cell_data
  73.  
  74.         sprite.x += (cell_data[i, 1] * x_是否负)
  75.         sprite.y += cell_data[i, 2]
  76.  
  77.         @zzzz = 1002 if @zzzz == nil#普通动画没有zzz
  78.         sprite.z = @zzzz #运用自设Z轴,第三位
  79.         sprite.ox = 96
  80.         sprite.oy = 96
  81.  
  82.         #sprite.tone=Tone.new(0,@ggreen,@ggreen)  #运用自设色调,第二位
  83.         #sprite.tone=Tone.new(0,$无敌_2,$无敌_2)
  84.         #9/28
  85.         #p @ggreen#is_a
  86.         if @ggreen != 200 and @ggreen !=nil and @ggreen !=[] #b暂时无时也是
  87.         sprite.tone=Tone.new(@ggreen[0],@ggreen[1],@ggreen[2],@ggreen[3])
  88.         end
  89.         #end #if
  90.  
  91. #        $anime = 11 #b动画
  92.         #sprite.zoom_x = cell_data[i, 3] / 100.0
  93.         sprite.zoom_x = cell_data[i, 3]*2 / 100.0
  94.         sprite.zoom_y = cell_data[i, 3]*2 / 100.0
  95.         #sprite.zoom_y = cell_data[i, 3] / 100.0
  96.         sprite.angle = cell_data[i, 4]
  97.         #cell_data[i, 5] = 1
  98.  
  99.         sprite.mirror = mirr#(cell_data[i, 5] == 1) #true为反向
  100.  
  101.         sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
  102.         sprite.blend_type = 0#cell_data[i, 7]
  103.       end
  104.     end
  105.     def get_animationfps #获取最大动画之值
  106.       return @_loop_animation.frames.size
  107.       end
  108.   end #class
  109.   end #moudle
我发的贴子大多未经整理是草稿抱歉
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2025-3-31 18:13

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表