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_main
  AutoSave.save
end
end 

Who's WMN

?
 
 

  W M  N  
                  자료공유

Comment '4'
  • ?
    넌닝구가좋아 2008.08.24 01:03
    ㄷㄷ
  • ?
    Shot! 2008.10.18 13:57
    이거 쓰고 문장의 처리로, 지금 저장된 데이터는 불러오기 할시에 오류가뜨니 지금 저장하지 않으면 지금까지 저장한 데이터는 날라갑니다.라고 하면 어쩔 수 없이 저장 ㅋㅋㅋ
  • ?
    Shot! 2008.10.18 13:57
    근데 VX도 되나요??
  • ?
    Aakerse 2009.01.15 18:44
    좋은자료 감사합니다!

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6202
181 이동 및 탈것 이벤트의 점프의 길이를 자유자제로~! 아랫꺼 업글버전 3 file 백호 2009.02.21 1576
180 온라인 인터넷 웹 상에서의 시간을 취득하는 스크립트 1 이우 2016.05.24 876
179 기타 일본RPGXP게임에서 번역한 스크립트 입니다. 1 백호 2009.02.22 1735
178 전투 일본사이트에서 찾은 턴제 스크립트 23 file 백호 2009.02.21 3997
177 기타 일시정지 스크립트 2 file 백호 2009.02.22 1796
176 기타 일시정지 스크립트 13 【§㉤ㅏ법㉧ㅣ§】 2011.02.26 1841
» 저장 자동 세이브 스크립트 4 WMN 2008.03.17 1470
174 기타 자동미로 12 file 백호 2009.02.22 2031
173 이동 및 탈것 자동으로 장애물을 피해가는 스크립트 13 file 백호 2009.02.22 1930
172 전투 자동전투 from RPG 쯔꾸르 XP RGSS Wiki 1 file 백호 2009.02.22 2622
171 메뉴 자세한 캐릭터 정보표시 스크립트 버전2 5 아방스 2009.01.12 2329
170 메뉴 자세항 개인 상태화면 8 아방스 2009.01.12 2361
169 메뉴 자작 메뉴 스크립트들(L's Simple CMS and menu scenes) (SDK 호환?) 10 Alkaid 2010.09.02 3461
168 메뉴 자작 커스텀 메뉴(데모 첨부) 3 백호 2009.02.22 2348
167 기타 잠수방지 스크립트 12 백호 2009.02.22 1865
166 장비 장비 시 전능력 표시 스크립트 4 file 백호 2009.02.21 1110
165 장비 장비 전능력 스크립트 4 file 백호 2009.02.22 1783
164 장비 장비 제련 스크립트 2 file 백호 2009.02.21 1206
163 장비 장비 착용 효과 스크립트 14 file 백호 2009.02.21 2323
162 장비 장비 화면 개조 스크립트 1 file 백호 2009.02.21 1824
Board Pagination Prev 1 ... 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 Next
/ 52