Setting up auto-save

Discussion and help for Easy Save 3
Post Reply
Seiryu32
Posts: 25
Joined: Sun Sep 27, 2015 7:45 pm

Setting up auto-save

Post by Seiryu32 »

So I'm really confused about how to set-up Auto-save with ES3. Since there are no direct Playmaker Auto-save actions to save/load scenes with ES3 like it was with ES2 how would I go about creating an Auto-save that ONLY saves and loads only from specific points, i.e, after an event, after beating a level, at the beginning or levels, etc. I would like to be able to load the last saved scene from the main menu but I don't know how to set that up with ES3.
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Setting up auto-save

Post by Joel »

Hi there,

I've pasted below an action which allows you to trigger Auto Save from an action (this will also be included in the next update):
using System;

namespace HuntongGames.Playmaker.Actions
{
	[ActionCategory("Easy Save 3")]
	[Tooltip("Triggers Auto Save's Save method.")]
	public class ES3AutoSaveSave : FsmStateAction
	{
		public override void OnEnter()
		{
			GameObject.Find("Easy Save 3 Manager").GetComponent<ES3AutoSaveMgr>().Save();
		}
	}

	[ActionCategory("Easy Save 3")]
	[Tooltip("Triggers Auto Save's Load method.")]
	public class ES3AutoSaveLoad : FsmStateAction
	{
		public override void OnEnter()
		{
			GameObject.Find("Easy Save 3 Manager").GetComponent<ES3AutoSaveMgr>().Load();
		}
	}
}
Note that this can only be used in the same scene as the data was saved.

If you want to load a specific scene, this is not the purpose of Auto Save. Auto Save saves the contents of the scene, not the scene itself. If you want to save the last visited scene, you would need to use the Save action to save the name of the scene, and then use this to load the scene. Playmaker should have actions to get a scene's name, and to load a scene by name, but as this is controlled at their end you would need to contact them regarding this.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply