I get the error "Undefined method 'Dispose'" with this script, but if I go into the script editor and just view the script before going into test play, I don't get the error...
The error is here:
@icon_sprite.dispose
Code:
#---------------
# Spriteset_Map
#---------------
class Spriteset_Map
# Thanks to Daniel for this
alias icon_init initialize
alias icon_dispose dispose
def initialize
icon_init
bitmap = Bitmap.new(250, 32)
unless $game_party.actors[0].weapon_id == 0
icon = $data_weapons[$game_party.actors[0].weapon_id].icon_name
bitmap.blt(0, 0, RPG::Cache.icon(icon), Rect.new(0, 0, 24, 24))
end
for i in 1..4
case i
when 1
next if $game_party.actors[0].armor1_id == 0
icon = $data_armors[$game_party.actors[0].armor1_id].icon_name
when 2
next if $game_party.actors[0].armor2_id == 0
icon = $data_armors[$game_party.actors[0].armor2_id].icon_name
when 3
next if $game_party.actors[0].armor3_id == 0
icon = $data_armors[$game_party.actors[0].armor3_id].icon_name
when 4
next if $game_party.actors[0].armor4_id == 0
icon = $data_armors[$game_party.actors[0].armor4_id].icon_name
end
bitmap.blt(i*51, 0, RPG::Cache.icon(icon), Rect.new(0, 0, 24, 24))
end
@icon_sprite = Sprite.new
@icon_sprite.bitmap = bitmap
@icon_sprite.x = 222
@icon_sprite.y = 417
@icon_sprite.z = 500
end
def dispose
icon_dispose
@icon_sprite.dispose
end
end
The error is here:
@icon_sprite.dispose