Posting a day early to help a buddy out! Reddit user again_faster has created a really neat save system for his RPG Maker game. The “Save” function has been replaced with “Camp,” and it brings the player to a camp where they can, among other things, heal at a well and sleep in a tent. It’s a nice touch reminiscent of Dragon Age’s system which gives a pause in frenetic game play, and I think it might have lots of great story-telling implications. Check it out here:
Again_faster would loveit so that, when you load the game, you start off where you entered camp, on the overworld, not in your camp. He’s already storing the Map ID, X, and Y in variables. He has to, to handle the return transfer event. This will be a nice quality of life change for the player, and can be done with two lines of code.
1) Go to the DataManager module and find the area called “Extract Save Contents”. It looks something like this:
This function gets called only on load, and is responsible for taking what’s in your save file and assigning it back to variables. So it finds the player, puts it in $game_player, does the same with switches and timers and all that jazz. It’s called only once on load, so it’s the perfect place to put our script.
2) Setup the correct map. In that function, add
where M is the variable you’re storing the map ID. This will overwrite the engine’s inclination to load the map you saved on, instead loading a map by it’s ID. If you always wanted to default to a specific map, you could easily use $game_map.setup(3), to always load map 3, instead.
3) Move the player. We’ve set up the map, but our player is in the void now. We need to call .moveto, which is like a transfer event except automatic – none of that fading in and out nonsense. Specifically:
Where X and Y are the variables you’re storing the respective return coordinates. This will automatically teleport the player to those coordinates on the currently loaded map – the one you’ve chosen.
All said, you’ll have something that looks like this. The numbers chosen for the variables are just made up – make sure to use the correct ones for you!
Hope you’ve got a s’mores item, again_faster!