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

Project1

 找回密码
 注册会员
搜索
查看: 1500|回复: 3

[已经过期] 请懂脚本的大佬帮忙看下

[复制链接]

Lv1.梦旅人

梦石
0
星屑
239
在线时间
33 小时
注册时间
2018-11-9
帖子
12
发表于 2018-11-14 21:11:38 | 显示全部楼层 |阅读模式

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

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

x
我用的MOG_Wallpaper_EX 菜单画面,每次打开菜单栏,系统都会说209行发生错误。
  1. #==============================================================================
  2. # +++ MOG - Wallpaper EX (V1.1) +++
  3. #==============================================================================
  4. # By Moghunter
  5. # http://www.atelier-rgss.com
  6. #==============================================================================
  7. # - Adiciona um papel de parede e adiciona alguns efeitos animados.
  8. #==============================================================================
  9. # Para mudar de papel de parede no meio do jogo basta usar o código abaixo.
  10. #
  11. # $game_system.wallpaper = "FILE_NAME"
  12. #
  13. #==============================================================================
  14. # E para mudar de velocidade de scroll use o código abaixo.
  15. #
  16. # $game_system.wallpaper_scroll = [ SPEED_X, SPEED_Y]
  17. #
  18. #==============================================================================
  19. # Serão necessários os seguintes arquivos na pasta GRAPHICS/SYSTEM.
  20. #
  21. # Menu_Particles.png
  22. # wallpaper
  23. #
  24. #==============================================================================
  25. # ● Histórico (Version History)
  26. #==============================================================================
  27. # v 1.1 - Melhoria no sistema de dispose de imagens.
  28. #==============================================================================
  29. module MOG_WALLPAPER_EX
  30.   #Ativar Particulas animadas.
  31.   PARTICLES = true
  32.   #Numero de particulas.
  33.   NUMBER_OF_PARTICLES = 10
  34.   #Deslizar a imagem de fundo.
  35.   BACKGROUND_SCROLL_SPEED = [0,0]
  36.   #Definição da opacidade das janelas.
  37.   WINDOW_OPACITY = 32
  38. end

  39. #==============================================================================
  40. # ■ Game_System
  41. #==============================================================================
  42. class Game_System
  43.   
  44.   attr_accessor :wallpaper
  45.   attr_accessor :wallpaper_scroll
  46.   
  47. #--------------------------------------------------------------------------
  48. # ● Initialize
  49. #--------------------------------------------------------------------------  
  50.   alias mog_wallpaper_initialize initialize
  51.   def initialize
  52.       mog_wallpaper_initialize
  53.       @wallpaper = "Wallpaper"   
  54.       @wallpaper_scroll = MOG_WALLPAPER_EX::BACKGROUND_SCROLL_SPEED
  55.   end
  56.   
  57. end  

  58. #==============================================================================
  59. # ■ Menu Particles
  60. #==============================================================================
  61. class Menu_Particles < Sprite
  62.   
  63. #--------------------------------------------------------------------------
  64. # ● Initialize
  65. #--------------------------------------------------------------------------            
  66.   def initialize(viewport = nil)
  67.       super(viewport)
  68.       self.bitmap = Cache.system("Menu_Particles")
  69.       reset_setting(true)
  70.   end  
  71.   
  72. #--------------------------------------------------------------------------
  73. # ● Reset Setting
  74. #--------------------------------------------------------------------------               
  75.   def reset_setting(start)
  76.       zoom = (50 + rand(100)) / 100.1
  77.       self.zoom_x = zoom
  78.       self.zoom_y = zoom
  79.       self.x = rand(544)
  80.       if start
  81.          self.y = rand(416 + self.bitmap.height)
  82.       else
  83.          self.y = 416 + rand(32 + self.bitmap.height)
  84.       end        
  85.       self.opacity = 0
  86.       self.blend_type = 1
  87.       @speed_x = 0
  88.       @speed_y = [[rand(3), 3].min, 1].max
  89.       @speed_a = 0#rand(3)
  90.   end
  91.   
  92. #--------------------------------------------------------------------------
  93. # ● Dispose
  94. #--------------------------------------------------------------------------               
  95.   def dispose
  96.       super
  97.       self.bitmap.dispose
  98.   end  
  99.   
  100. #--------------------------------------------------------------------------
  101. # ● Update
  102. #--------------------------------------------------------------------------               
  103.   def update
  104.       super
  105.       self.x += @speed_x
  106.       self.y -= @speed_y
  107.       self.angle += @speed_a      
  108.       self.opacity += 5
  109.       reset_setting(false) if self.y < 0
  110.   end  
  111.   
  112. end


  113. #==============================================================================
  114. # ■ LAYOUT_EX
  115. #==============================================================================
  116. module WALLPAPER_EX
  117.   
  118.   include MOG_WALLPAPER_EX
  119.   
  120.   #--------------------------------------------------------------------------
  121.   # ● Start
  122.   #--------------------------------------------------------------------------         
  123.   def start
  124.       super
  125.       create_particles
  126.   end   
  127.   
  128.   #--------------------------------------------------------------------------
  129.   # ● Set Window OPACITY
  130.   #--------------------------------------------------------------------------            
  131.   def set_window_opacity   
  132.       instance_variables.each do |varname|
  133.           ivar = instance_variable_get(varname)
  134.            if ivar.is_a?(Window)
  135.               ivar.opacity = WINDOW_OPACITY  
  136.           end
  137.       end
  138.   end

  139.   #--------------------------------------------------------------------------
  140.   # ● Create Particles
  141.   #--------------------------------------------------------------------------  
  142.   def create_particles
  143.       return unless PARTICLES
  144.       dispose_menu_particles
  145.       @particle_viewport = Viewport.new(-32, -32, 576, 448)
  146.       @particle_bitmap =[]
  147.       for i in 0...NUMBER_OF_PARTICLES
  148.           @particle_bitmap.push(Menu_Particles.new(@particle_viewport))
  149.       end  
  150.   end  

  151.   #--------------------------------------------------------------------------
  152.   # ● Create Background
  153.   #--------------------------------------------------------------------------
  154.   def create_background
  155.       @background_sprite = Plane.new
  156.       @background_sprite.bitmap = Cache.system($game_system.wallpaper) rescue nil
  157.       @background_sprite.bitmap = SceneManager.background_bitmap if @background_sprite.bitmap == nil
  158.   end

  159. #--------------------------------------------------------------------------
  160. # ● Dispose Light
  161. #--------------------------------------------------------------------------              
  162.   def dispose_menu_particles
  163.       return unless PARTICLES
  164.       if @particle_bitmap != nil
  165.          @particle_bitmap.each {|sprite| sprite.dispose}
  166.          @particle_viewport.dispose
  167.          @particle_bitmap = nil
  168.       end      
  169.   end     
  170.   
  171.   #--------------------------------------------------------------------------
  172.   # ● Dispose Background
  173.   #--------------------------------------------------------------------------
  174.   def dispose_background
  175.       return if @background_sprite == nil
  176.       @background_sprite.bitmap.dispose
  177.       @background_sprite.dispose
  178.       @background_sprite = nil
  179.   end
  180.   
  181.   #--------------------------------------------------------------------------
  182.   # ● Terminate
  183.   #--------------------------------------------------------------------------  
  184.   def terminate
  185.       super
  186.       dispose_menu_particles
  187.   end   
  188.   
  189.   #--------------------------------------------------------------------------
  190.   # ● Update
  191.   #--------------------------------------------------------------------------  
  192.   def update
  193.       super
  194.       update_background
  195.       update_particle
  196.   end
  197.   
  198.   #--------------------------------------------------------------------------
  199.   # ● Update Background
  200.   #--------------------------------------------------------------------------   
  201.   def update_background
  202.       @background_sprite.ox += $game_system.wallpaper_scroll[1]
  203.       @background_sprite.oy += $game_system.wallpaper_scroll[1]
  204.   end
  205.   
  206. #--------------------------------------------------------------------------
  207. # ● Update Particle
  208. #--------------------------------------------------------------------------              
  209. def update_particle
  210.      return unless PARTICLES
  211.      @particle_bitmap.each {|sprite| sprite.update }
  212. end  
  213.   
  214. end

  215. #==============================================================================
  216. # ● Scene Menu
  217. #==============================================================================
  218. class Scene_Menu < Scene_MenuBase
  219.   include WALLPAPER_EX
  220.   
  221. #--------------------------------------------------------------------------
  222. # ● Start
  223. #--------------------------------------------------------------------------               
  224.   alias mog_layout_ex_start start
  225.   def start
  226.       mog_layout_ex_start
  227.       set_window_opacity
  228.   end  
  229. end

  230. #==============================================================================
  231. # ● Scene Item
  232. #==============================================================================
  233. class Scene_Item < Scene_ItemBase
  234.   include WALLPAPER_EX
  235.   
  236. #--------------------------------------------------------------------------
  237. # ● Start
  238. #--------------------------------------------------------------------------               
  239.   alias mog_layout_ex_start start
  240.   def start
  241.       mog_layout_ex_start
  242.       set_window_opacity
  243.   end  
  244. end

  245. #==============================================================================
  246. # ● Scene Skill
  247. #==============================================================================
  248. class Scene_Skill < Scene_ItemBase
  249.   include WALLPAPER_EX
  250.   
  251. #--------------------------------------------------------------------------
  252. # ● Start
  253. #--------------------------------------------------------------------------               
  254.   alias mog_layout_ex_start start
  255.   def start
  256.       mog_layout_ex_start
  257.       set_window_opacity
  258.   end  
  259. end

  260. #==============================================================================
  261. # ● Scene Equip
  262. #==============================================================================
  263. class Scene_Equip < Scene_MenuBase
  264.   include WALLPAPER_EX
  265.   
  266. #--------------------------------------------------------------------------
  267. # ● Start
  268. #--------------------------------------------------------------------------               
  269.   alias mog_layout_ex_start start
  270.   def start
  271.       mog_layout_ex_start
  272.       set_window_opacity
  273.   end  
  274. end

  275. #==============================================================================
  276. # ● Scene Status
  277. #==============================================================================
  278. class Scene_Status < Scene_MenuBase
  279.   include WALLPAPER_EX
  280.   
  281. #--------------------------------------------------------------------------
  282. # ● Start
  283. #--------------------------------------------------------------------------               
  284.   alias mog_layout_ex_start start
  285.   def start
  286.       mog_layout_ex_start
  287.       set_window_opacity
  288.   end  
  289. end

  290. #==============================================================================
  291. # ● Scene File
  292. #==============================================================================
  293. class Scene_File < Scene_MenuBase
  294.   include WALLPAPER_EX
  295.   
  296. #--------------------------------------------------------------------------
  297. # ● Start
  298. #--------------------------------------------------------------------------               
  299.   alias mog_layout_ex_start start
  300.   def start
  301.       mog_layout_ex_start
  302.       set_window_opacity
  303.   end  
  304. end

  305. #==============================================================================
  306. # ● Scene End
  307. #==============================================================================
  308. class Scene_End < Scene_MenuBase
  309.   include WALLPAPER_EX
  310.   
  311. #--------------------------------------------------------------------------
  312. # ● Start
  313. #--------------------------------------------------------------------------               
  314.   alias mog_layout_ex_start start
  315.   def start
  316.       mog_layout_ex_start
  317.       set_window_opacity
  318.   end  
  319. end

  320. #==============================================================================
  321. # ● Window SaveFile
  322. #==============================================================================
  323. class Window_SaveFile < Window_Base
  324.   
  325. #--------------------------------------------------------------------------
  326. # ● Initialize
  327. #--------------------------------------------------------------------------                  
  328.   alias mog_wallpaper_initialize initialize
  329.   def initialize(height, index)
  330.       mog_wallpaper_initialize(height, index)
  331.       self.opacity = WALLPAPER_EX::WINDOW_OPACITY if can_opacity_window?
  332.   end
  333.    
  334. #--------------------------------------------------------------------------
  335. # ● Can Opacity Window
  336. #--------------------------------------------------------------------------                    
  337.   def can_opacity_window?
  338.       return true
  339.   end  
  340. end

  341. $mog_rgss3_wallpaper_ex = true
复制代码

Lv4.逐梦者

梦石
2
星屑
13088
在线时间
2273 小时
注册时间
2011-6-4
帖子
613
发表于 2018-11-15 07:00:59 | 显示全部楼层
发一下错误提示窗啊
BUG反馈请加QQ 529283039
水友群 917854767

回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
7848
在线时间
1835 小时
注册时间
2017-10-23
帖子
352
发表于 2018-11-15 08:16:11 | 显示全部楼层
脚本本身是肯定不会有问题的, 通常情况下是个别的冲突了,尤其涉及背景 行走图 地图之类的。  把这个脚本放到其它窗口地图脚本之下。 还不行就得删有冲突得地图界面相关的脚本了
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
239
在线时间
33 小时
注册时间
2018-11-9
帖子
12
 楼主| 发表于 2018-11-15 09:53:38 | 显示全部楼层
xiaohuangdi 发表于 2018-11-15 08:16
脚本本身是肯定不会有问题的, 通常情况下是个别的冲突了,尤其涉及背景 行走图 地图之类的。  把这个脚本 ...

感谢回答……虽然我不知道跟哪个脚本冲突,不过我已经放弃,改用用图书馆里的方法改了菜单背景,效果差不多的
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-18 15:50

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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