Main Menu
  • Welcome to The RPG Maker Resource Kit.

Savepoint System

Started by Rubymatt, June 07, 2008, 03:16:49 PM

0 Members and 1 Guest are viewing this topic.

Rubymatt

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


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:

    #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



#===========================================
#  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.

DeathLock~

The tent edition was a good choice.

Nice work.


Leventhan

Is it possible that you include an item storage in the save point?

Be kind, everyone you meet is fighting a hard battle.

Rubymatt

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.

keyonne

lol I've already done this exact thing using common events. :/

Zeriab

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 ^_^

Quote from: keyonne on June 14, 2008, 03:01:10 PM
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

BloodyChaos

Nice I love the Tent addition I was trying to do this Lol good job

Sebastian Cool ^-^


atiebatie99

looks nice but your picture's and your link are all broken is it a problem of my?

greetzz
atiebatie99
My work isn't really good because I'm just 14
year
My English isn't really good because I'm from Netherlands