[XP] Zydragon's Orb/Save Point Script

Started by Trainer Zydragon, February 11, 2010, 04:40:59 am

Previous topic - Next topic

Trainer Zydragon

February 11, 2010, 04:40:59 am Last Edit: February 12, 2010, 02:36:39 am by Blizzard
Zy's Orb/Save Point Script
Authors: Zydragon
Version: v1.1
Type: Custom Save & Quit System
Key Term: Misc System



Introduction

Alright so this is my first finished script... Simple yes? I'm a noob coder at the moment :D

Basically this script allows an FF10 style Save Orb, with Quit and Cancel functions. You can easily set the orb to heal people as well for a true FF10 orb, or you can ask (if you're worse than a coding noob) and I'll add certain options on request.

I intend to work on this as my coding skills grow, probably adding Teleport functions, custom Save screens, possibly an Options menu, info bars, and MAYBE a few more windows showing character stats, time played etc.

Let me know if you have any problems, or any coding tips :D



Features


  • FF10 Style Orb Save Point
  • Plug and play
  • Shouldn't mess with ANY other scripts



Screenshots

Spoiler: ShowHide



Demo

Orb_Save_Demo v1.0


Script

To call the script use a script call event with:
$scene=Orb_Menu.new

Spoiler: ShowHide

#===============================================================================
#                ZYDRAGON'S ORB AND SAVE POINT MENU SCRIPT
#                                  V1.1
#===============================================================================
#____Copyright_©____
#This Custom Menu System has been created by Zydragon™ and as such can not be
#used or distributed without formal acknowledgement and the acceptance of the
#creator. If this CMS is edited you must still acknowledge the original creator.
#
#____Version History____
#
#   v1.0      9/2/2010      Created
#   v1.1      10/2/2010     Save/End Fix & simplified (Thanks game_guy & nathmatt)
#
#
#____Compatability Issues____
#
#This CMS is, to my knowledge, completely compatable with all other
#RPG Maker XP scripts, as it messes with nothing and is all scripted
#within its own code.
#
#Scene_Save and Scene_End arent affected anymore. Enjoi.
#
#===============================================================================
#-------------------------------------------------------------------------------
#This CMS shows a small window in the center of the screen with selectable
#options. This CMS is made specifically for use with an Orb or Crystal Save
#Point scheme, much like FF10.
#
#To play custom Audio, export/move it to the file path Audio/BGM/SongName.mid
#and change the audio name in the options section below.
#-------------------------------------------------------------------------------

#===============================================================================
#START options section
#-------------------------------------------------------------------------------

PLAY_CUSTOM_AUDIO = true #Change to FALSE to play TITLE bgm instead
CUSTOM_AUDIO_PATH = "Audio/BGM/062-Slow05.mid" #Change "062-Slow05" to custom song's
                                              #name. .mid recommended, no other
                                              #types tested.

#-------------------------------------------------------------------------------
#END options section
#===============================================================================

#===============================================================================
#START Orb_Menu window
#-------------------------------------------------------------------------------

class Orb_Menu < Window_Base
 
 def initialize(menu_index = 0)
   @menu_index = menu_index #To show cursor position
 end
 
 def main
   s1 = "Save"
   s2 = "Quit"
   s3 = "Cancel"
   @window_orb = Window_Command.new(200, [s1, s2, s3]) #Creates array
   @window_orb.x=220
   @window_orb.y=176
   @window_orb.index = @menu_index
   @window_orb.back_opacity = 175
   
   @spriteset = Spriteset_Map.new #Screenshots current map for background
   
   if PLAY_CUSTOM_AUDIO == true
     Audio.bgm_play(CUSTOM_AUDIO_PATH, 100, 100) #Custom BGM
   else
     $game_system.bgm_play($data_system.title_bgm) #Plays your title music in menu
   end
       
   Graphics.transition
   loop do
     Graphics.update
     Input.update
     update
     if $scene != self
       break
     end
   end
   
   Graphics.freeze
   @spriteset.dispose
   @window_orb.dispose
 end

 def update #Define UPDATE shown in MAIN
 
   @window_orb.update
 
   if Input.trigger?(Input::C) #If ENTER pressed...
     case @window_orb.index
     when 0  #Define SAVE option
       $game_system.se_play($data_system.decision_se)
       $scene = Scene_Orb_Save.new
     when 1  #Define QUIT option
       $game_system.se_play($data_system.decision_se)
       $scene = Scene_Orb_End.new
     when 2  #Define CANCEL option
       $game_system.se_play($data_system.cancel_se)
       $scene = Scene_Map.new
       $game_map.autoplay
     end
   end
   
   if Input.trigger?(Input::B) #If ESCAPE pressed...
     $game_system.se_play($data_system.cancel_se) #Play sound effect
     $scene = Scene_Map.new #Exits to map
     $game_map.autoplay
   end
 end
end

#-------------------------------------------------------------------------------
#END Orb Menu window
#===============================================================================

#===============================================================================
#START Orb Save detour
#-------------------------------------------------------------------------------

class Scene_Orb_Save < Scene_Save
 def on_cancel
   if Input.trigger?(Input::B) #If ESCAPE pressed
     $game_system.se_play($data_system.decision_se)
     $scene = Orb_Menu.new     #Returns to Orb Menu if cancelled
     return
   end
 end
 def on_decision(filename)
   $game_system.se_play($data_system.save_se)
   file = File.open(filename, "wb")
   write_save_data(file)
   file.close
   $scene = Orb_Menu.new       #Returns to Orb Menu after save
 end
 
end

#-------------------------------------------------------------------------------
#END Orb Save detour
#===============================================================================

#===============================================================================
#START Orb End detour
#-------------------------------------------------------------------------------

class Scene_Orb_End < Scene_End
 def update
   if Input.trigger?(Input::B) #If ESCAPE pressed...
     $game_system.se_play($data_system.decision_se)
     $scene = Orb_Menu.new     #Returns to Orb Menu if cancelled
     return
   end
   super
 end
 def command_cancel
   $game_system.se_play($data_system.decision_se)
   $scene = Orb_Menu.new       #Returns to Orb Menu after CANCEL selected
 end
end

   
#-------------------------------------------------------------------------------
#END Orb End detour
#===============================================================================




Instructions

Script pretty much tells you what to do... Completely plug and play in v1.1, just copy&paste


Compatibility

This should be compatable with EVERY other CMS and script, since it's not a proper CMS and is only used for save orbs.


Credits and Thanks


  • Zydragon (me obviously)
  • game_guy (for Save and End fix)
  • nathmatt (for the simplification)

Blizzard

When you apply the script submission topic template, your topic can be moved in the database. If you are unsure what to fill in the in the specific categories, just check out any topic in the Script Database.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

G_G

Here's a small edited version of your script. What it does is when you leave the end menu and the save menu it goes back to the orb menu.
#===============================================================================
#____Copyright_©____
#This Custom Menu System has been created by Zydragon™ and as such can not be
#used or distributed without formal acknowledgement and the acceptance of the
#creator. If this CMS is edited you must still acknowledge the original creator.
#
#____Version History____
#
#   v1.0      9/2/2010
#
#
#____Compatability Issues____
#
#As this script is a simple CMS, it messes with Scene_End and Scene_Save,
#directing any CANCEL functions towards this CMS rather than Scene_Menu.
#
#Apart from those small edits, this CMS is completely compatable with all other
#RPG Maker XP scripts.
#
#YOUR BEST BET IS TO COPY THE DEMO'S SCENE_SAVE AND SCENE_END
#
#===============================================================================
#-------------------------------------------------------------------------------
#This CMS shows a small window in the center of the screen with selectable
#options. This CMS is made specifically for use with an Orb or Crystal Save
#Point scheme.
#-------------------------------------------------------------------------------

#===============================================================================
#START Orb_Menu window
#-------------------------------------------------------------------------------

class Orb_Menu < Window_Base
 
  def initialize(menu_index = 0)
    @menu_index = menu_index #To show cursor position
  end
 
  def main
    s1 = "Save"
    s2 = "Quit"
    s3 = "Cancel"
    @window_orb = Window_Command.new(200, [s1, s2, s3]) #Creates array
    @window_orb.x=220
    @window_orb.y=176
    @window_orb.index = @menu_index
    @window_orb.back_opacity = 175
   
    @spriteset = Spriteset_Map.new #Screenshots current map for background
   
    $game_system.bgm_play($data_system.title_bgm) #Plays your title music in menu
   
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
   
    Graphics.freeze
    @spriteset.dispose
    @window_orb.dispose
  end

  def update #Define UPDATE shown in MAIN
 
    @window_orb.update
 
    if Input.trigger?(Input::C) #If ENTER pressed...
      case @window_orb.index
      when 0
        save
      when 1
        quit
      when 2
        cancel
      end
    end
   
    if Input.trigger?(Input::B) #If ESCAPE pressed...
      $game_system.se_play($data_system.cancel_se) #Play sound effect
      $scene = Scene_Map.new #Exits to map
    end
  end
 
  def save #Define SAVE option
    $game_system.se_play($data_system.decision_se)
    $scene = Scene_ORBSave.new
  end
  def quit #Define QUIT option
    $game_system.se_play($data_system.decision_se)
    $scene = Scene_ORBEnd.new
  end
  def cancel #Define CANCEL option
    $game_system.se_play($data_system.cancel_se)
    $scene = Scene_Map.new
  end
 
end
class Scene_ORBSave < Scene_Save
  def on_cancel
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.decision_se)
      $scene = Orb_Menu.new
      return
    end
  end
end
class Scene_ORBEnd < Scene_End
  def update
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.decision_se)
      $scene = Orb_Menu.new
      return
    end
    super
  end
end

   
#-------------------------------------------------------------------------------
#END Orb Menu window
#===============================================================================


Also when going into Scene_Map.new you don't need $game_map.autoplay as the map already does it itself when Scene_Map is called. Just a small scripting tip. Nice script by the way.

Trainer Zydragon

February 11, 2010, 01:26:08 pm #3 Last Edit: February 11, 2010, 01:58:32 pm by Zydragon
Creating a seperate Save call class for the Orb Menu... Why didnt I think of that XD
(do you want mentioning in the authors list for it? :D)

Cheers for the tips, and yeah Blizz, imma edit the layout now :D cheers ^_^

EDIT:
There we go Blizz, edited :)

nathmatt

some friendly advise you dont have to def save , quit and cancel

#===============================================================================
#____Copyright_©____
#This Custom Menu System has been created by Zydragon™ and as such can not be
#used or distributed without formal acknowledgement and the acceptance of the
#creator. If this CMS is edited you must still acknowledge the original creator.
#
#____Version History____
#
#   v1.0      9/2/2010
#
#
#____Compatability Issues____
#
#As this script is a simple CMS, it messes with Scene_End and Scene_Save,
#directing any CANCEL functions towards this CMS rather than Scene_Menu.
#
#Apart from those small edits, this CMS is completely compatable with all other
#RPG Maker XP scripts.
#
#YOUR BEST BET IS TO COPY THE DEMO'S SCENE_SAVE AND SCENE_END
#
#===============================================================================
#-------------------------------------------------------------------------------
#This CMS shows a small window in the center of the screen with selectable
#options. This CMS is made specifically for use with an Orb or Crystal Save
#Point scheme.
#-------------------------------------------------------------------------------

#===============================================================================
#START Orb_Menu window
#-------------------------------------------------------------------------------

class Orb_Menu < Window_Base
 
  def initialize(menu_index = 0)
    @menu_index = menu_index #To show cursor position
  end
 
  def main
    s1 = "Save"
    s2 = "Quit"
    s3 = "Cancel"
    @window_orb = Window_Command.new(200, [s1, s2, s3]) #Creates array
    @window_orb.x=220
    @window_orb.y=176
    @window_orb.index = @menu_index
    @window_orb.back_opacity = 175
   
    @spriteset = Spriteset_Map.new #Screenshots current map for background
   
    $game_system.bgm_play($data_system.title_bgm) #Plays your title music in menu
   
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
   
    Graphics.freeze
    [@spriteset,@window_orb].each { |s| if s != nil s.dispose}
  end

  def update #Define UPDATE shown in MAIN
 
    @window_orb.update

    if Input.trigger?(Input::C) #If ENTER pressed...
      case @window_orb.index
      when 0
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Save.new
      when 1
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_End.new
      when 2
        $game_system.se_play($data_system.cancel_se)
        $scene = Scene_Map.new
      end
    end
   
    if Input.trigger?(Input::B) #If ESCAPE pressed...
      $game_system.se_play($data_system.cancel_se) #Play sound effect
      $scene = Scene_Map.new #Exits to map
    end
  end
 
end

#-------------------------------------------------------------------------------
#END Orb Menu window
#===============================================================================

Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Trainer Zydragon

February 11, 2010, 03:28:57 pm #5 Last Edit: February 11, 2010, 04:50:29 pm by Zydragon
Yeah I figured that, but I've been going off Dubealex's tutorials to help me along :)

Cheers tho :D, I'll edit that into v1.1, and I'll throw you a level :D

EDIT

Version 1.1 is up, no demo but the script is updated.
Simplified & Save/End fixed :)