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


 


 


 


 


 


출처: 기억안남

?

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

    Date2007.04.22 Category언어/기타 By귀찮아‡ Views1474
    Read More
  2. [DX&C++] 3D를 넘어 2D로!

    Date2007.04.18 Category언어/기타 ByZeprod Views1675
    Read More
  3. 코드진행 기초테크닉

    Date2007.04.14 Category언어/기타 By나그네M Views709
    Read More
  4. 그림 메뉴 2 [제 2의 타이틀 메뉴 (기본 메뉴편)] [거히 치트비법..]

    Date2007.04.12 Category언어/기타 By우드록맨 Views771
    Read More
  5. 마우스 이동 스크립트

    Date2007.04.11 CategoryRPG Maker By아크로s Views1965
    Read More
  6. '에피소드'형식이 아닌 '화' 형식의 시나리오는 어떨까요?

    Date2007.04.09 Category언어/기타 By우드록맨 Views1529
    Read More
  7. [초 노가다 시스템]그림 메뉴

    Date2007.04.08 CategoryRPG Maker By우드록맨 Views880
    Read More
  8. [DX&C++]3D공간상 카메라 시점의 대한 정의

    Date2007.04.02 Category언어/기타 By실베 Views1351
    Read More
  9. [DX&C++] IndexBuffer를 알아보자!

    Date2007.03.31 Category언어/기타 ByZeprod Views1240
    Read More
  10. 3D좌표계에 3D물체를 찍기위환 기초과정

    Date2007.03.31 Category언어/기타 By실베 Views1355
    Read More
  11. [공개자료] 먼치킨 액알 만들기

    Date2007.03.30 Category언어/기타 By책벌레공상가 Views2499
    Read More
  12. [DX&C++] 3대 행렬 연산의 사용

    Date2007.03.30 Category언어/기타 ByZeprod Views1404
    Read More
  13. 숫자 게이지 색에 관한 팁

    Date2007.03.30 Category언어/기타 By『덩키동크』 Views1427
    Read More
  14. [DX&C++] 3D를 다루는 프로그램의 개요

    Date2007.03.25 Category언어/기타 ByZeprod Views1247
    Read More
  15. template에 관한 간단한 예.

    Date2007.03.12 Category언어/기타 By김두한 Views1180
    Read More
  16. [고난도 시스템] 당구를 만들어 보자

    Date2007.03.12 Category언어/기타 BySSS Views1197
    Read More
  17. 2D격투게임만들기95

    Date2007.03.08 Category언어/기타 By황금잉어빵 Views2410
    Read More
  18. 1 - 1. 변수 응용 프로그램 만들기 (난수)

    Date2007.03.06 CategoryRPG Maker By천영진 Views1279
    Read More
  19. 몬스터 성향

    Date2007.03.04 Category언어/기타 By괴인X Views1256
    Read More
  20. [DX&C++] 3D 공간에 대한 이해

    Date2007.03.04 Category언어/기타 ByZeprod Views1247
    Read More
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(김원배) | 사신지(김병국)