XP 스크립트

#==============================================================================
# *** 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_amain
  AutoSave.save
end
end

 

Comment '15'
  • ?
    알피지GM 2010.03.07 18:46

    메인 눌르셔야 지만 저장 됨니다~~~~~

  • ?
    내로미 2010.03.08 19:21

    계속해서 오류가 생기는군요... ㄷㄷ

  • ?
    알피지GM 2010.03.09 15:00

    님아 오류나는거 혹시 스크립트 충돌이나?

    어디다 붙이는지 모르삼??

  • profile
    VPP 2012.03.03 12:20

    성의 있게 답변해주시면 감사하겠습니다^^;


    일단 173줄과 65줄에 대한 오류 보고가 있지만 말입니다. 기본적으로 제공되는 세이브윈도우 바로 다음으로 추가를 해주어야 충돌이 나지 않더군요. Scene_Debug 바로 아래에 스크립트를 추가하면 충돌이 일어나지 않습니다. 추가하여, 기본적으로 불러오는 세이브 윈도우에서도 이 스크립트를 사용하기 때문에 문자가 영어로 출력되기 됩니다. 이것은 45줄의 ""로 처리된 영문자를 한글로 번역하면 되더군요. 세이브 데이터를 1번슬롯이 아니라 다른슬롯으로 변경하고 싶은 경우는 92줄,101줄에 Save1.rxdata를 수정하면 되겠습니다^^;

  • ?
    아다스 2010.04.19 21:46

    175줄 오류네.. 뭐떄문에그러지?

  • ?
    1234567894 2010.05.21 11:53

    ...

    조타능

  • ?
    스위민 2010.06.12 14:41

    잘 쓸게요!

  • ?
    63850 2010.06.29 16:04

    173줄 오류계속해서 뜸....

  • ?
    보라앙마 2010.07.04 13:02

    저도 173 번째 줄에서 오류 떠요 ;;

  • ?
    RPG성공시대 2010.07.21 12:31

    잘쓰겠습니다.

  • ?
    포인트팡팡 2010.07.21 12:31
    축하합니다. RPG성공시대님은 85포인트에 당첨되셨습니다
  • ?
    하츠네미쿠 2010.07.23 21:31

    감사합

  • ?
    요꼬당 2010.08.07 04:16

    잘쓸꺠여~

  • ?
    love_error 2010.08.28 07:41

    잘쓰겠뜸니다~

  • ?
    몽실년 2010.10.28 18:39

    173번에서 오류뜨던데.. 충돌인거 같쿤요.


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
801 이동 및 탈것 텔레포트 마나소비량 수정하기 3 지존!! 2010.07.22 1562
800 메뉴 새로운 메뉴 15 file 또라에몽 2010.07.17 5301
799 메뉴 메이플스토리처럼 메뉴를^^ 57 file 딸기님 2010.07.13 7137
798 기타 데이터베이스 자체 제한 해체 XP Ver. 13 THE풀잎 2010.07.04 2170
797 이동 및 탈것 8방향이동, Shift키 누르면 대쉬 63 WinHouse 2010.06.12 4023
796 [자작]게임내에서 필요한 파일 체크하기 / 디버깅 막기 17 file JACKY 2010.06.11 2508
795 메시지 말풍선 표시 스크립트 48 file insertend 2010.06.06 5161
794 타이틀/게임오버 타이틀을 아오오니처럼 만들어보자! 43 file Tassy 2010.06.02 5427
793 전투 [RTAB]HP/SH/EXP 게이지바 ver 1.00 44 file 환상 러브텔 2010.05.22 5336
792 기타 endroll 주석 번역 6 file insertend 2010.05.15 1638
791 타이틀/게임오버 [펌]색다른 게임오버 스크립트 14 file 또라에몽 2010.05.09 4265
790 이동 및 탈것 새로운 픽셀 이동 스크립트 27 file 케나이 2010.04.10 3496
789 전투 srpg용 스크립트라는데 4 세죠 2010.03.26 3524
788 온라인 게임화면을 전체화면으로 하기 27 file 이씨 2010.03.09 4052
787 전투 ABS_v3액션 알피지 46 file 알피지GM 2010.03.07 5806
» 저장 렉없은 자동 세이브 15 알피지GM 2010.03.07 2326
785 파티 KGC-대규모파티 25 rgnrk001 2010.03.01 3770
784 이동 및 탈것 아하! 그렇구나의 3D 신기술 체험 3 14 아하!잘봤어요. 2010.02.28 4258
783 이동 및 탈것 아하! 그렇구나의 3D 신기술 체험 2 23 아하!잘봤어요. 2010.02.28 3815
782 이동 및 탈것 아하! 그렇구나의 3D 신기술 체험 30 아하!잘봤어요. 2010.02.28 4772
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ... 52 Next
/ 52