언어/기타
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
번호 분류 제목 글쓴이 날짜 조회 수
1004 언어/기타 ROAM에 관련된 자료. 174 피군 2006.08.08 24848
1003 [RPG2000] 가이드북 -1- (표지내용무) 창조도시 2005.05.25 14452
1002 [RPG2000] 가이드북 -3- 5 창조도시 2005.06.02 13063
1001 [RPG2000] 가이드북 -2- 2 창조도시 2005.06.01 12488
1000 [RPG2000] 가이드북 -7- 창조도시 2005.05.22 11044
999 [RPG2000] 가이드북 -4- 1 창조도시 2005.06.07 10519
998 [RPG2000] 가이드북 -5- 창조도시 2005.07.10 8730
997 [RPG2000] 가이드북 -6- 1 창조도시 2005.07.10 8376
996 언어/기타 바실리어트 1. 시작하기 전에 Vermond 2007.07.03 6071
995 언어/기타 바실리어트 3. 메인화면 제작 Vermond 2007.08.14 5958
994 언어/기타 연애 시뮬레이션 만들기 2 2 Vermond 2006.08.02 5282
993 언어/기타 [css, js] form - select안의 option들에 스타일 적용하기 4 file 2012.04.28 5202
992 RPG Maker 게이지바 스크립트 브레인 2006.09.08 4995
991 언어/기타 바실리어트 2. 스크립트 입문 1 Vermond 2007.07.05 4976
990 언어/기타 바실리어트 4. 소스 준비 Vermond 2007.08.14 4622
989 RPG Maker SRPG 만들기 강의 - 0. SRPG는 무엇일까? 2 contect 2008.07.27 4351
988 RPG Maker [RPG XP]스크립트를 이용한 SRPG 이동범위 산출 및 범위 보여주기 4 file 신덴 2009.01.09 4170
987 언어/기타 액션게임만들기(Action Game Maker) HELP파일 번역 1 다프트캣 2010.08.19 4099
986 RPG Maker 본문스크랩- rpg 제작툴 NWN 1 세죠 2010.06.26 3746
985 언어/기타 자동 길찾기 기능을 만들어보자 1 file Black-☆ 2010.08.19 3489
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 51 Next
/ 51






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

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