Hi im having a problem with using a aliasing that goes into Scene_Map and updateing, heres the script:
It's probably a really simple error but i can't see it! Just recently bought Ruby Pocket reference, but i cant see what i wcould be doing wrong.
The Error says:
Script 'My_Window'line 33: NoMethodError occurred.
undefined method 'update' for nil:NilClass
Appreciate the help!
Code:
class Window_Skills < Window_Base
def initialize
super(0,0,200,200)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
def refresh
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(0, 0, 150, 32, "Attack:")
self.contents.draw_text(70, 0, 150, 32, "1")
self.contents.draw_text(0, 20, 150, 32, "Strength:")
self.contents.draw_text(70, 20, 150, 32, "1")
self.contents.draw_text(0, 40, 150, 32, "Defense:")
self.contents.draw_text(70, 40, 150, 32, "1")
end
def update
refresh
end
end
class Scene_Map
alias old_main main
alias old_update update
def main
old_main
@window = Window_Skills.new
end
def dispose
@window.dispose
end
def update
old_update
@window.update
end
end
The Error says:
Script 'My_Window'line 33: NoMethodError occurred.
undefined method 'update' for nil:NilClass
Appreciate the help!