查看: 2320|回复: 4

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

[复制链接]
梦石
0
星屑
35248
在线时间
4171 小时
注册时间
2007-12-15
回帖
9489
发表于 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 | 显示全部楼层
试一下这个脚本?


[pre lang="ruby"]#==============================================================================
# +++ MOG - Anti Animation Lag (v1.1) +++
#==============================================================================
# By Moghunter
# https://atelierrgss.wordpress.com/
#==============================================================================
# Este script remove as travadas (Lag) relacionadas ao dispose de uma animação.
#==============================================================================
  
$imported = {} if $imported.nil?
$imported[:mog_anti_animation_lag] = true

#===============================================================================
# ■ Game_Temp
#===============================================================================
class Game_Temp
  attr_accessor :animation_garbage
  
  #--------------------------------------------------------------------------
  # ● Initialize
  #--------------------------------------------------------------------------  
  alias mog_anti_lag_animation_initialize initialize
  def initialize
      @animation_garbage = []
      mog_anti_lag_animation_initialize
  end  
  
end

#===============================================================================
# ■ SceneManager
#===============================================================================
class << SceneManager
  
  #--------------------------------------------------------------------------
  # ● Call
  #--------------------------------------------------------------------------  
  alias mog_anti_lag_animation_call call
  def call(scene_class)
      mog_anti_lag_animation_call(scene_class)
      dispose_animation_garbage
  end  
  
  #--------------------------------------------------------------------------
  # ● Goto
  #--------------------------------------------------------------------------   
  alias mog_anti_lag_animation_goto goto
  def goto(scene_class)
      mog_anti_lag_animation_goto(scene_class)
      dispose_animation_garbage
  end
  
  #--------------------------------------------------------------------------
  # ● Dispose Animation Garbage
  #--------------------------------------------------------------------------  
  def dispose_animation_garbage
      return if $game_temp.animation_garbage == nil
      $game_temp.animation_garbage.each do |sprite| sprite.dispose end
      $game_temp.animation_garbage = nil
  end  

end

#==============================================================================
# ■ Game Map
#==============================================================================
class Game_Map
  
  #--------------------------------------------------------------------------
  # ● Setup
  #--------------------------------------------------------------------------   
  alias mog_anti_lag_animation_setup setup
  def setup(map_id)
      SceneManager.dispose_animation_garbage
      mog_anti_lag_animation_setup(map_id)
  end

end

#==============================================================================
# ■ Scene Base
#==============================================================================
class Scene_Base
  
  #--------------------------------------------------------------------------
  # ● Terminate
  #--------------------------------------------------------------------------      
  alias mog_anti_lag_animation_terminate terminate
  def terminate
      mog_anti_lag_animation_terminate
      SceneManager.dispose_animation_garbage
  end
  
end

#==============================================================================
# ■ Sprite Base
#==============================================================================
class Sprite_Base < Sprite  

  #--------------------------------------------------------------------------
  # ● Dispose Animation
  #--------------------------------------------------------------------------
  def dispose_animation
      execute_animation_garbage  
  end
   
  #--------------------------------------------------------------------------
  # ● Execute Animation Garbage
  #--------------------------------------------------------------------------  
  def execute_animation_garbage  
      $game_temp.animation_garbage = [] if $game_temp.animation_garbage == nil
      if @ani_bitmap1
         @@_reference_count[@ani_bitmap1] -= 1
         $game_temp.animation_garbage.push(@ani_bitmap1) if @@_reference_count[@ani_bitmap1] == 0
      end
      if @ani_bitmap2
         @@_reference_count[@ani_bitmap2] -= 1
         $game_temp.animation_garbage.push(@ani_bitmap2) if @@_reference_count[@ani_bitmap2] == 0
     end
     if @ani_sprites
        @ani_sprites.each {|sprite| sprite.dispose }
        @ani_sprites = nil ; @animation = nil
     end
     @ani_bitmap1 = nil ; @ani_bitmap2 = nil
  end   
  
end[/pre]
已经在做游戏了~~~愉悦的做游戏体验
回复

使用道具 举报

梦石
0
星屑
35248
在线时间
4171 小时
注册时间
2007-12-15
回帖
9489
 楼主| 发表于 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.

在本版发帖返回顶部