查看: 2380|回复: 4

[已经过期] 地图并行处理动画循环会卡一下

[复制链接]
梦石
0
星屑
35258
在线时间
4171 小时
注册时间
2007-12-15
回帖
9490
发表于 2017-9-21 19:30:52 | 显示全部楼层 |阅读模式

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

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

×
在地图上建立事件,并行处理动画显示,用了突破显示的脚本后想很方便的做地图效果
https://rpg.blue/forum.php?mod=viewthread&tid=399194
因此拼合的动画文件较大640*480全屏60帧大小12.2M
在地图进行并行处理循环播放动画的时候总会卡一下,可能是图像载入造成的,请问有什么方法可以解决吗?
梦石
0
星屑
50
在线时间
68 小时
注册时间
2011-11-12
回帖
76
发表于 2017-9-22 12:49:20 | 显示全部楼层
试一下这个脚本?


  1. #==============================================================================
  2. # +++ MOG - Anti Animation Lag (v1.1) +++
  3. #==============================================================================
  4. # By Moghunter
  5. # [url]https://atelierrgss.wordpress.com/[/url]
  6. #==============================================================================
  7. # Este script remove as travadas (Lag) relacionadas ao dispose de uma animação.
  8. #==============================================================================
  9.   
  10. $imported = {} if $imported.nil?
  11. $imported[:mog_anti_animation_lag] = true

  12. #===============================================================================
  13. # ■ Game_Temp
  14. #===============================================================================
  15. class Game_Temp
  16.   attr_accessor :animation_garbage
  17.   
  18.   #--------------------------------------------------------------------------
  19.   # ● Initialize
  20.   #--------------------------------------------------------------------------  
  21.   alias mog_anti_lag_animation_initialize initialize
  22.   def initialize
  23.       @animation_garbage = []
  24.       mog_anti_lag_animation_initialize
  25.   end  
  26.   
  27. end

  28. #===============================================================================
  29. # ■ SceneManager
  30. #===============================================================================
  31. class << SceneManager
  32.   
  33.   #--------------------------------------------------------------------------
  34.   # ● Call
  35.   #--------------------------------------------------------------------------  
  36.   alias mog_anti_lag_animation_call call
  37.   def call(scene_class)
  38.       mog_anti_lag_animation_call(scene_class)
  39.       dispose_animation_garbage
  40.   end  
  41.   
  42.   #--------------------------------------------------------------------------
  43.   # ● Goto
  44.   #--------------------------------------------------------------------------   
  45.   alias mog_anti_lag_animation_goto goto
  46.   def goto(scene_class)
  47.       mog_anti_lag_animation_goto(scene_class)
  48.       dispose_animation_garbage
  49.   end
  50.   
  51.   #--------------------------------------------------------------------------
  52.   # ● Dispose Animation Garbage
  53.   #--------------------------------------------------------------------------  
  54.   def dispose_animation_garbage
  55.       return if $game_temp.animation_garbage == nil
  56.       $game_temp.animation_garbage.each do |sprite| sprite.dispose end
  57.       $game_temp.animation_garbage = nil
  58.   end  

  59. end

  60. #==============================================================================
  61. # ■ Game Map
  62. #==============================================================================
  63. class Game_Map
  64.   
  65.   #--------------------------------------------------------------------------
  66.   # ● Setup
  67.   #--------------------------------------------------------------------------   
  68.   alias mog_anti_lag_animation_setup setup
  69.   def setup(map_id)
  70.       SceneManager.dispose_animation_garbage
  71.       mog_anti_lag_animation_setup(map_id)
  72.   end

  73. end

  74. #==============================================================================
  75. # ■ Scene Base
  76. #==============================================================================
  77. class Scene_Base
  78.   
  79.   #--------------------------------------------------------------------------
  80.   # ● Terminate
  81.   #--------------------------------------------------------------------------      
  82.   alias mog_anti_lag_animation_terminate terminate
  83.   def terminate
  84.       mog_anti_lag_animation_terminate
  85.       SceneManager.dispose_animation_garbage
  86.   end
  87.   
  88. end

  89. #==============================================================================
  90. # ■ Sprite Base
  91. #==============================================================================
  92. class Sprite_Base < Sprite  

  93.   #--------------------------------------------------------------------------
  94.   # ● Dispose Animation
  95.   #--------------------------------------------------------------------------
  96.   def dispose_animation
  97.       execute_animation_garbage  
  98.   end
  99.    
  100.   #--------------------------------------------------------------------------
  101.   # ● Execute Animation Garbage
  102.   #--------------------------------------------------------------------------  
  103.   def execute_animation_garbage  
  104.       $game_temp.animation_garbage = [] if $game_temp.animation_garbage == nil
  105.       if @ani_bitmap1
  106.          @@_reference_count[@ani_bitmap1] -= 1
  107.          $game_temp.animation_garbage.push(@ani_bitmap1) if @@_reference_count[@ani_bitmap1] == 0
  108.       end
  109.       if @ani_bitmap2
  110.          @@_reference_count[@ani_bitmap2] -= 1
  111.          $game_temp.animation_garbage.push(@ani_bitmap2) if @@_reference_count[@ani_bitmap2] == 0
  112.      end
  113.      if @ani_sprites
  114.         @ani_sprites.each {|sprite| sprite.dispose }
  115.         @ani_sprites = nil ; @animation = nil
  116.      end
  117.      @ani_bitmap1 = nil ; @ani_bitmap2 = nil
  118.   end   
  119.   
  120. end
复制代码
已经在做游戏了~~~愉悦的做游戏体验
回复

使用道具 举报

梦石
0
星屑
35258
在线时间
4171 小时
注册时间
2007-12-15
回帖
9490
 楼主| 发表于 2017-9-22 13:52:33 | 显示全部楼层
这个运行时33行 nameerroe uninitialized comstant scencemanager 请问需要调节脚本哪里?

点评

还请指望程序大大们有空帮我。  发表于 2017-9-23 06:25
楼上发的应该是个VA的脚本,XP不大改应该是用不了的……  发表于 2017-9-22 18:00
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部