언어/기타
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위에 찔러 넣으세요


 


 


 


 


 


출처: 기억안남

?

  1. 물체 밀어서 움직이는 이벤트 조금 더 쉽게 하는 법

    Date2018.01.02 CategoryRPG Maker Byzero? Views644
    Read More
  2. [마지막 3명 모집] [취업연계무료교육] VR/AR 게임 콘텐츠 전문가 양성 과정 교육생 모집

    Date2017.07.14 Category언어/기타 By황금상자 Views702
    Read More
  3. rpg vxa 로 겜만들때 데미지 설정 공식[링크]

    Date2017.06.08 CategoryRPG Maker By준E Views740
    Read More
  4. [꿀팁] 간단하게 만들 수 있는 실시간 전투 시스템

    Date2017.03.31 CategoryRPG Maker By준E Views2019
    Read More
  5. JSON parser 변환데이터 저장시 생기는 Object Too Deep 해결하기

    Date2016.12.24 Category언어/기타 Bytitle: 댓글러lklslel Views851
    Read More
  6. 앙뜨프리너십에서 해커톤 부트캠프 모집중이네요

    Date2016.11.08 Category언어/기타 By마나님이 Views908
    Read More
  7. RPG MV에서 플러그인 오류의 원인에 대하여

    Date2016.07.08 CategoryRPG Maker Bytitle: 댓글러lklslel Views2359
    Read More
  8. RPG MV 게임 도중에 윈도우 스킨 파일 자체를 통째로 바꿔버리는 방법 (출처: HIME)

    Date2016.07.08 CategoryRPG Maker By최저 Views1627
    Read More
  9. 게임의 버전을 짜 보자! - 유의적 버전 2.0.0

    Date2016.06.07 Category언어/기타 ByYanggaeng Views1123
    Read More
  10. 텍스트 대화 도중 메뉴 여는 방법을 알아냈습니다!

    Date2016.03.12 CategoryRPG Maker By정궈니 Views2938
    Read More
  11. rpgmv 마우스 지원과 터치 지원이 되니.

    Date2015.10.25 CategoryRPG Maker By팡소리 Views1011
    Read More
  12. RPG Maker MV 와 AJAX를 이용한 웹통신 관련 영상.

    Date2015.10.25 CategoryRPG Maker ByHT9MAN Views2246
    Read More
  13. RPG게임 뻔한요소들.

    Date2015.10.05 Category언어/기타 Bytitle: 천무천무 Views1644
    Read More
  14. 자바스크립트와 관련해서 참고할 만한 사이트들

    Date2015.10.04 Category언어/기타 ByMARCO Views921
    Read More
  15. 꿀잼이군요!

    Date2015.05.20 Category언어/기타 By사람님[대회참가] Views873
    Read More
  16. [RPG2000/3 팁] 간편한 이벤트 단축키

    Date2015.04.06 CategoryRPG Maker Bytitle: 자게이하앵 Views1833
    Read More
  17. [RPG2000/3 팁] 간편한 이벤트 단축키

    Date2015.04.05 CategoryRPG Maker Bytitle: 자게이하앵 Views748
    Read More
  18. [강의링크] 대비법칙-색상대비-밀당의 재미 약한 반대색 설계

    Date2015.04.02 Category언어/기타 Bytitle: 천무천무 Views636
    Read More
  19. 오다 주웠습니다.

    Date2015.03.30 Category언어/기타 By사람님[대회참가] Views917
    Read More
  20. 무료 이미지 사이트 Pixabay!

    Date2015.03.28 Category언어/기타 By나작소 Views909
    Read More
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(김원배) | 사신지(김병국)