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

Project1

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

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

[复制链接]

Lv5.捕梦者

梦石
0
星屑
35138
在线时间
4164 小时
注册时间
2007-12-15
帖子
10061
跳转到指定楼层
1
发表于 2017-9-21 19:30:52 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
在地图上建立事件,并行处理动画显示,用了突破显示的脚本后想很方便的做地图效果
https://rpg.blue/forum.php?mod=viewthread&tid=399194
因此拼合的动画文件较大640*480全屏60帧大小12.2M
在地图进行并行处理循环播放动画的时候总会卡一下,可能是图像载入造成的,请问有什么方法可以解决吗?

Lv1.梦旅人

梦石
0
星屑
50
在线时间
68 小时
注册时间
2011-11-12
帖子
92
2
发表于 2017-9-22 12:49:20 | 只看该作者
试一下这个脚本?


RUBY 代码复制
  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. #===============================================================================
  14. # ■ Game_Temp
  15. #===============================================================================
  16. class Game_Temp
  17.   attr_accessor :animation_garbage
  18.  
  19.   #--------------------------------------------------------------------------
  20.   # ● Initialize
  21.   #--------------------------------------------------------------------------  
  22.   alias mog_anti_lag_animation_initialize initialize
  23.   def initialize
  24.       @animation_garbage = []
  25.       mog_anti_lag_animation_initialize
  26.   end  
  27.  
  28. end
  29.  
  30. #===============================================================================
  31. # ■ SceneManager
  32. #===============================================================================
  33. class << SceneManager
  34.  
  35.   #--------------------------------------------------------------------------
  36.   # ● Call
  37.   #--------------------------------------------------------------------------  
  38.   alias mog_anti_lag_animation_call call
  39.   def call(scene_class)
  40.       mog_anti_lag_animation_call(scene_class)
  41.       dispose_animation_garbage
  42.   end  
  43.  
  44.   #--------------------------------------------------------------------------
  45.   # ● Goto
  46.   #--------------------------------------------------------------------------   
  47.   alias mog_anti_lag_animation_goto goto
  48.   def goto(scene_class)
  49.       mog_anti_lag_animation_goto(scene_class)
  50.       dispose_animation_garbage
  51.   end
  52.  
  53.   #--------------------------------------------------------------------------
  54.   # ● Dispose Animation Garbage
  55.   #--------------------------------------------------------------------------  
  56.   def dispose_animation_garbage
  57.       return if $game_temp.animation_garbage == nil
  58.       $game_temp.animation_garbage.each do |sprite| sprite.dispose end
  59.       $game_temp.animation_garbage = nil
  60.   end  
  61.  
  62. end
  63.  
  64. #==============================================================================
  65. # ■ Game Map
  66. #==============================================================================
  67. class Game_Map
  68.  
  69.   #--------------------------------------------------------------------------
  70.   # ● Setup
  71.   #--------------------------------------------------------------------------   
  72.   alias mog_anti_lag_animation_setup setup
  73.   def setup(map_id)
  74.       SceneManager.dispose_animation_garbage
  75.       mog_anti_lag_animation_setup(map_id)
  76.   end
  77.  
  78. end
  79.  
  80. #==============================================================================
  81. # ■ Scene Base
  82. #==============================================================================
  83. class Scene_Base
  84.  
  85.   #--------------------------------------------------------------------------
  86.   # ● Terminate
  87.   #--------------------------------------------------------------------------      
  88.   alias mog_anti_lag_animation_terminate terminate
  89.   def terminate
  90.       mog_anti_lag_animation_terminate
  91.       SceneManager.dispose_animation_garbage
  92.   end
  93.  
  94. end
  95.  
  96. #==============================================================================
  97. # ■ Sprite Base
  98. #==============================================================================
  99. class Sprite_Base < Sprite  
  100.  
  101.   #--------------------------------------------------------------------------
  102.   # ● Dispose Animation
  103.   #--------------------------------------------------------------------------
  104.   def dispose_animation
  105.       execute_animation_garbage  
  106.   end
  107.  
  108.   #--------------------------------------------------------------------------
  109.   # ● Execute Animation Garbage
  110.   #--------------------------------------------------------------------------  
  111.   def execute_animation_garbage  
  112.       $game_temp.animation_garbage = [] if $game_temp.animation_garbage == nil
  113.       if @ani_bitmap1
  114.          @@_reference_count[@ani_bitmap1] -= 1
  115.          $game_temp.animation_garbage.push(@ani_bitmap1) if @@_reference_count[@ani_bitmap1] == 0
  116.       end
  117.       if @ani_bitmap2
  118.          @@_reference_count[@ani_bitmap2] -= 1
  119.          $game_temp.animation_garbage.push(@ani_bitmap2) if @@_reference_count[@ani_bitmap2] == 0
  120.      end
  121.      if @ani_sprites
  122.         @ani_sprites.each {|sprite| sprite.dispose }
  123.         @ani_sprites = nil ; @animation = nil
  124.      end
  125.      @ani_bitmap1 = nil ; @ani_bitmap2 = nil
  126.   end   
  127.  
  128. end
已经在做游戏了~~~愉悦的做游戏体验
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
35138
在线时间
4164 小时
注册时间
2007-12-15
帖子
10061
3
 楼主| 发表于 2017-9-22 13:52:33 | 只看该作者
这个运行时33行 nameerroe uninitialized comstant scencemanager 请问需要调节脚本哪里?

点评

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

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-21 16:25

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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