언어/기타
2007.04.22 07:36

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

조회 수 1610 추천 수 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
번호 분류 제목 글쓴이 날짜 조회 수
1004 RPG Maker 물체 밀어서 움직이는 이벤트 조금 더 쉽게 하는 법 zero? 2018.01.02 644
1003 언어/기타 [마지막 3명 모집] [취업연계무료교육] VR/AR 게임 콘텐츠 전문가 양성 과정 교육생 모집 file 황금상자 2017.07.14 702
1002 RPG Maker rpg vxa 로 겜만들때 데미지 설정 공식[링크] 준E 2017.06.08 740
1001 RPG Maker [꿀팁] 간단하게 만들 수 있는 실시간 전투 시스템 1 file 준E 2017.03.31 2019
1000 언어/기타 JSON parser 변환데이터 저장시 생기는 Object Too Deep 해결하기 title: 댓글러lklslel 2016.12.24 851
999 언어/기타 앙뜨프리너십에서 해커톤 부트캠프 모집중이네요 file 마나님이 2016.11.08 908
998 RPG Maker RPG MV에서 플러그인 오류의 원인에 대하여 1 title: 댓글러lklslel 2016.07.08 2359
997 RPG Maker RPG MV 게임 도중에 윈도우 스킨 파일 자체를 통째로 바꿔버리는 방법 (출처: HIME) 최저 2016.07.08 1627
996 언어/기타 게임의 버전을 짜 보자! - 유의적 버전 2.0.0 Yanggaeng 2016.06.07 1123
995 RPG Maker 텍스트 대화 도중 메뉴 여는 방법을 알아냈습니다! 2 file 정궈니 2016.03.12 2938
994 RPG Maker rpgmv 마우스 지원과 터치 지원이 되니. 2 팡소리 2015.10.25 1011
993 RPG Maker RPG Maker MV 와 AJAX를 이용한 웹통신 관련 영상. 2 HT9MAN 2015.10.25 2246
992 언어/기타 RPG게임 뻔한요소들. 8 title: 천무천무 2015.10.05 1644
991 언어/기타 자바스크립트와 관련해서 참고할 만한 사이트들 3 MARCO 2015.10.04 921
990 언어/기타 꿀잼이군요! 3 사람님[대회참가] 2015.05.20 873
989 RPG Maker [RPG2000/3 팁] 간편한 이벤트 단축키 title: 자게이하앵 2015.04.06 1833
988 RPG Maker [RPG2000/3 팁] 간편한 이벤트 단축키 1 file title: 자게이하앵 2015.04.05 748
987 언어/기타 [강의링크] 대비법칙-색상대비-밀당의 재미 약한 반대색 설계 title: 천무천무 2015.04.02 636
986 언어/기타 오다 주웠습니다. 9 사람님[대회참가] 2015.03.30 917
985 언어/기타 무료 이미지 사이트 Pixabay! 9 file 나작소 2015.03.28 909
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 51 Next
/ 51


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

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