The RPG Maker Resource Kit

RMRK RPG Maker Creation => VX => VX Scripts Database => Topic started by: Rubymatt on June 07, 2008, 03:16:49 PM

Title: Savepoint System
Post by: Rubymatt on June 07, 2008, 03:16:49 PM
Savepoint System - like Final Fantasy
Version: 1.0
Author: Rubymattt
Description

This system is basically a Savepoint System, which allows the user to choose to Save, use a Tent or cancel.  Tents recover the entire party, and are items from the database, so they're easy to manage.

Screenshot
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fwww.shadowruby.co.uk%2FSavepoint.png&hash=4ff1afffc7af6e72fe70e0efd8725e99d8b515e3)

Demo
http://www.shadowruby.co.uk/savepoint.exe

Instructions / Notes
Place above main, below materials, use $scene = Scene_Savepoint.new to call.

Tents are automatically figured by an item, but you need to set the ID yourself.  Go down to lines 58-60:

Code:
Code: [Select]
    #Edit Below ---------------------------------
    @tent = 21   #ID of Tent item in database
    #Stop Edit ----------------------------------

Change 21 to the ID of the Tent item in your database.

Script


Code: [Select]
#===========================================
#  Final Fantasy Styled Savepoint System
#               for RMVX
#                 v1.0
#             by  Rubymatt
#===========================================

class Scene_Savepoint < Scene_Base
  def start
    super
    create_menu_background
    create_command_window
  end
  def post_start
    super
    open_command_window
  end
  def terminate
    super
    dispose_command_window
    dispose_menu_background
  end
  def update
    super
    update_menu_background
    @command_window.update
    if Input.trigger?(Input::B)
      Sound.play_cancel
      $scene = Scene_Map.new
    elsif Input.trigger?(Input::C)
      case @command_window.index
      when 0 
        Sound.play_decision
        $scene = Scene_File.new(true, false, true)
      when 1
        if $game_party.item_number($data_items[@tent]) < 1         
          Sound.play_buzzer 
        else
          Sound.play_recovery
          $game_party.lose_item($data_items[@tent], 1, false)
          for actor in $game_party.members
            actor.recover_all
          end
          @command_window.dispose
          create_command_window
          @command_window.index = 1
          @command_window.update
        end
      when 2 
        Sound.play_cancel
        $scene = Scene_Map.new
      end
    end
  end
  def update_menu_background
    super
    @menuback_sprite.tone.set(0, 0, 0, 0)
  end
  def create_command_window
    #Edit Below ---------------------------------
    @tent = 21   #ID of Tent item in database
    #Stop Edit ----------------------------------
    s1 = Vocab::save
    s2 = "Tent (" + $game_party.item_number($data_items[@tent]).to_s + " left)"
    s3 = Vocab::cancel
    @command_window = Window_Command.new(172, [s1, s2, s3])
    @command_window.x = (544 - @command_window.width) / 2
    @command_window.y = (416 - @command_window.height) / 2
    if $game_party.item_number($data_items[@tent]) < 1         
      @command_window.draw_item(1, false)   
    end
  end
  def dispose_command_window
    @command_window.dispose
  end
  def open_command_window
    @command_window.open
    begin
      @command_window.update
      Graphics.update
    end until @command_window.openness == 255
  end
  def close_command_window
    @command_window.close
    begin
      @command_window.update
      Graphics.update
    end until @command_window.openness == 0
  end
  def dispose_command_window
    @command_window.dispose
  end
end

Author's Notes / Credit

Give credit please, and enjoy use.
Title: Re: Savepoint System
Post by: DeathLock~ on June 07, 2008, 03:36:59 PM
The tent edition was a good choice.

Nice work.
Title: Re: Savepoint System
Post by: Leventhan on June 07, 2008, 04:16:43 PM
Is it possible that you include an item storage in the save point?
Title: Re: Savepoint System
Post by: Rubymatt on June 07, 2008, 04:58:13 PM
The savepoint is just a command window really, and works the same as a menu system.  if you could find the item storage script I could impliment it for you.
Title: Re: Savepoint System
Post by: keyonne on June 14, 2008, 03:01:10 PM
lol I've already done this exact thing using common events. :/
Title: Re: Savepoint System
Post by: Zeriab on June 16, 2008, 05:23:10 AM
Nice little script ^^
Can you tell my why you are using an instance variable to store the item id of the tent?
I would personally have preferred to use a CONSTANT and having it placed just below Scene_Savepoint < Scene_Base.
That way people would quicker find it ^^

As a suggestion you could consider adding a way to run a common event when you use the item instead of having hard coded the action of what happens when you use the item.
This could be generalized so you could have any arbitrary number of items (names retrieved from the items themselves) and each of these call their respective common event.
This would allow the script to be used much more dynamically and on a broader amount of areas. The price will be more complex configurations.
Still... something to consider ^_^

lol I've already done this exact thing using common events. :/
And therefore this script surely sucks :V

If you had included how you had made it with common events this that post might not have been too useless because then people could judge for themselves which system they preferred. Even then it would have been better to post in a separate thread.

*hugs*
 - Zeriab
Title: Re: Savepoint System
Post by: BloodyChaos on August 03, 2008, 04:34:06 AM
Nice I love the Tent addition I was trying to do this Lol good job
Title: Re: Savepoint System
Post by: Sebastian Cool ^-^ on November 09, 2009, 07:46:21 PM
It's Cool!!  :blizj:
Title: Re: Savepoint System
Post by: atiebatie99 on November 10, 2009, 06:27:30 PM
looks nice but your picture's and your link are all broken is it a problem of my?

greetzz
atiebatie99