RPGXP スクリプト
2013.09.24 08:03

자동 세이브 스크립트

閲覧数 1058 推奨数 0 コメント 1
?

Shortcut

Prev前へ 書き込み

Next次へ 書き込み

Larger Font Smaller Font 上へ 下へ Go comment 印刷
?

Shortcut

Prev前へ 書き込み

Next次へ 書き込み

Larger Font Smaller Font 上へ 下へ Go comment 印刷

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


출처: 게임공작소

?

List of Articles
番号 カテゴリ タイトル 投稿者 日付 閲覧数 推奨数
288 RPG MVプラグイン Mog_Battle_hud(MZ버전도 있습니다) 스트레이보우 2021.03.05 2011 0
287 RPG MVプラグイン 컷신 플러그인 스트레이보우 2020.10.30 2694 0
286 RPG MVプラグイン 업적플러그인 스트레이보우 2020.09.02 2262 0
285 RPGXP スクリプト 한글조합입력기(영어가능) file 조규진1 2019.11.10 1201 0
284 RPG MVプラグイン 게임에서 제공해주는 노래가 아닌 외부에서 다운받고 안에 넣어쓰려면 어떻게 해야하나요? 3 BigOrca 2019.07.26 1650 0
283 RPG MVプラグイン Ghost Effect 러닝은빛 2019.01.20 1323 0
282 RPGXP スクリプト RPG XP Xas액알 1 file 심심치 2018.10.30 1331 0
281 RPG MVプラグイン 커스텀 숫자 입력 패드 1 file 러닝은빛 2018.10.19 1399 0
280 RPG MVプラグイン 9마리 이상의 몬스터 설정 | More Enemies 러닝은빛 2018.08.31 1150 0
279 RPG MVプラグイン 동적 맵 타일 수정 플러그인 베지테리안카카오 2018.07.17 1251 0
278 RPG VX Ace スクリプト VXA에서 XBOX360 컨트롤러 사용 여부 체크 file 러닝은빛 2018.07.15 1053 0
277 RPG MVプラグイン RMMV 옵션 창에 메시지 속도 및 글자 크기 변경 기능 추가 file 러닝은빛 2018.07.15 1795 0
276 RPG MVプラグイン 한글 데미지 표시 file 러닝은빛 2018.07.09 1613 0
275 RPG MVプラグイン [ MV ] 심장[체력표시 하트] 플러그인 file 수성의물 2018.07.01 2407 0
274 RPG MVプラグイン [鳥小屋] 실적 플러그인(인게임 트로피 시스템) file 이니군 2017.10.31 1909 0
273 RPG VX Ace スクリプト LuD Script Package 1 file LuD 2017.08.16 1822 0
272 RPG VX Ace スクリプト [VXAce] 레이어 맵 <layer> 시스템 file LuD 2017.08.07 1478 0
271 RPG MVプラグイン [RPG MV] 퀘스트 마커 지속 표시 플러그인 file lklslel 2017.04.09 1875 0
270 RPG MVプラグイン Mirror Area - RPG Maker MV 2 file 러닝은빛 2017.01.03 5181 0
269 RPG MVプラグイン Keyboard Event - RPG Maker MV 1 러닝은빛 2017.01.03 2456 0
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 15 Next
/ 15