Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Closed TopicStart new topic
> Munkis' Main Menu Message, try saying that five times fast :P
munkis
post Feb 8 2012, 04:45 AM
Post #1


Woah, dude...
Group Icon

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




Munkis' Main Menu Message

Version: 1.0
Author: munkis
Release Date: 02/08/2012


Exclusive Script at RPG RPG Revolution


Introduction
Makes a message window pop up in the menu when certain command indexes are highlighted. Useful if you want to warn the user of any penalties for changing the difficulty in-game, or as part of a menu guide system, or whatever.

Features
Nut much to say; it's a window that appear in the main menu only when certain commands are highlighted.

Script
Munkis' Main Menu Message
CODE
#-------------------------------------------------------------------------------
#  * Munkis' Menu Message
#  * V 1.0
#  * Made by munkis
#    ╔══════════╗
#    ║ FEATURES ║
#    ╚══════════╝
#  * Makes a message window pop up when you highlight certain items in the
#    menu.  Useful if you have a difficulty selector and you want to penalize
#    the player for changing it mid-game.
#
#  * V 1.0: Initial release
#-------------------------------------------------------------------------------
module MNK_Menu_Pop
  WINDOWS = []     #--->Don't touch.
#------------------------------------------------------------------------------
#  * START Config
#------------------------------------------------------------------------------
#  * This is the config area.  Here's a list of what everything does:
#
# 1: Pop-up window x
# 2: Pop-up window y
# 3: Pop-up window width
# 4: Pop-up window height
# 5[0..n]: Pop-up window icon
# 6[0..n]: Pop-up window messages
# 7[0..n]: Command window indexes that will make the window appear when
#          highlighted
#------------------------------------------------------------------------------
  WINDOWS[0] = 0
  WINDOWS[1] = 0
  WINDOWS[2] = Graphics.width
  WINDOWS[3] = 55
  WINDOWS[4] = []     #--->Don't touch.
  WINDOWS[5] = []     #--->Don't touch.
  WINDOWS[6] = []     #--->Don't touch.
#------------------------------------------------------------------------------
#  * START Icon Config
#------------------------------------------------------------------------------
#  * This is the icon config area.  This array needs to have icon indexes for
#    ALL of the commands in the menu, not just the particular indexes listed in
#    the WINDOWS[6] array.  Just use zero for the commands that don't have a
#    window pop-up.
#------------------------------------------------------------------------------
  WINDOWS[4][0] = 0
  WINDOWS[4][1] = 137
  WINDOWS[4][2] = 0
  WINDOWS[4][3] = 142
  WINDOWS[4][4] = 0
  WINDOWS[4][6] = 0
#------------------------------------------------------------------------------
#  * END Icon Config
#------------------------------------------------------------------------------
#  * START Message Config
#------------------------------------------------------------------------------
#  * This is the message config area.  This array needs to have strings for ALL
#    of the commands in the menu, not just the particular indexes listed in the
#    WINDOWS[6] array.  Just use "" for the commands that don't have a window
#    pop-up.
#------------------------------------------------------------------------------
  WINDOWS[5][0] = ""
  WINDOWS[5][1] = "Look at and use skills.  MEDIC!!"
  WINDOWS[5][2] = ""
  WINDOWS[5][3] = "Can you show me where it hurts?"
  WINDOWS[5][4] = ""
  WINDOWS[5][6] = ""
#------------------------------------------------------------------------------
#  * END Message Config
#------------------------------------------------------------------------------
#  * START Index List Config
#------------------------------------------------------------------------------
#  * This is the index list config config area.  This array only controls what
#    commands get windows, it doesn't have anything to do with the text (that's
#    explained above).
#------------------------------------------------------------------------------
  WINDOWS[6][0] = 1
  WINDOWS[6][1] = 3
#------------------------------------------------------------------------------
#  * END Index List Config
#------------------------------------------------------------------------------
#  * END Config
#------------------------------------------------------------------------------
end
class Menu_Pop < Window_Base
  def initialize
    super(MNK_Menu_Pop::WINDOWS[0],MNK_Menu_Pop::WINDOWS[1],MNK_Menu_Pop::WINDOWS[2],MNK_Menu_Pop::WINDOWS[3])
    self.visible = false
  end
  def show_message(window_contents)
    self.visible = true
    create_contents
    refresh(window_contents)
  end
  def refresh(window_contents)
    self.contents.clear
    x = 0
    draw_icon (MNK_Menu_Pop::WINDOWS[4][window_contents], x, 0)
    x += Graphics.width-55
    draw_icon (MNK_Menu_Pop::WINDOWS[4][window_contents], x, 0)
    x = 24
    self.contents.draw_text(x-39, 0, Graphics.width, WLH, MNK_Menu_Pop::WINDOWS[5][window_contents], 1)
    return
  end
end
class Scene_Menu < Scene_Base
  alias munkis_menupop_start start
  alias munkis_menupop_update update
  alias munkis_menupop_terminate terminate
  def start
    munkis_menupop_start
    @menupop = Menu_Pop.new()
  end
  def show_message(window_contents)
    @menupop.show_message(@window_contents)
  end
  def update
    munkis_menupop_update
    if @window_contents != @command_window.index
      @window_contents = @command_window.index
    end
    for i in 0...MNK_Menu_Pop::WINDOWS[6].size
      if @window_contents == MNK_Menu_Pop::WINDOWS[6][i]
        self.show_message(@window_contents)
        break
      else
        @menupop.visible = false
      end
    end
    @menupop.update
  end
  def terminate
    munkis_menupop_terminate
    @menupop.dispose
    return
  end
end


Customization
Apart from the usual X,Y,width and height of the window, you can also change what messages/icons are used in the window.

Compatibility
No known issues.

Screenshot
Not sure if that's necessary...

DEMO
...or that either.

Installation
Place in MATERIALS, above MAIN.

FAQ
Q: ZOMG teh scriptz 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 this script being posted or linked on other 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 goes to me for the script.


__________________________
Go to the top of the page
 
+Quote Post
   
Pera
post Feb 8 2012, 11:39 AM
Post #2


Level 2
Group Icon

Group: Member
Posts: 28
Type: Event Designer
RM Skill: Undisclosed




Nice script, and handy too. I think that this can be used as a quick info about something like equip, status...
KUTGW (Keep Up The Good Work) biggrin.gif


__________________________
Crede quod habes, et habes
-Believe that you have it, and you do.
Go to the top of the page
 
+Quote Post
   

Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 24th May 2013 - 01:42 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker