Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Munkis' Endgame Confirm
munkis
post Jan 4 2011, 08:46 AM
Post #1


Woah, dude...
Group Icon

Group: Revolutionary
Posts: 197
Type: Writer
RM Skill: Intermediate




Munkis' Endgame Confirm

Version: 1.13
Author: munkis
Release Date: 01/04/2011


Exclusive Script at RPG RPG Revolution


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.

Compatibility
100% compatible; uses custom classes.

Screenshot


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.

Credits
Credit me (munkis).


__________________________
Go to the top of the page
 
+Quote Post
   
InfinateX
post Jan 26 2011, 04:28 PM
Post #2


Level 10
Group Icon

Group: Revolutionary
Posts: 151
Type: Developer
RM Skill: Advanced




I found a slight error with the script...were it says
=════╗
# ║ $scene = Munkis_Endgame.new ║
# ╚════════════════════════
=════╝

it needs to say
#════╗
# ║ $scene = Munkis_Endgame.new ║
# ╚════════════════════════
#════╝

Great Script!


__________________________
I Support:






Legal Stuff:

If you use any of my resouces please credit me. I put © on all of them so you pretty much have to anyways.


Click Here

Some of you may have seen what I had posted in this spot before but now it just says that the request was fufilled on March 28, 2011 :)


I bet nobody knows how I did this:

If you think you figured it out PM me and if your correct you will earn this valueble skill... or you can just brag about it :D


Current Projects:

At rmrk.net/index.php/topic,42236.new.html#new and omega-dev.net/forums/showthread.php?tid=1086&pid=21328
Go to the top of the page
 
+Quote Post
   
munkis
post Jan 27 2011, 04:53 AM
Post #3


Woah, dude...
Group Icon

Group: Revolutionary
Posts: 197
Type: Writer
RM Skill: Intermediate




The word wrapping must've screwed that up when I posted the script; good catch though! It was meant to be


# ╔═════════════════════════════╗
# ║ $scene = Munkis_Endgame.new ║
# ╚═════════════════════════════╝
It'll look right in the editor.

This post has been edited by munkis: Jan 27 2011, 04:55 AM


__________________________
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 18th June 2013 - 12:44 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker