Introduction Allows the scripter to place a warning window that will pop up if the player selects the exit command by mistake.
Features This version has 13 different endgame messages. You can add your own and/or change the default ones, but they shouldn't be more than 59 characters, including spaces.
Script
Munkis' Endgame Confirm
CODE
#------------------------------------------------------------------------------ # * Munkis' End Game Confirm V 1.13 # * Made by munkis # ╔══════════╗ # ║ FEATURES ║ # ╚══════════╝ # * Inspired by (and an improved version of) Omegsa7's End confirm script. I # know that Omegas7's script is a modified version of another script, but I # can't remember who made it. This version has 13 different endgame # messages. You can add your own and/or change the default ones, but they # shouldn't be more than 59 characters, including spaces. # * 100% compatible; uses custom classes. # * To use this script, add the following in a script call (or insert it in a # menu as a command: # ╔════════════════════════ ═════╗ # ║ $scene = Munkis_Endgame.new ║ # ╚════════════════════════ ═════╝ # You'll also need to turn the in-game TITLE_SWITCH on or off (either in-game # or within a particular script) as well as set the in-game DESTINATION # variable to a static value of 1-4 (again, either in-game or within a # particular script). # * V 1.0: Initial release # * V 1.1: Does not create command window if you have YEM Keyboard Input in # your game. # * Text in the window is now centered. # * V 1.12: This script now plays a random sound stored in the /audio/se/ # directory. Does not scan the RTP directory. # * V 1.13: Fixed a N00B-error that made the command window not function. How # did I not notice this sooner? >_> #------------------------------------------------------------------------------
module MNK_End_Confirm
END_MESSAGE = [] # <--- Don't edit this.
END_MESSAGE[0] = ["Go ahead and leave. See if I care."]
END_MESSAGE[1] = ["Are you trying to say you like Windows better than me?"]
END_MESSAGE[2] = ["Are you sure you want to quit this great game?"]
END_MESSAGE[3] = ["I wouldn't leave if I were you. Windows is much worse."]
END_MESSAGE[4] = ["Get outta here and go back to your boring programs."]
END_MESSAGE[5] = ["Just leave; when you come back, I'll be waiting with a bat."]
END_MESSAGE[6] = ["Let's beat it -- this is turning into a bloodbath!"]
END_MESSAGE[7] = ["You're lucky I don't smack you for thinking about leaving."]
END_MESSAGE[8] = ["You want to quit? Then, thou hast lost an eighth!"]
END_MESSAGE[9] = ["Look, bud. You leave now and you forfeit your bodycount!"]
END_MESSAGE[10] = ["Ya know, next time you come in here I'm gonna toast ya."]
END_MESSAGE[11] = ["Don't go now, there's a dimensional shambler waiting!"]
END_MESSAGE[12] = ["Don't leave -- there's a daemon around that corner!"]
END_MESSAGE[13] = ["Please don't leave, there's more daemons to toast!"]
END_MESSAGE[14] = ["If I were your boss, I'd incapacitate ya in a minute!"]
TITLE_SWITCH = 1
DESTINATION = 1
end
module Sound def self.play_random files = Dir.entries("Audio/SE") return if files.join == '...' files = files.slice(2, files.size) #this will always return ['.', '..'] as the first two entries, so remove them Audio.se_play("Audio/SE/" + files[rand(files.size)]) end end
class Endgame_Message < Window_Base def initialize super(0,170,544,100) self.opacity = 0 self.contents.draw_text (-15,-169,544,350,MNK_End_Confirm::END_MESSAGE[rand(MNK_End_Confirm::END_MESSAGE.size)],1) if $imported["KeyboardInput"] == true self.contents.draw_text (-15,(-169+WLH),544,350,"Press Y to quit.",1) end end end
$imported = {} if $imported == nil $imported["Endgame"] = true
class Munkis_Endgame < Scene_Base #---------------------------------------------------------------------------- # * Start processing #---------------------------------------------------------------------------- def start super create_menu_background unless $imported["KeyboardInput"] == true create_command_window end @message_window = Endgame_Message.new end #---------------------------------------------------------------------------- # * Post-Start Processing #---------------------------------------------------------------------------- def post_start super open_command_window end #---------------------------------------------------------------------------- # * Pre-termination Processing #---------------------------------------------------------------------------- def pre_terminate super close_command_window end #---------------------------------------------------------------------------- # * Termination Processing #---------------------------------------------------------------------------- def terminate super unless $imported["KeyboardInput"] == true dispose_command_window end dispose_menu_background @message_window.dispose end #---------------------------------------------------------------------------- # * Frame Update #---------------------------------------------------------------------------- def update super update_menu_background unless $imported["KeyboardInput"] == true @command_window.update end if Input.trigger?(Input::B) Sound.play_cancel continue elsif Input.trigger?(Input::C) and $imported["KeyboardInput"] == false case @command_window.index when 0 exit when 1 continue end elsif $imported["KeyboardInput"] == true and Input.trigger?(Input::LETTERS['Y'])# or Input.trigger?(Input::C) exit end end #---------------------------------------------------------------------------- # * Create Command Window #---------------------------------------------------------------------------- def create_command_window s1 = "Exit" s2 = "Return" @command_window = Window_Command.new(172, [s1, s2]) @command_window.x = (544 - @command_window.width) / 2 @command_window.y = 270 @command_window.openness = 0 end #---------------------------------------------------------------------------- # * Dispose of Choice Window #---------------------------------------------------------------------------- def dispose_command_window @command_window.dispose end #---------------------------------------------------------------------------- # * Open Choice Window #---------------------------------------------------------------------------- def open_command_window unless $imported["KeyboardInput"] == true @command_window.open begin @command_window.update Graphics.update end until @command_window.openness == 255 end end #---------------------------------------------------------------------------- # * Close Choice Window #---------------------------------------------------------------------------- def close_command_window unless $imported["KeyboardInput"] == true @command_window.close begin @command_window.update Graphics.update end until @command_window.openness == 0 end end #---------------------------------------------------------------------------- # * Are you coming or going? #---------------------------------------------------------------------------- def exit Sound.play_random Graphics.wait(60) if $game_switches[MNK_End_Confirm::TITLE_SWITCH] == true $scene = Scene_Title.new elsif $game_switches[MNK_End_Confirm::TITLE_SWITCH] == false $scene = nil end end def continue Sound.play_cancel if $game_variables[MNK_End_Confirm::DESTINATION] == 1 #only useful if you're using Moon's Game over menu. $scene = Scene_Gameover.new elsif $game_variables[MNK_End_Confirm::DESTINATION] == 2 $scene = Scene_Title.new elsif $game_variables[MNK_End_Confirm::DESTINATION] == 3 #only useful if you're using a script that uses an in-game map for the #title screen. Using the previous will reset any actions executed on the #map title screen. $scene = Scene_Map.new elsif $game_variables[MNK_End_Confirm::DESTINATION] == 4 $scene = Scene_End.new end end end
Customization Look at the config module, it should be simple enough to understand.
DEMO The script is pretty simple to use and doesn't require any images, so a demo shouldn't be necessary.
Installation Place in MATERIALS, above MAIN.
FAQ Q: ZOMG teh scripz doesn't werk!!! A: First of all, be more specific, Second, all reports typed in chat-speak or 1337-speak will be ignored.
Terms and Conditions I don't mind if this script is posted or linked on other RMVX sites AS LONG AS YOU GIVE CREDIT!!! Same goes for using this in your project. Contact me if you want to use this in a commercial project.