Made auto saving/loading fully functional
With this, autoloading upon launching the game should be fully working. Also added some randomness to the pitch of step_sfx to make them sound a bit less repetitive, and made it so the game can only save if the current scene is a Scene_Map (because auto_saving at the titlescreen breaks things pretty badly).
This commit is contained in:
parent
154681d853
commit
4ebcd19352
|
|
@ -281,7 +281,8 @@ class Game_Player < Game_Character
|
||||||
if FOOTSTEP_AMT.include? name
|
if FOOTSTEP_AMT.include? name
|
||||||
name += '%02d' % [rand(FOOTSTEP_AMT[name]) + 1]
|
name += '%02d' % [rand(FOOTSTEP_AMT[name]) + 1]
|
||||||
end
|
end
|
||||||
Audio.se_play("Audio/SE/#{name}.wav", (80 * volume).to_i)
|
pitch = 85 + rand(30)
|
||||||
|
Audio.se_play("Audio/SE/#{name}.wav", (80 * volume).to_i, pitch.to_i)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
|
|
||||||
class Interpreter
|
class Interpreter
|
||||||
|
attr_accessor :index
|
||||||
@@chill_pill = false
|
@@chill_pill = false
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
# * Object Initialization
|
# * Object Initialization
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
|
|
||||||
at_exit do
|
at_exit do
|
||||||
save unless $game_system.map_interpreter.running?
|
save unless ($game_system.map_interpreter.running? || !$scene.is_a?(Scene_Map))
|
||||||
end
|
end
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
|
@ -19,6 +19,9 @@ begin
|
||||||
|
|
||||||
# Prepare for transition
|
# Prepare for transition
|
||||||
Graphics.freeze
|
Graphics.freeze
|
||||||
|
$debug = false
|
||||||
|
$demo = false
|
||||||
|
$GDC = false
|
||||||
# Make scene object (title screen)
|
# Make scene object (title screen)
|
||||||
$scene = Scene_Title.new
|
$scene = Scene_Title.new
|
||||||
# Call main method as long as $scene is effective
|
# Call main method as long as $scene is effective
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ def load
|
||||||
$game_followers = Marshal.load(file)
|
$game_followers = Marshal.load(file)
|
||||||
$game_oneshot = Marshal.load(file)
|
$game_oneshot = Marshal.load(file)
|
||||||
$game_fasttravel = Marshal.load(file)
|
$game_fasttravel = Marshal.load(file)
|
||||||
$game_temp.footstep_sfx = Marshal.load(file)
|
$game_temp.footstep_sfx = Marshal.load(file)
|
||||||
# If magic number is different from when saving
|
# If magic number is different from when saving
|
||||||
# (if editing was added with editor)
|
# (if editing was added with editor)
|
||||||
if $game_system.magic_number != $data_system.magic_number
|
if $game_system.magic_number != $data_system.magic_number
|
||||||
|
|
@ -61,10 +61,26 @@ end
|
||||||
def real_load
|
def real_load
|
||||||
load
|
load
|
||||||
# Restore BGM and BGS
|
# Restore BGM and BGS
|
||||||
$game_system.bgm_play($game_system.playing_bgm)
|
# switch 181 means its time for a dream, so no BGM
|
||||||
$game_system.bgs_play($game_system.playing_bgs)
|
|
||||||
|
if !$game_switches[181]
|
||||||
|
$game_system.bgm_play($game_system.playing_bgm)
|
||||||
|
$game_system.bgs_play($game_system.playing_bgs)
|
||||||
|
end
|
||||||
# Update map (run parallel process event)
|
# Update map (run parallel process event)
|
||||||
$game_map.update
|
$game_map.update
|
||||||
# Switch to map screen
|
# Switch to map screen
|
||||||
$scene = Scene_Map.new
|
$scene = Scene_Map.new
|
||||||
|
$game_temp.common_event_id = 42
|
||||||
|
end
|
||||||
|
|
||||||
|
def save_exists
|
||||||
|
return FileTest.exist?(SAVE_FILE_NAME)
|
||||||
|
end
|
||||||
|
|
||||||
|
def quit_game_bed
|
||||||
|
$game_system.map_interpreter.index += 1
|
||||||
|
save
|
||||||
|
Oneshot.allow_exit true
|
||||||
|
exit
|
||||||
end
|
end
|
||||||
|
|
@ -29,11 +29,11 @@ class Scene_Title
|
||||||
Language.initialize_database
|
Language.initialize_database
|
||||||
# Load save game/initialize data
|
# Load save game/initialize data
|
||||||
$game_temp = Game_Temp.new
|
$game_temp = Game_Temp.new
|
||||||
new_game unless load
|
new_game #unless load
|
||||||
# Make system object
|
# Make system object
|
||||||
$game_system = Game_System.new
|
$game_system = Game_System.new
|
||||||
# Skip title screen if debug mode (or demo, but not GDC)
|
# Skip title screen if debug mode (or demo, but not GDC)
|
||||||
if $debug || ($demo && !$GDC)
|
if $debug || ($demo && !$GDC) || save_exists
|
||||||
$game_map.update
|
$game_map.update
|
||||||
$game_map.autoplay
|
$game_map.autoplay
|
||||||
$scene = Scene_Map.new
|
$scene = Scene_Map.new
|
||||||
|
|
@ -115,7 +115,7 @@ class Scene_Title
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if update_cursor
|
if update_cursor
|
||||||
Audio.se_play('Audio/SE/title_cursor.wav')
|
Audio.se_play('Audio/SE/title_cursor.wav', 40)
|
||||||
@cursor.y = MENU_Y + (24 - @cursor.bitmap.height) / 2 + 24 * @cursor_pos
|
@cursor.y = MENU_Y + (24 - @cursor.bitmap.height) / 2 + 24 * @cursor_pos
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue