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 백호

?

이상혁입니다.

http://elab.kr

Comment '2'

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6317
341 전투 KGC_RandomTarget(랜덤 타겟) 1 file 백호 2009.02.22 1501
340 전투 KGC_PreempAttack(선제공격) file 백호 2009.02.22 1407
339 전투 KGC_OverDrive(오버 드라이브) 3 file 백호 2009.02.22 2553
338 전투 ABP 액알 (Action Battle Player) 14 file 백호 2009.02.22 4564
337 이동 및 탈것 이벤트가 이벤트를 따라가는것 8 백호 2009.02.22 1876
336 이동 및 탈것 그래픽 변경 데쉬 3 file 백호 2009.02.22 2503
335 타이틀/게임오버 타이틀 화면 메뉴 변경 24 file 백호 2009.02.22 5590
334 타이틀/게임오버 죽엇을경우 마을로이동하기 스크립트 16 file 백호 2009.02.22 3328
333 저장 렉없는 자동세이브 스크립트 2 백호 2009.02.22 1593
332 스킬 ABP액알 v1.2 스킬추가, 버그수정판 36 file 백호 2009.02.22 6922
» 저장 오류 수정한 자동세이브 2 백호 2009.02.22 1410
330 스킬 KGC_HideNameSkill(명칭 비표시 스킬) 백호 2009.02.22 1125
329 전투 KGC_GuardRecover(방어시 HP회복) 4 백호 2009.02.22 1354
328 전투 KGC_FusionEnemy(에너미 융합) 1 백호 2009.02.22 1661
327 장비 KGC_EquipmentBreak(장비품 파괴) 1 백호 2009.02.22 1357
326 전투 RTAB 1.16ver 12 file 백호 2009.02.22 3967
325 스킬 [RTAB] 스킬영창시간 7 file 백호 2009.02.22 2878
324 전투 RTAB/CRB 단축키 1.0.0ver 3 file 백호 2009.02.22 2529
323 스킬 KGC_CrashSkill(자폭스킬) 4 file 백호 2009.02.22 2034
322 전투 KGC_BattlerEffect(버틀러 효과) 2 file 백호 2009.02.22 1959
Board Pagination Prev 1 ... 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 ... 52 Next
/ 52