Autoload script (and autosave script for anyone who can fix it)
#1
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


Hey there, here I am again, i got a useful script for you people today!

Autoload Script: Use this to automatically load your first save slot to bypass the title screen you can make your own title screen with it!

First make sure you have a map where you save first before putting in this script!

To insert in the game overwrite Scene_Title with the following content:

Code:
class Scene_Title
#------------#
# Door Jeffro#
#------------#
def main
  $data_actors        = load_data("Data/Actors.rxdata")
  $data_classes       = load_data("Data/Classes.rxdata")
  $data_skills        = load_data("Data/Skills.rxdata")
  $data_items         = load_data("Data/Items.rxdata")
  $data_weapons       = load_data("Data/Weapons.rxdata")
  $data_armors        = load_data("Data/Armors.rxdata")
  $data_enemies       = load_data("Data/Enemies.rxdata")
  $data_troops        = load_data("Data/Troops.rxdata")
  $data_states        = load_data("Data/States.rxdata")
  $data_animations    = load_data("Data/Animations.rxdata")
  $data_tilesets      = load_data("Data/Tilesets.rxdata")
  $data_common_events = load_data("Data/CommonEvents.rxdata")
  $data_system        = load_data("Data/System.rxdata")
  $data_load          = load_data("Save1.rxdata")
  $game_system = Game_System.new
  Graphics.frame_count = 0
  $game_temp          = Game_Temp.new
  $game_system        = Game_System.new
  $game_switches      = Game_Switches.new
  $game_variables     = Game_Variables.new
  $game_self_switches = Game_SelfSwitches.new
  $game_screen        = Game_Screen.new
  $game_actors        = Game_Actors.new
  $game_party         = Game_Party.new
  $game_troop         = Game_Troop.new
  $game_map           = Game_Map.new
  $game_player        = Game_Player.new
  $game_party.setup_starting_members
  $game_map.setup($data_system.start_map_id)
  $game_player.moveto($data_system.start_x, $data_system.start_y)
  $game_player.refresh
  $game_map.autoplay
   # セーブデータの書き込み
   file = File.open("Save1.rxdata")
   read_save_data(file)
   file.close
   # BGM、BGS を復帰
   $game_system.bgm_play($game_system.playing_bgm)
   $game_system.bgs_play($game_system.playing_bgs)
   # マップを更新 (並列イベント実行)
   $game_map.update
   # マップ画面に切り替え
   $scene = Scene_Map.new
end
end
def read_save_data(file)
   # セーブファイル描画用のキャラクターデータを読み込む
   characters = Marshal.load(file)
   # プレイ時間計測用のフレームカウントを読み込む
   Graphics.frame_count = Marshal.load(file)
   # 各種ゲームオブジェクトを読み込む
   $game_system        = Marshal.load(file)
   $game_switches      = Marshal.load(file)
   $game_variables     = Marshal.load(file)
   $game_self_switches = Marshal.load(file)
   $game_screen        = Marshal.load(file)
   $game_actors        = Marshal.load(file)
   $game_party         = Marshal.load(file)
   $game_troop         = Marshal.load(file)
   $game_map           = Marshal.load(file)
   $game_player        = Marshal.load(file)
   # マジックナンバーがセーブ時と異なる場合
   # (エディタで編集が加えられている場合)
   if $game_system.magic_number != $data_system.magic_number
     # マップをリロード
     $game_map.setup($game_map.map_id)
     $game_player.center($game_player.x, $game_player.y)
   end
   # パーティメンバーをリフレッシュ
   $game_party.refresh
end



I heard people want a autosave script, here's my code but it doesn't work yet, if someone can fix it they may post it here and use it in their game!

You have to call this script with it, that autosave, so for example you could save at exit or such!
Code:
#==============================================================================
# ■ Scene_Save By Jeffro, Auto save (Just Call Save Menu in A Event or a Common
#    event
#------------------------------------------------------------------------------
#  セーブ画面の処理を行うクラスです。
#==============================================================================

class Scene_Save < Scene_File
   $game_system.se_play($data_system.save_se)
   # セーブデータの書き込み
   file = File.open(filename, "Save1.rxdata")
   write_save_data(file)
   file.close
   # イベントから呼び出されている場合
   if $game_temp.save_calling
     # セーブ呼び出しフラグをクリア
     $game_temp.save_calling = false
     # マップ画面に切り替え
     $scene = Scene_Map.new
     return
   end
   # メニュー画面に切り替え
   $scene = Scene_Menu.new(4)
end
#--------------------------------------------------------------------------
# ● キャンセル時の処理
#--------------------------------------------------------------------------
def on_cancel
   # キャンセル SE を演奏
   $game_system.se_play($data_system.cancel_se)
   # イベントから呼び出されている場合
   if $game_temp.save_calling
     # セーブ呼び出しフラグをクリア
     $game_temp.save_calling = false
     # マップ画面に切り替え
     $scene = Scene_Map.new
     return
   end
   # メニュー画面に切り替え
   $scene = Scene_Menu.new(4)
end
#--------------------------------------------------------------------------
# ● セーブデータの書き込み
#     file : 書き込み用ファイルオブジェクト (オープン済み)
#--------------------------------------------------------------------------
def write_save_data(file)
   # セーブファイル描画用のキャラクターデータを作成
   characters = []
   for i in 0...$game_party.actors.size
     actor = $game_party.actors[i]
     characters.push([actor.character_name, actor.character_hue])
   end
   # セーブファイル描画用のキャラクターデータを書き込む
   Marshal.dump(characters, file)
   # プレイ時間計測用のフレームカウントを書き込む
   Marshal.dump(Graphics.frame_count, file)
   # セーブ回数を 1 増やす
   $game_system.save_count += 1
   # マジックナンバーを保存する
   # (エディタで保存するたびにランダムな値に書き換えられる)
   $game_system.magic_number = $data_system.magic_number
   # 各種ゲームオブジェクトを書き込む
   Marshal.dump($game_system, file)
   Marshal.dump($game_switches, file)
   Marshal.dump($game_variables, file)
   Marshal.dump($game_self_switches, file)
   Marshal.dump($game_screen, file)
   Marshal.dump($game_actors, file)
   Marshal.dump($game_party, file)
   Marshal.dump($game_troop, file)
   Marshal.dump($game_map, file)
   Marshal.dump($game_player, file)
end

Well cya later people!
}


Possibly Related Threads…
Thread Author Replies Views Last Post
  Change character script jaigai 0 3,187 11-19-2006, 01:00 PM
Last Post: jaigai
  Just a modification of Abyssos' facs script lumina... 0 2,958 11-01-2006, 01:00 PM
Last Post: lumina...
  Credit Script 1.1 acoole 0 2,838 10-24-2006, 01:00 PM
Last Post: acoole
  Script Dev Kit Nick 0 3,227 10-15-2006, 01:00 PM
Last Post: Nick
  Opening Image script sasuke89 0 2,360 07-24-2006, 01:00 PM
Last Post: sasuke89
  Change Color of The diferent Status Script MASTERLOKI 0 2,634 07-18-2006, 01:00 PM
Last Post: MASTERLOKI
  Event Name and ID Search Script Hadriel 0 2,417 06-21-2006, 01:00 PM
Last Post: Hadriel
  Currency Script Split 0 2,658 05-18-2006, 01:00 PM
Last Post: Split
  Book Script and Utility Bruth 0 2,606 05-07-2006, 01:00 PM
Last Post: Bruth
  Individuality Script DrakoShade 0 2,571 03-12-2006, 01:00 PM
Last Post: DrakoShade



Users browsing this thread: 1 Guest(s)