Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> Instructions in main menu, Title says it all
Kali3
post Apr 30 2012, 08:49 AM
Post #1


Level 2
Group Icon

Group: Member
Posts: 25
Type: Mapper
RM Skill: Intermediate




Version: 1.0
Author: Kali3 (redefined the script), Myst (made the credit button script where I figured this out so thank him)
Release Date: 30.04.2012.

Introduction

I have never liked the instructions to be explained while your playing a game. This script adds to the main menu a new option called instructions where you can see and learn how to play a game.

Features
Plug & play
Easy to use

Script

Script Here
CODE
#==============================================================================
# Thanks to Night runner for helping to make this a bit more beautiful.
# A bit?
# He did a hell of a job making this be awesome!
# Instruction option in main menu by Kali3
#
#
# Ever tired of trying to explain what commands do you use to play the game?
# Then this is the script for you. Just in lines 38 - 43 put your instructions
# and you'll never worry again.
#
# This is just the redefined Myst's script 'Credit button'
# so if you want to credit someone, credit him.
#
# Scripting level required: Minimal
#
#==============================================================================
# This script has: 6 customization options


#==============================================================================
# ** Window_Instructions
#------------------------------------------------------------------------------
#  This window displays the instructions.
#==============================================================================

class Window_Instruction < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(Graphics.width / 4, 0, Graphics.width / 2, WLH * 6 + 32)
    self.y = (Graphics.height - self.height) / 2
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    instructions = ['Arrow up - Move up',
                    'Arrow down - Move down',
                    'Arrow left - Move left',
                    'Arrow right - Move right',
                    'Space/Z/Enter - Confirm',
                    'X - cancel'
                   ]
    for i in 0...instructions.size
      instruction = instructions[i]
      y = i * WLH
      contents.draw_text(0, y, contents.width, WLH, instruction, 1)
    end
  end
end




#==============================================================================
# This class performs the title screen processing.
#==============================================================================

class Scene_Title < Scene_Base
  #--------------------------------------------------------------------------
  # * Alias Methods
  #--------------------------------------------------------------------------
  alias kali3_instructions_start      start
  alias kali3_instructions_terminate  terminate
  alias kali3_instructions_update     update
  #--------------------------------------------------------------------------
  # * Start Processing
  #--------------------------------------------------------------------------
  def start
    # Run the original start command
    kali3_instructions_start
    # Create our instructions window
    @instruction_window = Window_Instruction.new
    @instruction_window.visible = @instruction_window.active = false
  end
  #--------------------------------------------------------------------------
  # * Terminate
  #--------------------------------------------------------------------------
  def terminate
    # Run the original terminate command
    kali3_instructions_terminate
    # Terminate our instructions window
    @instruction_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  # s[ID] = 'Command'
  # [ID] = your new ID for a new command
  # Command = your new command
  def create_command_window
    s1 = Vocab::new_game
    s2 = Vocab::continue
    s3 = Vocab::shutdown
    s4 = 'Instructions'
    @command_window = Window_Command.new(172, [s1, s2, s3, s4])#if you want to add new stuff,
                                                               #put here the next s[ID]
                                                               #and increas the first number
                                                               #window_size by 43 for each
                                                               #new command
                                            
    @command_window.x = (544 - @command_window.width) / 2
    @command_window.y = 288                 #decrase this size by 30 for each new command added
    if @continue_enabled                    # If continue is enabled
      @command_window.index = 1             # Move cursor over command
    else                                    # If disabled
      @command_window.draw_item(1, false)   # Make command semi-transparent
    end
    @command_window.openness = 0
    @command_window.open
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # If your option is highlighted and the command window is active
    if @command_window.index == 3 and @command_window.active
      # If the C button is triggered
      if Input.trigger?(Input::C)
        command_instructions
        return
      end
    end
    # If our command window is active
    if @instruction_window.active
      if Input.trigger?(Input::C)
        Sound.play_decision
        @instruction_window.active = false
        @instruction_window.visible = false
        @command_window.active = true
      end
      if Input.trigger?(Input::B)
        Sound.play_cancel
        @instruction_window.active = false
        @instruction_window.visible = false
        @command_window.active = true
      end
      return
    end
    # Run the original update
    kali3_instructions_update
  end
  #==========================================================================
  # * Command: Instructions
  #==========================================================================
  def command_instructions
    Sound.play_decision
    # Show our window
    @instruction_window.active = true
    @instruction_window.visible = true
    @command_window.active = false
  end
end

# Have a nice day, Kali3


Customization

All explained in detail in the script.

Compatibility

Compatible with everything.


Screenshot

None needed


DEMO

Not needed.


Installation

Place BELOW materials and ABOVE main.


FAQ

None.


Credits

I don't care if you credit me, just credit Myst.

Terms and Conditions

Free to use for both commercial and non commercial games.

~Have a nice day, Kali3

This post has been edited by Kali3: May 12 2012, 04:30 AM


__________________________
Better to understand a little than to misunderstand a lot.
Go to the top of the page
 
+Quote Post
   

Posts in this topic


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 May 2013 - 12:04 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker