언어/기타
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
번호 분류 제목 글쓴이 날짜 조회 수
844 RPG Maker RPGXP 스크립트를 공부 합시다. -1강- 장아찌 2005.06.05 1587
843 언어/기타 셔츠그리기 카타린 2006.11.25 1586
842 언어/기타 흥크립트 팁 A. 미스릴 2007.12.30 1585
841 언어/기타 [DX&C++] 지형을 만들어 봅시다. (Height Map) Zeprod 2007.04.27 1580
840 언어/기타 서로 돕고 사는 세상~ Zeprod 2007.11.19 1575
839 언어/기타 작은 팁하나..전투애니메이션의 픽쳐화! file 윈드 2007.01.31 1572
838 언어/기타 나름대로 - 변수강좌 켈리시 2005.05.18 1569
837 언어/기타 [자작]마름모형 거리 재기 A. 미스릴 2006.10.22 1548
836 언어/기타 에에... 할일 없어서 해봤습니다... 카노 방식 이벤트 액알예제.... かの☆あおき 2007.01.19 1546
835 언어/기타 인터넷으로 케릭터제작하기[2번에있는거펌] 사토루 2005.08.13 1539
834 언어/기타 게임 기획[초보편] -* MiNi'M' 2006.02.22 1537
833 RPG Maker srpg의 이동 시스템 창공의곰팅이 2006.08.21 1536
832 언어/기타 R2k로 퍼즐 만들기 새벽도둑 2007.01.23 1534
831 언어/기타 액션 알피지 노가다 줄이는 방법 다크세이버™ 2006.11.08 1531
830 언어/기타 '에피소드'형식이 아닌 '화' 형식의 시나리오는 어떨까요? 우드록맨 2007.04.09 1530
829 언어/기타 게이지 시스템 [액알의 게이지 같은 거 아니에요. ] S.단이한 2006.10.07 1528
828 RPG Maker * 기타 - '대기'의 종류 천영진 2007.02.24 1527
827 언어/기타 [덧붙임] 변수번호의 스위치 사용은 되도록이면 자제 A. 미스릴 2008.04.26 1516
826 언어/기타 레벨업을 하라 . 그리하면 살것이니.. 1 file Norid 2005.05.22 1513
825 RPG Maker [한단계 도약] 되풀이 처리 A. 미스릴 2007.09.12 1513
Board Pagination Prev 1 ... 4 5 6 7 8 9 10 11 12 13 ... 51 Next
/ 51






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

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