The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: ado on March 28, 2006, 06:03:40 AM

Title: Disposed Window Error? Help Please
Post by: ado on March 28, 2006, 06:03:40 AM
Hello. I made my own script (from parts from others) and when i try to do @command2_window.dispose i get an error message - "Disposed Window"  and it points to the Window_Base class?

Any ideas how to fix it?
Here is my script anyway:

----------------------------------------------------------------------------
#==============================================================================
# ? Scene_Title
#------------------------------------------------------------------------------
# ???????????????????
#==============================================================================

class Gear
 #--------------------------------------------------------------------------
 # ? ?????
 #--------------------------------------------------------------------------
 def initialize
   main
 end  
 
 def main


   s1 = "Equip Fishing Gear"
   s2 = "Crafting Screen"
   s3 = "Travel"
   s4 = "Teleport"

 
   @command2_window = Window_Command.new(192, [s1, s2, s3, s4])
   @command2_window.back_opacity = 160
   @command2_window.x = 320 - @command2_window.width / 2
   @command2_window.y = 288
   @command2_window.active = true
   loop do
     # ????????
     Graphics.update
     # ???????
     Input.update
     # ??????
     update
     # ????????????????

   end
   # ?????????

   # ?????????????
 end
 #--------------------------------------------------------------------------
 # ? ??????
 #--------------------------------------------------------------------------
 def update
   # ????????????
   @command2_window.update
   # C ??????????
   if Input.trigger?(Input::C)
     # ???????????????????
     case @command2_window.index
     when 0  # ??????
       @command2_window.dispose
     $scene = Scene_FishEquip.new
     when 1  # ???????

     when 2  # ???????

     when 3  # ???????
     
     end
   end
   

 end
 


end
Title: Disposed Window Error? Help Please
Post by: Blizzard on March 28, 2006, 10:22:53 AM
Try this

The "@command2_window.dispose" comes after the "loop do" Instead of using it in the def update place the $scene = Scene_(something).new.

You see, the loop will break if the scene is changing, so to let the window dispose after you
Title: Thanks
Post by: ado on March 29, 2006, 04:31:03 AM
Thanks man i'll give it a go! I appreciate the help.  :wink:
Title: Disposed Window Error? Help Please
Post by: ado on March 29, 2006, 04:40:51 AM
Sorry man but I still cant get this to work. I copied you script but I still got the error?