XP 스크립트

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

Who's WMN

?
 
 

  W M  N  
                  자료공유

Comment '4'
  • ?
    넌닝구가좋아 2008.08.24 01:03
    ㄷㄷ
  • ?
    Shot! 2008.10.18 13:57
    이거 쓰고 문장의 처리로, 지금 저장된 데이터는 불러오기 할시에 오류가뜨니 지금 저장하지 않으면 지금까지 저장한 데이터는 날라갑니다.라고 하면 어쩔 수 없이 저장 ㅋㅋㅋ
  • ?
    Shot! 2008.10.18 13:57
    근데 VX도 되나요??
  • ?
    Aakerse 2009.01.15 18:44
    좋은자료 감사합니다!

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
34 저장 [ AutoSave ]오토세이브, 뜻 그대로 자동저장스크립트 17 file 제로스S2 2009.08.06 3694
33 저장 세이브파일 망가뜨리기 by RPG Advocate 3 백호 2009.02.22 2657
32 저장 렉없은 자동 세이브 15 알피지GM 2010.03.07 2326
31 저장 심플 세이브&로드 개조(필요할 때 원하는 슬롯에 자동저장) 5 나렌시아 2011.02.24 2291
30 저장 멀티넷스크립트 -> 아이피 세이브,로드 스크립트 9 file 백호 2009.02.22 2204
29 저장 링메뉴에 빠져 봅시다 - 링메뉴의 세이브시 팅김이 사라지는 방법 !! 3 file 백호 2009.02.21 1998
28 저장 렉없는 자동세이브(중복임??) 4 캉쿤 2011.09.12 1986
27 저장 Improved Save by gerrtunk 2 file Alkaid 2010.10.13 1983
26 저장 심플 세이브 로드(1개의 세이브 사용하기) 3 백호 2009.02.22 1971
25 저장 세이브 & 로드 화면 개조 스크립트 file 백호 2009.02.21 1961
24 저장 KGC_2PaneSave 15 file 키라링 2009.01.23 1868
23 저장 [KGC]_2PaneSave 스크립트 1 file 백호 2009.02.22 1655
22 저장 ASM - Advanced Save Menu 3 file 백호 2009.02.21 1639
21 저장 렉없는 자동세이브 스크립트 2 백호 2009.02.22 1590
20 저장 Chaos Project Save Layout 1.4 by Fantasist, Blizzard file Alkaid 2010.10.08 1558
19 저장 Advanced Save System Edit (현재 맵을 보여주지 않음) file 백호 2009.02.22 1557
18 저장 세이브 슬롯 갯수 증가와 세이브 덮어씌울 때 확인 by RPG Advocate 5 백호 2009.02.22 1505
17 저장 키라링님이 올리신 [KGC_2PaneSave] 번역 1 무뇌인 2010.08.18 1471
» 저장 자동 세이브 스크립트 4 WMN 2008.03.17 1470
15 저장 [신기술 체험] 데이터 저장 6 file 백호 2009.02.22 1420
Board Pagination Prev 1 2 Next
/ 2