Window_Base dispose window error

Status
Not open for further replies.

AriArk

Villager
Member
Joined
Jul 12, 2013
Messages
25
Reaction score
0
First Language
English
Primarily Uses
Hello,
I have just started to try to script, not using any tutorials. The script I will put up is supposed to give you the options to go to the title and to shutdown when you get a game over. It gives me an error for Window_Base on line 114 (it is a RGSSerror) then on the next line it just says " dispose window".
Here is the script:

#==============================================================================
# ** Scene_Gameover
#------------------------------------------------------------------------------
# This class performs game over screen processing.
#==============================================================================

class Scene_Gameover < Scene_Base
#--------------------------------------------------------------------------
# * Start Processing
#--------------------------------------------------------------------------
def start
super
play_gameover_music
fadeout_frozen_graphics
create_background
create_command_window
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
super
dispose_background
close_command_window
end
#--------------------------------------------------------------------------
# * Execute Transition
#--------------------------------------------------------------------------
def perform_transition
Graphics.transition(fadein_speed)
end
#--------------------------------------------------------------------------
# * Play Music on Game Over Screen
#--------------------------------------------------------------------------
def play_gameover_music
RPG::BGM.stop
RPG::BGS.stop
$data_system.gameover_me.play
end
#--------------------------------------------------------------------------
# * Fade Out Frozen Graphics
#--------------------------------------------------------------------------
def fadeout_frozen_graphics
Graphics.transition(fadeout_speed)
Graphics.freeze
end
#--------------------------------------------------------------------------
# * Create Background
#--------------------------------------------------------------------------
def create_background
@sprite = Sprite.new
@sprite.bitmap = Cache.system("GameOver")
end
#--------------------------------------------------------------------------
# * Free Background
#--------------------------------------------------------------------------
def dispose_background
@sprite.bitmap.dispose
@sprite.dispose
end
#--------------------------------------------------------------------------
# * Get Fade Out Speed
#--------------------------------------------------------------------------
def fadeout_speed
return 60
end
#--------------------------------------------------------------------------
# * Get Fade In Speed
#--------------------------------------------------------------------------
def fadein_speed
return 120
end
#--------------------------------------------------------------------------
# * Transition to Title Screen
#--------------------------------------------------------------------------
def goto_title
fadeout_all
SceneManager.goto(Scene_Title)
end
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window
@command_window = Window_GameEnd.new
@command_window.set_handler:)to_title, method:)command_to_title))
@command_window.set_handler:)shutdown, method:)command_shutdown))
end
#--------------------------------------------------------------------------
# * Close Command Window
#--------------------------------------------------------------------------
def close_command_window
@command_window.close
update until @command_window.close?
end
#--------------------------------------------------------------------------
# * [Go to Title] Command
#--------------------------------------------------------------------------
def command_to_title
close_command_window
fadeout_all
SceneManager.goto(Scene_Title)
end
#--------------------------------------------------------------------------
# * [shut Down] Command
#--------------------------------------------------------------------------
def command_shutdown
close_command_window
fadeout_all
SceneManager.exit
end
end
Can anyone help? (Oh, btw. The error appears when I chose an option).
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,676
First Language
German
Primarily Uses
RMMV
Please post a screenshot of the error message and link to all scripts you've added, as there is no function dispose_window in the game.

If you don't have any programming knowledge, then you should either do a ruby tutorial before working on scripts, or stay at the eventing level (no script editor) until you're more comfortable with scripting (which is the same as programming in RM)
 

AriArk

Villager
Member
Joined
Jul 12, 2013
Messages
25
Reaction score
0
First Language
English
Primarily Uses
1 is the selection of the choice, 2 is the error.

1.PNG

2.PNG
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
def terminatesuperdispose_backgroundclose_command_windowendTake out the `close_command_window`.The Scene_Base terminate method disposes all windows so if you try to do something with the window afterwards you're going to get that error.
 
Last edited by a moderator:

AriArk

Villager
Member
Joined
Jul 12, 2013
Messages
25
Reaction score
0
First Language
English
Primarily Uses
def terminatesuperdispose_backgroundclose_command_windowendTake out the `close_command_window`.The Scene_Base terminate method disposes all windows so if you try to do something with the window afterwards you're going to get that error.
Thanks, that worked.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Next time you want to post code, please use

Code:
 tags so formatting is kept - it makes it much easier to follow what's going on. And also use spoiler tags, as you've done (outside the code tags) if it's a long script.
[B]This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.[/B]
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,072
Members
137,578
Latest member
JamesLightning
Top