Help - Search - Members - Calendar
Full Version: Myst's Scripts
RPG RPG Revolution Forums > Scripting > Script Development and Support > RGSS2
Myst
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.
Kread-EX
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.
Myst
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!
Myst
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
Pera
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
Myst
No problem Pera biggrin.gif
kayden997
Intresting, a credit option script.
Thanks
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.