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
> Myst's Scripts, Learning RGSS2
Myst
post Feb 14 2012, 04:22 PM
Post #1


Level 4
Group Icon

Group: Member
Posts: 51
Type: None
RM Skill: Undisclosed




Hey! Welcome to my scripting workshop. tongue.gif I'm trying to learn RGSS2 so anything I make for my own game or other's games will usually be posted up here for grabs. If you have a request feel free to PM me (I can't guarantee I can do it though being a beginner and all) but I can try my best smile.gif

Disable Save Script
CODE
#==============================================================================
# ** Disable Save Script made by Myst 2/21/2012 (Revised)
#------------------------------------------------------------------------------
#  Originally made for my own game.
#==============================================================================

class Scene_Menu < Scene_Base

  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  def create_command_window
    s1 = Vocab::item
    s2 = Vocab::skill
    s3 = Vocab::equip
    s4 = Vocab::status
    s5 = Vocab::game_end
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5])
    @command_window.index = @menu_index
    if $game_party.members.size == 0          # If number of party members is 0
      @command_window.draw_item(0, false)     # Disable item
      @command_window.draw_item(1, false)     # Disable skill
      @command_window.draw_item(2, false)     # Disable equipment
      @command_window.draw_item(3, false)     # Disable status
    end
    if $game_system.save_disabled             # If save is forbidden
      @command_window.draw_item(4, false)     # Disable save
    end
  end
  #--------------------------------------------------------------------------
  # * Update Command Selection
  #--------------------------------------------------------------------------
  def update_command_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      $scene = Scene_Map.new
    elsif Input.trigger?(Input::C)
      if $game_party.members.size == 0 and @command_window.index < 4
        Sound.play_buzzer
        return
      elsif $game_system.save_disabled and @command_window.index == 4
        Sound.play_buzzer
        return
      end
      Sound.play_decision
      case @command_window.index
      when 0      # Item
        $scene = Scene_Item.new
      when 1,2,3  # Skill, equipment, status
        start_actor_selection
      when 4      # End Game (Save Rewrite)
        $scene = Scene_End.new
      when 5      # End Game
        $scene = Scene_End.new
      end
    end
  end

  #--------------------------------------------------------------------------
  # * Update Actor Selection
  #--------------------------------------------------------------------------
  def update_actor_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      end_actor_selection
    elsif Input.trigger?(Input::C)
      $game_party.last_actor_index = @status_window.index
      Sound.play_decision
      case @command_window.index
      when 1  # skill
        $scene = Scene_Skill.new(@status_window.index)
      when 2  # equipment
        $scene = Scene_Equip.new(@status_window.index)
      when 3  # status
        $scene = Scene_Status.new(@status_window.index)
      end
    end
  end
end
This script disables save via the menu thus, making it only possible to save from the vx option "Open Save Menu" in events.


Credit Option Menu
CODE
#==============================================================================
# Credit Option Menu by Myst 2/21/2012 (Revised)
# Request by: Pera
# Edits: Scene_Title Add-on
# Installation: Paste above Main
# Line #58 is what is displayed on the credit box.
# Info: This is my second script edit any criticism/helpful suggestions would
# be extremely appreciated.
# - Myst
#------------------------------------------------------------------------------
#  This class performs the title screen processing.
#==============================================================================

class Scene_Title < Scene_Base  
  #--------------------------------------------------------------------------
  # * Adding credit as a physical option
  #--------------------------------------------------------------------------
  def create_command_window
    s1 = Vocab::new_game
    s2 = Vocab::continue
    s3 = Vocab::shutdown
    s4 = 'Credits'
    @command_window = Window_Command.new(172, [s1, s2, s3, s4])
    @command_window.x = (544 - @command_window.width) / 2
    @command_window.y = 288
    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
  #--------------------------------------------------------------------------
  # * Adding aftermath for selection of credits
  #--------------------------------------------------------------------------
  def update
    super
    @command_window.update
    if Input.trigger?(Input::C)
      case @command_window.index
      when 0    #New game
        command_new_game
      when 1    # Continue
        command_continue
      when 2    # Shutdown
        command_shutdown
      when 3    # Credits
        command_credits
      end
      end
    end
  #--------------------------------------------------------------------------
  # * Pop-Up Credit-Box
  #--------------------------------------------------------------------------
  def command_credits
    Sound.play_decision
    p('Game made by X, game made by Y, released: X/XX/XXXX X:XX PM/AM, Drawings made by X, Scripts done by X, etc.')
    end
end
This script adds credits on the Title Screen. When selected a pop-up will display game credits.


This post has been edited by Myst: Feb 21 2012, 08:34 AM
Go to the top of the page
 
+Quote Post
   
Kread-EX
post Feb 15 2012, 01:48 AM
Post #2


(=___=)/
Group Icon

Group: +Gold Member
Posts: 4,136
Type: Scripter
RM Skill: Undisclosed




Protip: when you publish a script, you should only include what you have altered. A complete class rewrite breaks compatibility with other scripts.
In this case, this script should probably be placed above every other script modifying the menu scene.


__________________________
FRACTURE - a SMT inspired game (demo) made by Rhyme, Karsuman and me. Weep and ragequit.

My blog.

Click here for my e-peen


Go to the top of the page
 
+Quote Post
   
Myst
post Feb 15 2012, 04:40 AM
Post #3


Level 4
Group Icon

Group: Member
Posts: 51
Type: None
RM Skill: Undisclosed




Ah thanks for the advice Kread, much appreciated.
I'll go clip out that section then and re-edit once I'm home. Thanks for the help!
Go to the top of the page
 
+Quote Post
   
Myst
post Feb 21 2012, 08:36 AM
Post #4


Level 4
Group Icon

Group: Member
Posts: 51
Type: None
RM Skill: Undisclosed




Update -> Changed topic's purpose (from single script to scripting workshop)
Update -> Revised Disable Save Script for compatibility
Update -> Added Credit Option Menu Script
Update -> Revised Credit Option Menu Script with help of Kread for compatibility
Go to the top of the page
 
+Quote Post
   
Pera
post Feb 21 2012, 09:37 AM
Post #5


Level 2
Group Icon

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




QUOTE (Myst @ Feb 14 2012, 04:22 PM) *
Hey! Welcome to my scripting workshop. tongue.gif I'm trying to learn RGSS2 so anything I make for my own game or other's games will usually be posted up here for grabs. If you have a request feel free to PM me (I can't guarantee I can do it though being a beginner and all) but I can try my best smile.gif

Disable Save Script
CODE
#==============================================================================
# ** Disable Save Script made by Myst 2/21/2012 (Revised)
#------------------------------------------------------------------------------
#  Originally made for my own game.
#==============================================================================

class Scene_Menu < Scene_Base

  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  def create_command_window
    s1 = Vocab::item
    s2 = Vocab::skill
    s3 = Vocab::equip
    s4 = Vocab::status
    s5 = Vocab::game_end
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5])
    @command_window.index = @menu_index
    if $game_party.members.size == 0          # If number of party members is 0
      @command_window.draw_item(0, false)     # Disable item
      @command_window.draw_item(1, false)     # Disable skill
      @command_window.draw_item(2, false)     # Disable equipment
      @command_window.draw_item(3, false)     # Disable status
    end
    if $game_system.save_disabled             # If save is forbidden
      @command_window.draw_item(4, false)     # Disable save
    end
  end
  #--------------------------------------------------------------------------
  # * Update Command Selection
  #--------------------------------------------------------------------------
  def update_command_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      $scene = Scene_Map.new
    elsif Input.trigger?(Input::C)
      if $game_party.members.size == 0 and @command_window.index < 4
        Sound.play_buzzer
        return
      elsif $game_system.save_disabled and @command_window.index == 4
        Sound.play_buzzer
        return
      end
      Sound.play_decision
      case @command_window.index
      when 0      # Item
        $scene = Scene_Item.new
      when 1,2,3  # Skill, equipment, status
        start_actor_selection
      when 4      # End Game (Save Rewrite)
        $scene = Scene_End.new
      when 5      # End Game
        $scene = Scene_End.new
      end
    end
  end

  #--------------------------------------------------------------------------
  # * Update Actor Selection
  #--------------------------------------------------------------------------
  def update_actor_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      end_actor_selection
    elsif Input.trigger?(Input::C)
      $game_party.last_actor_index = @status_window.index
      Sound.play_decision
      case @command_window.index
      when 1  # skill
        $scene = Scene_Skill.new(@status_window.index)
      when 2  # equipment
        $scene = Scene_Equip.new(@status_window.index)
      when 3  # status
        $scene = Scene_Status.new(@status_window.index)
      end
    end
  end
end
This script disables save via the menu thus, making it only possible to save from the vx option "Open Save Menu" in events.


Credit Option Menu
CODE
#==============================================================================
# Credit Option Menu by Myst 2/21/2012 (Revised)
# Request by: Pera
# Edits: Scene_Title Add-on
# Installation: Paste above Main
# Line #58 is what is displayed on the credit box.
# Info: This is my second script edit any criticism/helpful suggestions would
# be extremely appreciated.
# - Myst
#------------------------------------------------------------------------------
#  This class performs the title screen processing.
#==============================================================================

class Scene_Title < Scene_Base  
  #--------------------------------------------------------------------------
  # * Adding credit as a physical option
  #--------------------------------------------------------------------------
  def create_command_window
    s1 = Vocab::new_game
    s2 = Vocab::continue
    s3 = Vocab::shutdown
    s4 = 'Credits'
    @command_window = Window_Command.new(172, [s1, s2, s3, s4])
    @command_window.x = (544 - @command_window.width) / 2
    @command_window.y = 288
    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
  #--------------------------------------------------------------------------
  # * Adding aftermath for selection of credits
  #--------------------------------------------------------------------------
  def update
    super
    @command_window.update
    if Input.trigger?(Input::C)
      case @command_window.index
      when 0    #New game
        command_new_game
      when 1    # Continue
        command_continue
      when 2    # Shutdown
        command_shutdown
      when 3    # Credits
        command_credits
      end
      end
    end
  #--------------------------------------------------------------------------
  # * Pop-Up Credit-Box
  #--------------------------------------------------------------------------
  def command_credits
    Sound.play_decision
    p('Game made by X, game made by Y, released: X/XX/XXXX X:XX PM/AM, Drawings made by X, Scripts done by X, etc.')
    end
end
This script adds credits on the Title Screen. When selected a pop-up will display game credits.

OMG OMG OMG! Thank you so much myst! You rock!!! woot.gif woot.gif woot.gif


__________________________
Crede quod habes, et habes
-Believe that you have it, and you do.
Go to the top of the page
 
+Quote Post
   
Myst
post Feb 21 2012, 10:04 AM
Post #6


Level 4
Group Icon

Group: Member
Posts: 51
Type: None
RM Skill: Undisclosed




No problem Pera biggrin.gif

This post has been edited by Myst: Feb 21 2012, 10:04 AM
Go to the top of the page
 
+Quote Post
   
kayden997
post Feb 21 2012, 10:10 AM
Post #7


>Glitched<
Group Icon

Group: Local Mod
Posts: 1,159
Type: Event Designer
RM Skill: Masterful
Rev Points: 30




Intresting, a credit option script.
Thanks


__________________________


Runescape with Dyedfire




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: 21st May 2013 - 07:27 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker