Automatically load first file

In my game, I've already used PAC's skip title script so I can use the first map as a menu, but now that I'm further in I realized there's no option for loading!

So once you open the game when there's a save file, it simply won't load it and will assume a new game file...

Here's the script;

#===============================================================================## Pacman Advanced Creative (PAC) Engine - Skip Title# 4/5/2011# Type: System# Installation: Optional value.# Level: Simple##===============================================================================## Description:# Don't want your game to have a title screen? Not liking the scene at all?# Simple solution: paste this script in and set SKIP_TITLE to true.##===============================================================================## Instructions:# INSTALLATION# Paste above main, below materials and follow PAC format if applicable. This# script operates perfectly on its own, but will work with any PAC script and# many others. Put this as close to the top of the list of custom scripts as# you possibly can, because it WILL CAUSE INCOMPATIBILITY ERRORS otherwise.# CONFIGURATION# Set SKIP_TITLE to true if you don't want the title screen to show, and go# straight to the opening map. For the purposes of the PAC Engine demo, it is# set to false.##===============================================================================## EDITING BEGINS AT LINE 35.##===============================================================================module PAC module SYSTEM SKIP_TITLE = false endend#===============================================================================## This script no longer requires editing. Do not edit anything in this script# unless you are a compenent scripter. Should you edit without any scripting# education, it may result in me tutting at you for getting it wrong.##===============================================================================$imported = {} if $imported == nil$imported["PAC_SkipTitle"] = true#==============================================================================# ** Scene_Title#------------------------------------------------------------------------------# This class performs the title screen processing.#==============================================================================class Scene_Title < Scene_Base if PAC::SYSTEM::SKIP_TITLE # Check if script is used #---------------------------------------------------------------------------- # rewrite method: main #---------------------------------------------------------------------------- def main if $BTEST # If battle test battle_test # Start battle test else # If normal play load_database # Load database create_game_objects # Create game objects load_first_map # Loads first map end end #---------------------------------------------------------------------------- # new method: load_first_map #---------------------------------------------------------------------------- def load_first_map confirm_player_location $game_party.setup_starting_members # Initial party $game_map.setup($data_system.start_map_id) # Initial map position $game_player.moveto($data_system.start_x, $data_system.start_y) $game_player.refresh $scene = Scene_Map.new Graphics.frame_count = 0 $game_map.autoplay endendend#===============================================================================## END OF SCRIPT##===============================================================================I've been editing around lines 74 - 82 almost all day and the best I was able to do was to automatically show the "Continue" file select options on startup (and if you don't have a save file already existing, there's nothing you can do from there of course).

I have also done a lot of searching and cannot find a script of this for VX anywhere, however, I did find a script that does this for VX Ace;

http://www.rpgmakervxace.net/topic/27428-auto-load-skip-title-single-save-system-v1/

Of course, simply switching to Ace isn't an option for me at all considering how far into my game I've gotten, but I have no idea if it's even possible to rewrite the script for VX. In the worst case, I'll just have to make a game without saves or with code saving/loading (like Metriod).
I recommend creating a "Choice menu" then

Simply set up a choice like this in your menu:

Ae4z5hm.png
I recommend creating a "Choice menu" then

Simply set up a choice like this in your menu:

Ae4z5hm.png
I tried this, but in return got this error-

"NameError ocurred while running script.

uninitialized constant Game_Interperter::SceneManager"

Would you mind explaining more on how this should would work or what it exactly means?

I searched around the game interpreter and couldn't find anything this call would be referring to...
Ohh, I'm sorry I read it wrong, Okay, so on the map that you player starts on instead of the Title Screen, create this event:

3Weh1i6.png


What this does is if the player already has a save it will load it (only the first slot). If there is no save it won't do anything.
I tried it, but it also still didn't work, giving a similar error message;

"NameError ocurred while running script.

uninitialized constant Game_Interperter:😀ataManager"

I also tried it with a blank project file to make sure it wasn't some script or eventing causing conflictions, but the error message still came up.

The difference in error this time is "DataManager" rather than "SceneManager" if it's worth noting...
The reason the above didn't work is because it is meant for 'vx ace' whereas you are using 'vx'. It's been a very long time since I have done anything in 'vx' and I currently don't have access to it so I can't make a solution for the system you use atm. 🙁   If no one has worked out a fix for you by tomorrow afternoon I can see if I can work out a solution then.
The reason the above didn't work is because it is meant for 'vx ace' whereas you are using 'vx'. It's been a very long time since I have done anything in 'vx' and I currently don't have access to it so I can't make a solution for the system you use atm. 🙁   If no one has worked out a fix for you by tomorrow afternoon I can see if I can work out a solution then.
I kind of thought that might be the case, but I was hoping it might have been just something I was doing wrong somehow that could easily be fixed... :c

Thank you for your interest on the topic, I appreciate it a lot.

Hey, and if this gets solved, I think I'll let the solver get a free download of my game when it's done!

I want it to be among the best [of RPG Maker].
Hey I worked out a solution for you. 🙂
 
Paste this in your materials section like any other script.

Spoiler
#==============================================================================# ** Load_File#------------------------------------------------------------------------------# This class loads the first save file# note this will only work for Save1.rvdata# # script call in event: Load_File.do_load##==============================================================================class Load_File #-------------------------------------------------------------------------- # * Execute Load #-------------------------------------------------------------------------- def self.do_load if FileTest.exist?("Save1.rvdata") file = File.open("Save1.rvdata", "rb") read_save_data(file) file.close $scene = Scene_Map.new RPG::BGM.fade(1500) Graphics.fadeout(60) Graphics.wait(40) @last_bgm.play @last_bgs.play end end #-------------------------------------------------------------------------- # * Read Save Data # file : file object for reading (opened) #-------------------------------------------------------------------------- def self.read_save_data(file) characters = Marshal.load(file) Graphics.frame_count = Marshal.load(file) @last_bgm = Marshal.load(file) @last_bgs = Marshal.load(file) $game_system = Marshal.load(file) $game_message = Marshal.load(file) $game_switches = Marshal.load(file) $game_variables = Marshal.load(file) $game_self_switches = 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.version_id != $data_system.version_id $game_map.setup($game_map.map_id) $game_player.center($game_player.x, $game_player.y) end endend
Let me know if you encounter any problems or want me to change it some.
I would make a Script for this, but VX does my head in ¬_¬
Hey I worked out a solution for you. 🙂

Paste this in your materials section like any other script.

Spoiler
#==============================================================================# ** Load_File#------------------------------------------------------------------------------# This class loads the first save file# note this will only work for Save1.rvdata# # script call in event: Load_File.do_load##==============================================================================class Load_File #-------------------------------------------------------------------------- # * Execute Load #-------------------------------------------------------------------------- def self.do_load if FileTest.exist?("Save1.rvdata") file = File.open("Save1.rvdata", "rb") read_save_data(file) file.close $scene = Scene_Map.new RPG::BGM.fade(1500) Graphics.fadeout(60) Graphics.wait(40) @last_bgm.play @last_bgs.play end end #-------------------------------------------------------------------------- # * Read Save Data # file : file object for reading (opened) #-------------------------------------------------------------------------- def self.read_save_data(file) characters = Marshal.load(file) Graphics.frame_count = Marshal.load(file) @last_bgm = Marshal.load(file) @last_bgs = Marshal.load(file) $game_system = Marshal.load(file) $game_message = Marshal.load(file) $game_switches = Marshal.load(file) $game_variables = Marshal.load(file) $game_self_switches = 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.version_id != $data_system.version_id $game_map.setup($game_map.map_id) $game_player.center($game_player.x, $game_player.y) end endend
Spoiler
Let me know if you encounter any problems or want me to change it some.
It works great, thank you!

I was having trouble at first with it giving me a bgm related error, but after testing around I figured out it was incompatible with certain parts of BulletXt's "Audio Engine XT" scripts.

Using just the main script of it though and only keeping the parts to continue level music through battle allowed it to work with your script, so there won't be any need to make it compatible any further (as far as I can see).

Although with this script you did it works fine, I probably should have also mentioned (in the case of Yuuta) that I'm not actually saving the player onto an in-game map and don't want to actually load an area of a map, but an updated menu-map instead, since I'm not actually saving the character onto an in-gameplay map (not to say that I was hoping for a script to allow that easily, to be clear I wasn't because then it wouldn't work for the other menu branches I want to have such as two player battle, music room, etc). The player is actually to have their information, coordinates, mapID, etc., stored away and then transported to the title screen, and then the game is saved, which is different from wanting to have a game automatically load a location in gameplay which could have been a much different and likely more commonly assumed. Sorry for not being more specific with that.

http://postimg.org/image/rkw5tycen/

Anyways, the script works great for that, so thanks again. I'll be sure to credit you in its use.
Glad I could help! 🙂 My script loads information in the same way as the default save/load scene (meaning any data you save to the file will get loaded if it is default data: Maps, switches, variables, etc).

Original thread: https://forums.rpgmakerweb.com/threads/automatically-load-first-file.41814/