Project1

标题: 脚本报错 [打印本页]

作者: 永远的东方    时间: 2022-4-1 00:18
标题: 脚本报错
图中这种报错该怎么解决啊,有大佬知道吗

Screenshot_20220401_000706.jpg (314.75 KB, 下载次数: 14)

Screenshot_20220401_000706.jpg

Screenshot_20220401_000610_cyou.joiplay.rpgm.jpg (160.74 KB, 下载次数: 12)

Screenshot_20220401_000610_cyou.joiplay.rpgm.jpg

作者: 永远的东方    时间: 2022-4-1 00:23
这里是完整的代码,大佬们可以看一下

  1. # also need to override 'dispose'

  2. # Adding WMTS state into savable Game_Map instance
  3. =begin
  4.     :PlayerHealth
  5.     {
  6.         :x           
  7.         :y           
  8.         :sx
  9.         :sy
  10.         :width
  11.     }
  12. class Game_Map
  13.     attr_accessor :PlayerHealth
  14. end

  15. #dispose
  16. bitmap.dispose if bitmap

  17. =end

  18. #
  19. =begin
  20. class Spriteset_Map
  21.     alias base_initialize initialize
  22.     alias base_update update
  23.     alias base_dispose dispose
  24.     def initialize(*args)
  25.         puts "$$ Spriteset_Map initialize"
  26.         # initialize health bar UI
  27.         HealthBarWindowController.create
  28.         PlayerHealth.create
  29.         EnemyHealth.create
  30.         HealthBarController.setup

  31.         # call base
  32.         base_initialize(*args)
  33.     end
  34.     def update(*args)
  35.         #puts "$$ Spriteset_Map update"
  36.         # call base
  37.         base_update(*args)

  38.         # update health bar UI
  39.         PlayerHealth.update
  40.         EnemyHealth.update

  41.         # update WMTS (World Map Travel System)
  42.         WMTS.update
  43.     end
  44.     def dispose(*args)
  45.         puts "$$ Spriteset_Map dispose"
  46.         # call base
  47.         base_dispose(*args)

  48.         # dispose health bar UI
  49.         PlayerHealth.dispose
  50.         EnemyHealth.dispose
  51.         HealthBarWindowController.dispose
  52.     end
  53. end
  54. =end
  55. # cleaned up version
  56. class Spriteset_Map
  57.     alias base_initialize initialize
  58.     alias base_update update
  59.     alias base_dispose dispose
  60.     def initialize(*args)
  61.         #
  62.         puts "Spriteset_Map CREATE CALL"
  63.         $Entites.create

  64.         # call base
  65.         base_initialize(*args)
  66.     end
  67.     def update(*args)
  68.         # call base
  69.         base_update(*args)

  70.         #
  71.         $Entites.update
  72.     end
  73.     def dispose(*args)
  74.         # call base
  75.         base_dispose(*args)

  76.         puts "Spriteset_Map DISPOSE CALL"
  77.         
  78.         #
  79.         $Entites.dispose
  80.     end
  81. end
复制代码

作者: KB.Driver    时间: 2022-4-17 19:19
可能是脚本顺序的问题?应当放在所有默认脚本的后面。
从50这个顺序来说可能不够,默认脚本里Spriteset_Map好像是第54个




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1