언어/기타
2007.04.22 07:36

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

조회 수 1474 추천 수 2 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 수정 삭제
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 수정 삭제

#==============================================================================
# *** 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위에 찔러 넣으세요


 


 


 


 


 


출처: 기억안남

?

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
121 언어/기타 [DX&C++] 3대 행렬 연산의 사용 Zeprod 2007.03.30 1407
120 언어/기타 [잡담] ONE's SCRIPT 소개 Zeprod 2008.12.16 1411
119 언어/기타 [초보용!] 뭐 ~? 몬스터가 원거리 공격을 한다구~ 다크세이버™ 2005.12.05 1415
118 언어/기타 [예제포함] 턴제 액션알피지 간단하게 만들어보자 !! 다크세이버™ 2005.09.28 1417
117 언어/기타 포트리스예제 최종수정판! 윈드 2006.07.28 1420
116 언어/기타 왜 C언어를 해야하나요? -1 웁피 2006.09.16 1426
115 언어/기타 숫자 게이지 색에 관한 팁 『덩키동크』 2007.03.30 1428
114 언어/기타 두드리는 미니게임... JIN[晉] 2007.07.25 1439
113 언어/기타 턴알에서 순간데미지 2배이상으로늘리기[턴알] Dship 2007.05.21 1448
112 언어/기타 귀차니즘 타파 알고리즘 file A. 미스릴 2008.02.11 1450
111 언어/기타 시작 하자 마자 스위치, 변수 조작하기 file EverSmileMan 2007.02.13 1454
110 언어/기타 [구기술체험소] Fast Animation System file 비밀소년 2007.05.03 1455
109 언어/기타 게임기초 쌓기! 천류지유 2006.08.08 1462
108 언어/기타 나의 4차원적 아이디어들.-1- file 시엔 2006.09.05 1464
107 언어/기타 [Android] 멀티스크린 노하우 2 MiDtics2 2012.10.27 1464
106 언어/기타 RPG게임 뻔한요소들. 8 천무 2015.10.05 1465
» 언어/기타 렉없는 자동세이브 스크립트!!! 귀찮아‡ 2007.04.22 1474
104 언어/기타 페인터(코럴) 브러쉬 세팅 공유 :) 8 file 샤이귤군 2015.03.28 1482
103 언어/기타 왜 C언어를 해야하나요? -2 웁피 2006.09.17 1487
102 언어/기타 윈터뮤트 엔진.....이라는군요. 협객 2007.05.18 1490
Board Pagination Prev 1 ... 25 26 27 28 29 30 31 32 33 34 ... 36 Next
/ 36






[개인정보취급방침] | [이용약관] | [제휴문의] | [후원창구] | [인디사이드연혁]

Copyright © 1999 - 2016 INdiSide.com/(주)씨엘쓰리디 All Rights Reserved.
인디사이드 운영자 : 천무(이지선) | kernys(김원배) | 사신지(김병국)