- Joined
- Apr 2, 2019
- Messages
- 9
- Reaction score
- 2
- First Language
- english
- Primarily Uses
- RMMV
I am using some plugins to save my game at certain points and to load the auto save file when continue is used on the title screen. Everything works as it should but when starting a new game for the first time the player can select continue even if there is no save file present. this results in the game crashing (type error cannot read property 'activate' of undefined). i would like a way to grey out or disable the continue option until an auto save file is made. i have no options menu on the title screen, so the title screen would show start when the game is started for the first time but show a start and continue option after enough progress is made to create an autosave file.
Also, with the game deployed, when i make it to an auto save, then close the game out and reopen it, it doesn't have the save anymore. i can load the auto save fine as long as i don't close the game out tho.
Also, with the game deployed, when i make it to an auto save, then close the game out and reopen it, it doesn't have the save anymore. i can load the auto save fine as long as i don't close the game out tho.
NAME_AUTOSAVE_FILE = true
AUTOSAVE_FILE_NAME = "Autosave"
AUTOSAVE_ON_MAP = true
AUTOSAVE_AFTER_BATTLE = false
$auto_save = true
class Scene_Map
alias auto_post_transfer post_transfer
def post_transfer
auto_post_transfer
return unless AUTOSAVE_ON_MAP
if Module.const_defined?
Game_Options)
DataManager.save_game(0) if $game_options.auto_save
else
DataManager.save_game(0) if $auto_save
end
end
end
module BattleManager
def self.battle_end(result)
@phase = nil
@event_proc.call(result) if @event_proc
$game_party.on_battle_end
$game_troop.on_battle_end
SceneManager.exit if $BTEST
return unless AUTOSAVE_AFTER_BATTLE
if Module.const_defined?
Game_Options)
DataManager.save_game(0) if $game_options.auto_save
else
DataManager.save_game(0) if $auto_save
end
end
end
class Window_SaveFile
alias auto_refresh refresh
def refresh
if NAME_AUTOSAVE_FILE
contents.clear
change_color(normal_color)
if @file_index == 0
name = AUTOSAVE_FILE_NAME
else
name = Vocab::File + " #{@file_index}"
end
draw_text(4, 0, 200, line_height, name)
@name_width = text_size(name).width
draw_party_characters(152, 58)
draw_playtime(0, contents.height - line_height, contents.width - 4, 2)
else
auto_refresh
end
end
end
AUTOSAVE_FILE_NAME = "Autosave"
AUTOSAVE_ON_MAP = true
AUTOSAVE_AFTER_BATTLE = false
$auto_save = true
class Scene_Map
alias auto_post_transfer post_transfer
def post_transfer
auto_post_transfer
return unless AUTOSAVE_ON_MAP
if Module.const_defined?
DataManager.save_game(0) if $game_options.auto_save
else
DataManager.save_game(0) if $auto_save
end
end
end
module BattleManager
def self.battle_end(result)
@phase = nil
@event_proc.call(result) if @event_proc
$game_party.on_battle_end
$game_troop.on_battle_end
SceneManager.exit if $BTEST
return unless AUTOSAVE_AFTER_BATTLE
if Module.const_defined?
DataManager.save_game(0) if $game_options.auto_save
else
DataManager.save_game(0) if $auto_save
end
end
end
class Window_SaveFile
alias auto_refresh refresh
def refresh
if NAME_AUTOSAVE_FILE
contents.clear
change_color(normal_color)
if @file_index == 0
name = AUTOSAVE_FILE_NAME
else
name = Vocab::File + " #{@file_index}"
end
draw_text(4, 0, 200, line_height, name)
@name_width = text_size(name).width
draw_party_characters(152, 58)
draw_playtime(0, contents.height - line_height, contents.width - 4, 2)
else
auto_refresh
end
end
end
Scene_Load.prototype.create = function() {
Scene_MenuBase.prototype.create.call(this);
};
Scene_Load.prototype.start = function() {
Scene_MenuBase.prototype.start.call(this);
var id =DataManager.lastAccessedSavefileId();
DataManager.loadGame(id)? this.onLoadSuccess() : this.onLoadFailure();
};
Scene_MenuBase.prototype.create.call(this);
};
Scene_Load.prototype.start = function() {
Scene_MenuBase.prototype.start.call(this);
var id =DataManager.lastAccessedSavefileId();
DataManager.loadGame(id)? this.onLoadSuccess() : this.onLoadFailure();
};




