메뉴 건너뛰기

창조도시 기록보관소

#==============================================================================
# *** 자동 저장
# 원본제작자 - 모름
# 원본게시물 - 귀찮아‡ (yoseb031) 님의 게시물 (http://www.acoc.co.kr/bbs/view.php?id=acoc_board_ideatip&no=455&n_mode=n)
# 한글화 - JamesClifford (http://www.acoc.co.kr에 배포합니다)
# 덧붙이는말) 직접 번역했으며, 의미가 자연스럽도록 없는 단어 조금씩 붙여서
# 의역 했습니다. 잘못된 부분이 있으면 지적해주시기 바랍니다.
# 이 스크립트를 분석하는분께 도움이 됬으면 하는 바람입니다.
#------------------------------------------------------------------------------
# 이 모듈은 '자동저장(AutoSaving)'에 대한 모듈입니다
#==============================================================================
module AutoSave
#--------------------------------------------------------------------------
# * 파일 저장
#--------------------------------------------------------------------------
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
#--------------------------------------------------------------------------
# * 파일 삭제
#--------------------------------------------------------------------------
def self.deletesave
  begin
    if FileTest.exits?($game_system.filename)
      File.delete($game_system.filename)
    end 
  end
end
end
#==============================================================================


#==============================================================================
# ** 장면저장(Scene_Save)
#------------------------------------------------------------------------------
# 이 클래스는 화면 저장 작업을 진행합니다.
# 알림! SCENE_SAVE는 더 이상 게임 저장에 사용할 수 없습니다.
# 이것은 자동저장 파일(autosave file)로 변경됩니다.
#==============================================================================


class Scene_Save < Scene_File
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
  super("Which file would you like to autosave to?")
end
#--------------------------------------------------------------------------
# * 진행 결정
#--------------------------------------------------------------------------
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)
#------------------------------------------------------------------------------
#  이 클래스는 화면을 부르는 작업을 진행합니다
#==============================================================================
class Scene_Load < Scene_File


alias old_doloadthingie on_decision
#--------------------------------------------------------------------------
# * 작업 진행
#--------------------------------------------------------------------------
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
#--------------------------------------------------------------------------
# * 초기화
#--------------------------------------------------------------------------
def initialize
  autosaveinit
  @filename = "Save1.rxdata"
end
#--------------------------------------------------------------------------
# * 파일명 -> 자동저장 파일명을 얻습니다
#--------------------------------------------------------------------------
def filename
  if @filename != nil
    return @filename
  else
    return "Save1.rxdata"
  end 
end
#--------------------------------------------------------------------------
# * 파일명 변경 -> 새로운 자동저장 파일명을 설정합니다
#--------------------------------------------------------------------------
def filename_c(newname)
  return if newname == "" or newname == nil
  @filename = newname
end
end


#==============================================================================
# ** 게임 파티 (Game_Party)
#------------------------------------------------------------------------------
# 이것은 파티(party)클래스 입니다. 이것은 금(gold)의 총액과 아이템에 대한 정보를
# 포함합니다. 이 클래스를 위해서 "$game_party"에서 자료를 불러옵니다.
#==============================================================================
class Game_Party


alias gainglod_autosave gain_gold
alias gainitem_autosave gain_item
alias gainweap_autosave gain_weapon
alias gainarmor_autosave gain_armor
#--------------------------------------------------------------------------
# * 금(Gold) 받아오기 (혹은 잃기)
# n : 금(Gold)의 총액
#--------------------------------------------------------------------------
def gain_gold(n)
  gainglod_autosave(n)
  AutoSave.save
end
#--------------------------------------------------------------------------
# * 아이템 얻어오기 (혹은 잃기)
# item_id : item ID
# n : 수량
#--------------------------------------------------------------------------
def gain_item(item_id, n)
  gainitem_autosave(item_id, n)
  AutoSave.save
end
#--------------------------------------------------------------------------
# * 무기 얻어오기 (혹은 잃기)
# weapon_id : 무기(weapon) ID
# n : 수량
#--------------------------------------------------------------------------
def gain_weapon(weapon_id, n)
  gainweap_autosave(weapon_id, n)
  AutoSave.save
end
#--------------------------------------------------------------------------
# * 방어구 얻어오기 (혹은 잃기)
# armor_id : 갑옷 ID
# n : 수량
#--------------------------------------------------------------------------
def gain_armor(armor_id, n)
  gainarmor_autosave(armor_id, n)
  AutoSave.save
end
end


#==============================================================================
# ** 맵의 장면변화
#------------------------------------------------------------------------------
# 이것은 순간이동(teleporting)했을때 장면이 튀어나오게 합니다
#==============================================================================
class Scene_Map
alias autosavescript_changemap_main main
#--------------------------------------------------------------------------
# * 메인(Main)
#--------------------------------------------------------------------------
def main
  autosavescript_changemap_main
  AutoSave.save
end
end


 

번호 제목 글쓴이 날짜 조회 수
429 [덧붙임] 변수번호의 스위치 사용은 되도록이면 자제 [1] A. 미스릴 2007.10.15 503
428 RPG에 자주 있는것들 [15] ⓦildⓡose★ 2007.09.26 1514
427 [한단계 도약]변수 번호의 변수 [5] A. 미스릴 2007.09.21 643
426 한가지 경우에만 적용되는 경험치 게이지바 [7] file 베넘 2007.09.21 616
425 [한단계 도약] 변수 번호의 스위치 [6] A. 미스릴 2007.09.12 653
424 [한단계 도약] 되풀이 처리 [2] A. 미스릴 2007.09.12 449
423 RPG 2K시리즈에서도 Script의 사용이 가능합니다. [9] 타다기 2007.08.21 1103
» 귀찮아‡님의 자동세이브 스크립트의 한글화 [3] J.Clifford 2007.08.19 617
421 가장 보편적인 범위 좌표 설정하기. [6] 아싸사랑 2007.08.15 852
420 간단팁) XP에서 1초는 몇프레임인가? [4] 유진 2007.08.08 993
419 대기중에 캐릭터가 움직이게/못움직이게 하려면? [2] 유진 2007.08.08 679
418 게임의 리얼리티화 [3] 유진 2007.08.05 1248
417 [C++] 최단거리 구하는 알고리즘, E log V Dijkstra [2] 악희 2007.08.01 749
416 [DX/VB] DirectDraw? 별거 아냐! (3) 더블 버퍼의 생성과 블리팅 [2] 악희 2007.08.01 624
415 0707후반기[제작자포럼]공성결과 [5] 천무 2007.08.01 401
414 [DX/VB] DirectDraw? 별거 아냐! (2) 블리팅, 그리고 투명도 [1] 악희 2007.07.30 570
413 [DX/VB] DirectDraw? 별거 아냐! (1) DirectDraw객체의 생성과 표면의 생성 [3] 악희 2007.07.27 631
412 게시판 이용 및 라이센스 공지 J.Clifford 2007.07.23 521
411 두드리는 미니게임... [3] JIN[晉] 2007.07.22 565
410 7월상반기(제작자포럼)공성결과 천무 2007.07.16 358