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

Project1

 找回密码
 注册会员
搜索

脚本报错

查看数: 1997 | 评论数: 2 | 收藏 0
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
发布时间: 2022-4-1 00:18

正文摘要:

图中这种报错该怎么解决啊,有大佬知道吗

回复

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

评分

参与人数 1星屑 +3 +1 收起 理由
alexncf125 + 3 + 1 湊齐34000

查看全部评分

永远的东方 发表于 2022-4-1 00:23:27
这里是完整的代码,大佬们可以看一下

  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
复制代码
拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

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

GMT+8, 2024-6-12 09:09

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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