XP 스크립트

#==============================================================================
# ◆심플 세이브&로드 ver.1.0
# www.ac.cyberhome.ne.jp/~daydream/
#==============================================================================
# 설명
#  세이브 데이터를 하나 밖에 만들 수 없게 하는 스크립트입니다.
#  세이브, 로드시에 윈도우는 나타나지 않습니다.
#==============================================================================
# 변경해야 할 것
# Scene_Title 의 49행목의 if FileTest.exist?("Save#{i+1}.rxdata") 를 찾아서
# ("Save#{i+1}.rxdata")를 ("SaveData.rxdata")로 바꾸어 주세요.
#==============================================================================
class Scene_Save
  #--------------------------------------------------------------------------
  # ● 메인 처리
  #--------------------------------------------------------------------------
  def main
    # 데이타베이스를 로드
    file = File.open("SaveData.rxdata", "wb")
    # 데이터를 씁니다.
    Marshal.dump($game_system, file)
    Marshal.dump($game_switches, file)
    Marshal.dump($game_variables, file)
    Marshal.dump($game_self_switches, file)
    Marshal.dump($game_screen, file)
    Marshal.dump($game_actors, file)
    Marshal.dump($game_party, file)
    Marshal.dump($game_troop, file)
    Marshal.dump($game_map, file)
    Marshal.dump($game_player, file)
    file.close
    # 이벤트로부터 불려 가고 있는 경우
    if $game_temp.save_calling
      # 세이브 호출 플래그를 클리어
      $game_temp.save_calling = false
      # 맵 화면으로 전환해
      $scene = Scene_Map.new
      return
    end
    # 메뉴 화면으로 전환해
    $scene = Scene_Menu.new(4)
  end
end


#==============================================================================
# ■ Scene_Load
#------------------------------------------------------------------------------
#  로드의 처리를 실시하는 클래스입니다.
#==============================================================================

class Scene_Load
  #--------------------------------------------------------------------------
  # ● 메인 처리
  #--------------------------------------------------------------------------
  def main
    # 로드 SE(을)를 연주
    $game_system.se_play($data_system.load_se)
    # 데이타베이스를 로드
    file = File.open("SaveData.rxdata", "rb")
    # 데이터를 읽어들입니다.
    $game_system        = Marshal.load(file)
    $game_switches      = Marshal.load(file)
    $game_variables    = Marshal.load(file)
    $game_self_switches = Marshal.load(file)
    $game_screen        = Marshal.load(file)
    $game_actors        = Marshal.load(file)
    $game_party        = Marshal.load(file)
    $game_troop        = Marshal.load(file)
    $game_map          = Marshal.load(file)
    $game_player        = Marshal.load(file)
    # (에디터로 편집이 더해지고 있는 경우)
    if $game_system.magic_number != $data_system.magic_number
      # 맵을 리로드
      $game_map.setup($game_map.map_id)
      $game_player.center($game_player.x, $game_player.y)
    end
    # 파티 멤버를 리프레쉬
    $game_party.refresh
    file.close
    # BGM,BGS (을)를 복귀
    $game_system.bgm_play($game_system.playing_bgm)
    $game_system.bgs_play($game_system.playing_bgs)
    # 맵을 갱신 (병렬 이벤트 실행)
    $game_map.update
    # 맵 화면으로 전환해
    $scene = Scene_Map.new
  end
end


# 반드시 변경해줘야 할 것을 변경하시고 사용하시기 바랍니다.
# 테스트는 해보지 않았으므로 오류가 발생할 가능성이 있습니다.

Who's 백호

?

이상혁입니다.

http://elab.kr

Comment '3'
  • ?
    내로미 2010.05.07 16:06

    와! 꼭 필요했던건데! 감사합니다!!

  • ?
    따배 2010.09.15 22:42

    이벤트에 스크립트로 $scene = Scene_Load.new 를 하면

    세이브파일이 없을 시에 로드를 하게되면 오류가 나는군요..

  • ?
    칼리아 2010.12.21 21:26

    감사해요


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
» 저장 심플 세이브 로드(1개의 세이브 사용하기) 3 백호 2009.02.22 1971
260 저장 심플 세이브&로드 개조(필요할 때 원하는 슬롯에 자동저장) 5 나렌시아 2011.02.24 2291
259 아이템 심플 액알 [리젠, 아이템 드롭] 18 file 백호 2009.02.21 3917
258 장비 심플액션 수정본(장비드롭, 데미지표시) 원본:비밀소년 수정:kcss 10 file 백호 2009.02.21 2721
257 전투 심플액알 더더 수정(스위치, 변수) 17 file 백호 2009.02.21 3046
256 기타 쓸 용도가 없지만 마비노기 게임 만들 때 좋죠[장작스크립트] 5 백호 2009.02.22 2408
255 기타 쓸만한스크립트61개포함 28 file 궭크이 2012.01.09 4297
254 기타 아래 스크립트에 대한 Guillaume777님의 개량판입니다. 백호 2009.02.22 880
253 기타 아이디 스크립트 4 백호 2009.02.22 1761
252 아이템 아이템 단축키로 구입 스크립트 3 백호 2009.02.22 1243
251 아이템 아이템 분류별로 나누기 (1) - 밑글과 다른 스크립트 3 file 백호 2009.02.21 1122
250 아이템 아이템 사용 클래스 한정 스크립트! 2 백호 2009.02.22 1147
249 아이템 아이템 선택하기 5 레핀 2009.01.29 2084
248 아이템 아이템 소지수 무제한 1 백호 2009.02.21 887
247 아이템 아이템 소지수 한계돌파(중복일 확률 높음) 3 캉쿤 2011.09.13 1480
246 아이템 아이템 인벤토리 2 file 백호 2009.02.22 3356
245 아이템 아이템 정리기능 S크립T 1 file 백호 2009.02.21 1081
244 아이템 아이템 종류별로 구분해놓기!! file 백호 2009.02.21 1112
243 아이템 아이템 종류별로 분류시키는 스크립트 3 file 백호 2009.02.21 1259
242 아이템 아이템 종류별로 분류하는 스크립트 2 file 백호 2009.02.21 1055
Board Pagination Prev 1 ... 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 ... 52 Next
/ 52