Disable Continue option if no save file present (autosave/ autoload)

wesleysoho

Villager
Member
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.

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

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();
};
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Im confused.. Your autoload plugin seems to be indeed a JS code but your Autosave seems to be an Ace script..

Also, from my experience, the continue option is greyed out by default if there is no save file present.. So if you can actually select it even without a save file, you either have a plugin that allows it or you have edited the core JS file to allow it. There is nothing on your posted codes that modify that behavior.
 
Last edited:

wesleysoho

Villager
Member
Joined
Apr 2, 2019
Messages
9
Reaction score
2
First Language
english
Primarily Uses
RMMV
@Engr. Adiktuzmiko thanks for replying. well, im confused now too. the autoload plugin could very well be an Ace script and i just threw it in my game without thinkin bout it. curious tho that the plugin semi works. i turned it off and when i select continue it brings up the save menu, and im able to select a save file, i guess from the last auto save when play testing. i cant remember if i edited core files for that purpose, but i could have.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
The Autoload is an MV plugin looking at the code, while the Autosave is an ace script.

Anyway, try looking for an actual MV autosave plugin first, and try to use it instead of the one you have..
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
By default, the load option is disabled if there is no save file. If your load option is enabled when there is no save file, then one of the plugins you've added has changed that functionality. So instead of asking for another plugin, you're better off providing all the save/load plugins you're already using and have them checked/fixed so they don't override the default behaviour.

And yes, your autosave is an Ace script and will not even be recognized by the game. Would be interested to see you play, then hit F8 and go to the console to see if it shows any error messages. I have a feeling it won't even try to load it, as it's not javascript.
 

wesleysoho

Villager
Member
Joined
Apr 2, 2019
Messages
9
Reaction score
2
First Language
english
Primarily Uses
RMMV
okay so i went back and checked off the auto save but it was still saving the game so i checked for where the plugin command i used was and seen that it was a script instead ($gameSystem.onBeforeSave();DataManager.saveGame(1);) so that makes sense. i guess i didn't need that plugin to save after all. But even with the autosave plugin turned off and deleted i still get the same error as before when selecting continue.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Please show a screenshot of your console when you get the error (hit F8 and go to the Console tab). Also a screenshot of your plugin manager so we can see all the plugins you're using.

Seeing as you're requesting Continue to be disabled when there is no save file, IS there a save file that can be loaded when you get that error?
 

wesleysoho

Villager
Member
Joined
Apr 2, 2019
Messages
9
Reaction score
2
First Language
english
Primarily Uses
RMMV
good question... idk. and yes its a five nights at freddys fan game, its for my kids

upload_2019-5-24_21-51-32.pngupload_2019-5-24_21-50-45.pngupload_2019-5-24_21-51-53.png
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
[pirate]IgnoreMe[/pirate]
One of the many problems with pirated versions is that they are extremely buggy.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,078
Members
137,580
Latest member
Snavi
Top