언어/기타
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
번호 분류 제목 글쓴이 날짜 조회 수
824 RPG Maker 방사형 마법범위 좌표구하기 BAYONET 2006.12.17 1510
823 언어/기타 소개글 [봄이 남아있던 자리] Vermond 2007.01.24 1499
822 언어/기타 케메안쓰고 대충 그림판으로 쉽게 그려보자. 사토루 2005.10.14 1496
821 언어/기타 윈터뮤트 엔진.....이라는군요. 협객 2007.05.18 1490
820 언어/기타 왜 C언어를 해야하나요? -2 웁피 2006.09.17 1487
819 RPG Maker 액션RPG 속성무기를 만들어보자!! 천룡수 2005.05.20 1485
818 RPG Maker [한단계 도약]변수 번호의 변수 A. 미스릴 2007.10.12 1485
817 RPG Maker SRPG95에서 MP 0 소모 마법의 활용. 3 협객 2012.06.30 1484
816 RPG Maker [Nelba]강의1-초보들은 모여랏! Nelba 2005.05.29 1480
815 RPG Maker [R2K] 타이틀 제작하기 『덩키동크』 2006.01.09 1479
814 언어/기타 페인터(코럴) 브러쉬 세팅 공유 :) 8 file 샤이귤군 2015.03.28 1476
» 언어/기타 렉없는 자동세이브 스크립트!!! 귀찮아‡ 2007.04.22 1474
812 RPG Maker 2000,2003으로만드는 전략시뮬 무역장사 2005.07.30 1471
811 RPG Maker 좌표대입(ARPG) 사고실험.[이론편] 늑대소년 2005.05.18 1471
810 RPG Maker 말풍선 대화창 그노에즈 2006.12.04 1471
809 RPG Maker 데미지의 최소값, 최대값을 설정해보자! ver 1.0 『연금술사』 2007.01.07 1466
808 언어/기타 [Android] 멀티스크린 노하우 2 MiDtics2 2012.10.27 1464
807 언어/기타 나의 4차원적 아이디어들.-1- file 시엔 2006.09.05 1463
806 언어/기타 게임기초 쌓기! 천류지유 2006.08.08 1462
805 RPG Maker [넬바]인생게임을 만들려고?그러면 읽어봐![추가 추가 추가 !] Nelba 2005.06.15 1459
Board Pagination Prev 1 ... 5 6 7 8 9 10 11 12 13 14 ... 51 Next
/ 51






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

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