Something weird has come up when I tried to add a location window to my menu. This is the script:
The error is on line 26 when it refers to the $game_map.name variable. For some reason it wont read it and gives me this error:
Obviously the method is undefined...so for you scripters, how would I be able to make the method err...definable?? Its weird though because this location window works in every other game Ive put it in.
Code:
#==============================================================================
# â– Window_Location
#------------------------------------------------------------------------------
#  This displays your location via map name.
#==============================================================================
class Window_Location < Window_Base
#--------------------------------------------------------------------------
# â— Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 193, 43)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Tahoma"
self.contents.font.size = 13
refresh
end
#--------------------------------------------------------------------------
# â— Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(7, -3, 120, 15, "Location")
self.contents.font.color = normal_color
self.contents.draw_text(25, -3, 120, 15, $game_map.name.to_s, 2)
end
end
The error is on line 26 when it refers to the $game_map.name variable. For some reason it wont read it and gives me this error:
Code:
Script 'Window Location' line26: NoMethodError occurred.
Undefined method 'name' for #<Game_Map:0x17f1620>
Obviously the method is undefined...so for you scripters, how would I be able to make the method err...definable?? Its weird though because this location window works in every other game Ive put it in.