메뉴 건너뛰기

창조도시 기록보관소

RPGXP/VX 렉없는 자동세이브 스크립트!!!

2007.04.19 02:33

귀찮아‡ 조회 수:755 추천:2

#==============================================================================
# *** AutoSave
#------------------------------------------------------------------------------
# This module handles the AutoSaving
#==============================================================================
module AutoSave
#--------------------------------------------------------------------------
# * Saves File
#--------------------------------------------------------------------------
def self.save
  begin
    #Saves the file to whatever $game_system.filename is
    file = File.open($game_system.filename, "wb")
    a = Scene_Save.new
    a.write_save_data(file)
  ensure
    file.close
  end
end
#--------------------------------------------------------------------------
# * Deletes File
#--------------------------------------------------------------------------
def self.deletesave
  begin
    if FileTest.exits?($game_system.filename)
      File.delete($game_system.filename)
    end 
  end
end
end
#==============================================================================


#==============================================================================
# ** Scene_Save
#------------------------------------------------------------------------------
# This class performs save screen processing.
# NOTE THAT SCENE_SAVE NO LONGER SAVES THE GAME, it changes the autosave file
#==============================================================================


class Scene_Save < Scene_File
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
  super("Which file would you like to autosave to?")
end
#--------------------------------------------------------------------------
# * Decision Processing
#--------------------------------------------------------------------------
def on_decision(filename)
  # Play save SE
  $game_system.se_play($data_system.save_se)
  $game_system.filename_c(filename)
  $scene = Scene_Menu.new
end
end


#==============================================================================
# ** Scene_Load
#------------------------------------------------------------------------------
#  This class performs load screen processing.
#==============================================================================
class Scene_Load < Scene_File


alias old_doloadthingie on_decision
#--------------------------------------------------------------------------
# * Decision Processing
#--------------------------------------------------------------------------
def on_decision(filename)
  $game_system.filename_c(filename)
  old_doloadthingie(filename)
end
end


#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
#  This class handles data surrounding the system. Backround music, etc.
#  is managed here as well. Refer to "$game_system" for the instance of
#  this class.
#==============================================================================
class Game_System
#--------------------------------------------------------------------------
# * Aliasing Objects
#--------------------------------------------------------------------------
alias autosaveinit initialize
#--------------------------------------------------------------------------
# * Initialize
#--------------------------------------------------------------------------
def initialize
  autosaveinit
  @filename = "Save1.rxdata"
end
#--------------------------------------------------------------------------
# * Filename -> Returns Autosave Filename
#--------------------------------------------------------------------------
def filename
  if @filename != nil
    return @filename
  else
    return "Save1.rxdata"
  end 
end
#--------------------------------------------------------------------------
# * Filename_change -> Sets New Autosave Filename
#--------------------------------------------------------------------------
def filename_c(newname)
  return if newname == "" or newname == nil
  @filename = newname
end
end


#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
# This class handles the party. It includes information on amount of gold
# and items. Refer to "$game_party" for the instance of this class.
#==============================================================================
class Game_Party


alias gainglod_autosave gain_gold
alias gainitem_autosave gain_item
alias gainweap_autosave gain_weapon
alias gainarmor_autosave gain_armor
#--------------------------------------------------------------------------
# * Gain Gold (or lose)
# n : amount of gold
#--------------------------------------------------------------------------
def gain_gold(n)
  gainglod_autosave(n)
  AutoSave.save
end
#--------------------------------------------------------------------------
# * Gain Items (or lose)
# item_id : item ID
# n : quantity
#--------------------------------------------------------------------------
def gain_item(item_id, n)
  gainitem_autosave(item_id, n)
  AutoSave.save
end
#--------------------------------------------------------------------------
# * Gain Weapons (or lose)
# weapon_id : weapon ID
# n : quantity
#--------------------------------------------------------------------------
def gain_weapon(weapon_id, n)
  gainweap_autosave(weapon_id, n)
  AutoSave.save
end
#--------------------------------------------------------------------------
# * Gain Armor (or lose)
# armor_id : armor ID
# n : quantity
#--------------------------------------------------------------------------
def gain_armor(armor_id, n)
  gainarmor_autosave(armor_id, n)
  AutoSave.save
end
end


#==============================================================================
# ** Scene Change Map
#------------------------------------------------------------------------------
# This Scene pop-ups when teleporting.
#==============================================================================
class Scene_Map
alias autosavescript_changemap_main main
#--------------------------------------------------------------------------
# * Main
#--------------------------------------------------------------------------
def main
  autosavescript_changemap_main
  AutoSave.save
end
end


사용방법: 그냥 main위에 찔러 넣으세요


 


 


 


 


 


출처: 기억안남

번호 제목 글쓴이 날짜 조회 수
33 넷플레이 스크립트 2.0 사용법 [3] 독도2005 2009.05.03 1453
32 게임을 시작한다음 튕기게 해보자(?) [5] file 켈군 2009.02.04 1224
31 [RPG XP]스크립트를 이용한 SRPG 이동범위 산출 및 범위 보여주기 [4] file 신덴 2008.11.19 1565
30 RPG_xp업그레이드 팩키지 [3] 星の카비 2007.12.16 1764
29 간단팁) XP에서 1초는 몇프레임인가? [4] 유진 2007.08.08 993
28 게임의 리얼리티화 [3] 유진 2007.08.05 1248
27 [THDO]판화 세계지도제작 스크립트. [7] file 협객 2007.06.25 1668
26 [스크립트 문제]RPGXP에서 타일셋의 우선순위 문제 해결 [1] file Novelist 2007.06.19 809
25 RPGXP의 기본전투 속도를 더욱 빠르게~ [9] Novelist 2007.06.08 1139
24 [구기술체험소] Fast Chatting System [2] file 비밀소년 2007.04.30 678
23 [구기술체험소] Fast Animation System [2] file 비밀소년 2007.04.30 763
» 렉없는 자동세이브 스크립트!!! [5] 귀찮아‡ 2007.04.19 755
21 마우스 이동 스크립트 [12] 아크로s 2007.04.08 1420
20 [공개자료] 먼치킨 액알 만들기 [11] 책벌레공상가 2007.03.26 1598
19 BGM, ME 소리가 안들렸다?[대책을 알아낸.............!!!] smofdz 2007.03.25 630
18 1. 변수 응용 프로그램 만들기 [4] 천영진 2007.02.21 589
17 1 - 1. 변수 응용 프로그램 만들기 (난수) [3] 천영진 2007.02.21 491
16 원형 거리 측정(세 줄 스크립트) [2] 타이머 2007.01.30 688
15 오직 RPGXP만 재생하지 못하는 MIDI파일 [5] Les Paul 2007.01.22 888
14 에에... 할일 없어서 해봤습니다... 카노 방식 이벤트 액알예제.... [2] かの☆あおき 2007.01.18 837