collapse collapse

 Community


 User Info




Willkommen Gast. Bitte einloggen oder registrieren.

 Partnerseiten

rpgvx.net

Das Forum ist offline

Autor Thema: + [ Quick Save / Load / Delete ] +  (Gelesen 1748 mal)

woratana

  • Gast
+ [ Quick Save / Load / Delete ] +
« am: Mai 23, 2008, 09:33:18 »
Quick Save / Load / Delete
Version 1.0
by Woratana
Release Date: 22/05/2008


Introduction
It's the script I finished 3 months ago, but haven't post it for some reason.
In IRC, puppeto talks about this kind of script,
so that remind me post it.  ;)

Basically, this script will allow you to save/load save slot even though player is in the map.
I also add the feature to delete save file.
You may use this delete feature to make some kind of anti-hack system.

This script will be useful for anyone who want to make save / load system with event too. :)

Enjoy~  :lol:


Screenshots
No need...


Script
Place it above main

[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']#=======================================================================
# ? [VX] ? Quick Save / Load / Delete ? ?
# * Save/Load/Delete save file you want with call script *
#-------------------------------------------------------------------
# ? by Woratana [woratana@hotmail.com]
# ? Thaiware RPG Maker Community
# ? Released on: 22/05/2008
# ? Version: 1.0
#=======================================================================

#==================================================================
# ** FEATURES **
#-----------------------------------------------------------------
# - Call script to save/load/delete any save slot
# - Compatible with most of the scripts that edited Scene_File

#==================================================================
# ** HOW TO USE **
#-----------------------------------------------------------------
# - To do a quick save, call script:
#  $save.do(slot)
# For example: $save.do(1)
# * Script above will save in slot 1
#
# - To do a quick save on last slot that you use quick save, call script:
#  $save.redo
#-----------------------------------------------------------------
# - To do a quick load, call script:
#  $load.do(slot)
#
# - To do a quick load on last slot that you use quick load, call script:
#  $load.redo
#-----------------------------------------------------------------
# - To do a quick delete save file, call script:
#  $save.del(slot)
#-----------------------------------------------------------------
#                             +[ TIP ]+
# If you want to use value in variable for slot, type this for slot:
# $game_variables[variable_id]
# For example: $save.do ($game_variables[1])
#===========================================================================

#--------------------------
# ** START SETUP PART
#--------------------------

QUICK_LOAD_FADE_SCREEN = true # (true/false)
# Do you want screen to fade when using Quick Load?

#--------------------------
# ** END SETUP PART
#--------------------------

$worale = {} if $worale.nil?
$worale["QuickSave"] = true
#-------------------------------
# Quick Save
#-------------------------------
class Quick_Save
  def do(slot = 0)
    return if slot == 0
    $game_system.last_qsave_slot = slot
    save = Scene_File.new(false,false,false,1,slot)
  end
  
  def redo
    save = Scene_File.new(false,false,false,1, $game_system.last_qsave_slot)
  end
  
  def del(slot = 0)
    return if slot == 0
    delete = Scene_File.new(false,false,false,3,slot)
  end
end
$save = Quick_Save.new
#-------------------------------
# Quick Load
#-------------------------------
class Quick_Load
  def do(slot = 0)
    return if slot == 0
    $game_system.last_qload_slot = slot
    save = Scene_File.new(false,false,false,2,slot)
  end
  
  def redo
    save = Scene_File.new(false,false,false,2, $game_system.last_qsave_slot)
  end
end
$load = Quick_Load.new
#------------------------------------
# Game System: Store Variables
#------------------------------------
class Game_System
  attr_accessor :last_qsave_slot, :last_qload_slot
  alias wor_qsave_gamsys_ini initialize
  def initialize
    wor_qsave_gamsys_ini
    @last_qsave_slot = 1
    @last_qload_slot = 1
  end
end
#------------------------------------
# Scene File: Save/Load/Delete File
#------------------------------------
class Scene_File < Scene_Base
  alias wor_qsave_scefil_ini initialize
  
  def initialize(saving, from_title, from_event, skip = 0, slot = 0)
    filename = make_filename(slot - 1) if slot > 0
    if skip == 1 and slot > 0
      file = File.open(filename, "wb")
      write_save_data(file)
      file.close
      return
    elsif skip == 2 and slot > 0
      return if not FileTest.exist?(filename)
      file = File.open(filename, "rb")
      read_save_data(file)
      file.close
      $scene = Scene_Map.new
      if QUICK_LOAD_FADE_SCREEN
        RPG::BGM.fade(1)
        Graphics.fadeout(1)
        Graphics.wait(1)
      end
      @last_bgm.play
      @last_bgs.play
    elsif skip == 3 and slot > 0
      File.delete(filename) if FileTest.exist?(filename)
    else
      wor_qsave_scefil_ini(saving, from_title, from_event)
    end
  end
end


Instruction
Here is the instruction from the script :)

# ** HOW TO USE **

# - To do a quick save, call script:
$save.do(slot)# For example:
$save.do(1)# * Script above will save in slot 1

# - To do a quick save on last slot that you use quick save, call script:
$save.redo
#-----------------------------------------------------------------

# - To do a quick load, call script:
$load.do(slot)
# - To do a quick load on last slot that you use quick load, call script:
$load.redo
#-----------------------------------------------------------------

# - To do a quick delete save file, call script:
$save.del(slot)
#-----------------------------------------------------------------

#                             +[ TIP ]+

# If you want to use value in variable for slot, type this for slot:
$game_variables[variable_id]# For example:
$save.do ($game_variables[1])

Author's Notes
Free for use in your work if credit is included.


Bug Report?
Please give me these informations:
Zitat
- What is it says in error window?
- When is it get error? (Right after run game, when you choose something, etc.)
- Do you have any other scripts running in your game that may crash with this script?

+ [ Quick Save / Load / Delete ] +

Dainreth

  • Gast
+ [ Quick Save / Load / Delete ] +
« Antwort #1 am: Mai 28, 2008, 15:36:38 »
I was searching for a script like this the last days..nice to see, that you've done, thanks!

+ [ Quick Save / Load / Delete ] +

chaosBlender

  • Gast
+ [ Quick Save / Load / Delete ] +
« Antwort #2 am: Mai 29, 2008, 06:56:30 »
That's exactly what I need! Thank you very much, wora!

And great job! :D

 


 Bild des Monats

rooftop party

Views: 3581
By: papilion

 Umfrage

  • Wer soll das BdM gewinnen?
  • Dot Kandidat 1
  • 3 (25%)
  • Dot Kandidat 2
  • 1 (8%)
  • Dot Kandidat 3
  • 2 (16%)
  • Dot Kandidat 4
  • 0 (0%)
  • Dot Kandidat 5
  • 6 (50%)
  • Stimmen insgesamt: 12
  • View Topic

 Schnellsuche





SimplePortal 2.3.3 © 2008-2010, SimplePortal