세이브
2007.02.20 14:44

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

조회 수 2408 추천 수 8 댓글 7
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
Extra Form
#==============================================================================
# *** 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


잘쓰세요.
- 게임공작소 kcss님의 글.
  • ?
    니오티 2007.02.24 00:08
    그럼, 일반적으로 세이브 슬롯에 저장되어서 파일로 저장되겠네, 1번 파일에 저장될라나?
  • ?
    니오티 2007.02.24 00:08
    "Save1.rxdata" 에 저장되는거 맞네요 ㅎ
  • ?
    거북e 2007.03.20 20:47
    어떻게쓰는거죠 ??
  • ?
    현수 2007.03.28 18:21
    메뉴창에 들어가면 저장돼는 형식의 스크립트군요.
  • ?
    qlqjemf11 2007.06.19 18:44
    RPGXP 온라인에 유용하게 쓰이고 있어요~
  • ?
    아짜 2007.12.11 21:39
    홋 !! 진짜 오류가 없어요 !!
  • ?
    개임 매니저 2010.01.10 12:46

    넘 좋아


List of Articles
분류 제목 글쓴이 날짜 조회 수 추천 수
공지사항 일본어 스크립트를 번역하기 좋은 번역사이트 두곳입니다 ruby 2010.01.09 22086 0
공지사항 스크립트 게시판 관리자' ruby ' 입니다 ruby 2010.01.09 20726 0
공지사항 일본 스크립트/소스 공유 포럼 4 니오티 2010.01.05 22257 0
온라인 온라인스크립트 1.7 28 file 아디안 2007.02.16 5489 27
메뉴관련 RPG XP 테스트플레이 할때 '뉴게임' '콘티뉴' '슛다운' 바꾸기 [중복이면 죄송] 12 이정한 2007.03.07 4153 18
메뉴관련 폰트 바꾸기 스크립트 5 아하하 2007.12.06 2520 9
제한변경 알피지 XP 래밸 9999되개 만들기 17 조한철ㅋ 2006.01.18 3482 8
세이브 렉없는 자동세이브 스크립트. 7 샤이닉 2007.02.20 2408 8
메뉴관련 시작 메뉴 수정, 추가, 삭제하기 5 데카 2005.02.13 2687 8
이동관련 액터 줄세우기 스크립트 (50명) 2 꿈을 나는 알피지 2006.01.15 2107 7
시각적 효과 물가에 모습비치게 하기 25 file 아하하 2007.12.06 3948 6
시각적 효과 타이틀화면 나오기전 사운드아함께 로고뛰우기 예 넥슨로고 12 루비 2007.09.07 4458 6
온라인 RPG XP 온라인 스크립트 25 file 니오티 2007.02.15 6868 6
이동관련 주인공 또는 npc 그림자 18 file 루비 2007.08.06 3145 5
전투관련 게이지 확인창 스크립트 (HP/SP/EXP) 4 file 니오티 2007.02.20 3540 5
기타 아이템 보관소 스크립트 (KGC펌) 10 file ケロロ 님의 ツク-ル 2005.12.11 2673 5
기타 일어 스크립트 한글화 방법 안내 3 니오티 2007.02.01 2572 4
대화관련 문장 색 추가하기 스크립트 5 file Hermes 2008.01.09 2133 4
전투관련 콤보 스크립트 10 아하하 2007.12.05 3700 4
플레이어 8방향 스크립트(대각선모션 추가) 13 file EH양먹는소녀 2007.09.10 2560 4
장르변경 TBS 배틀(SRPG) 11 file 아디안 2007.02.27 3482 4
메뉴관련 메뉴 반투명화 스크립트 2 windshy 2007.02.15 2315 4
메뉴관련 링메뉴 스크립트 16 windshy 2007.02.03 2980 4
Board Pagination Prev 1 2 3 4 5 6 7 Next
/ 7

Copyright ⓒ Nioting All Rights Reserved. (since 1999)    개인정보
        

Fatal error: Cannot access property sessionController::$lifetime in /web/old/xe/modules/session/session.controller.php on line 45