ES3 & PlayMaker

Discussion and help for Easy Save 3
Post Reply
User avatar
Gustav
Posts: 9
Joined: Sat May 06, 2017 8:57 am

ES3 & PlayMaker

Post by Gustav »

Hi,

at first I want to say thank you, the new PlayMaker actions are a fantastic improvement!

I found a few issues you may be aware of because ES3 is still in beta. But I will write down everything I came across. Just in case. :)
  • Some help buttons of actions point to the Hutong Games website instead of the ES3 help page (e.g. "ES3 File Clear" and "ES3 File Get Keys"). (I didn't check all actions.)
  • The help button of action "Save" and "Get Directories" points to the ES3 help page of "ES3Settings Class".
  • The description of "ES3 File Clear" is the description from "ES3 File Get Keys".
  • I noticed that some actions allow to toggle between an input field and a variable drop down menue for an output value of the current action. For example the action "File Exists" - it allows to check the value of the result bool. Is this intended? I never seen this before in standard PlayMaker actions. For example the "Store Result" part of many standard actions as in "Bool All True". It's only possible to choose a bool variable there. If there is no special reason for this it's maybe better to stick with the PlayMaker standard "Store Result".
  • Is there an use for "Override Default Settings" in the action "File Exists"?
  • I would like to suggest a new action. If I want to know how many keys are saved in the (ES3)file, I need to use the action "ES3 File Get Keys" to create an array containing all key names. After that I need to get the length of that array to get the count of keys. In this case maybe it would be more efficient to have an action to get the key count directly.
  • There is a mistake on the ES3File Sync Action help page which took me (as a non-native english speaker) a lot of time to understand the behavior of this action. I believe it should mean "If Sync With File was set to false when creating the ES3File, [...]". I think because of the negative wording of the sentence before ("Unless the Sync With File parameter was set to false when creating the ES3File, [...]") it can get a little confusing, at least for non-native english speakers.
Best regards
Gustav
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: ES3 & PlayMaker

Post by Joel »

Hi Gustav,

Thanks for the detailed information, much appreciated.

I think you may be using an older version of the Playmaker actions as we don't specify a URL for the help buttons in the latter versions of the actions. If you want me to send you the latest version of the Playmaker actions, send me a PM and I'll send them right over.

With regards to being able to select a dropdown for the variable, this is a standard Playmaker variable field. However, this can come in quite useful. For example, in File Exists sometimes it's useful to simply see the result for debugging reasons, or it's useful to store the result into a variable for use by a later part of your FSM.

There are cases where Override Default Settings is useful in File Exists, for example if the user is not using the default save location.

Thanks for noticing the error in the ES3File Sync Action, I've just corrected it now.

We've not had a request for a method/action which counts the keys in a file before, so I won't be able to add it as a documented part of our functionality. However, I've created below a Get Key Count action for your which does this:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using HutongGames.PlayMaker.Actions;
using HutongGames.PlayMaker;
using Tooltip = HutongGames.PlayMaker.TooltipAttribute;

namespace ES3PlayMaker
{
	[ActionCategory("Easy Save 3")]
	[Tooltip("Gets an array of key names from a file.")]
	public class GetKeyCount : SettingsAction
	{
		[Tooltip("The relative or absolute path of the file we want to count the keys of.")]
		public FsmString filePath;
		[Tooltip("The int variable we want to load our count into.")]
		public FsmInt keyCount;

		public override void OnReset()
		{
			filePath = "SaveFile.es3";
			keyCount = null;
		}

		public override void Enter()
		{
			keyCount.Value = ES3.GetKeys(filePath.Value, GetSettings()).Length;
		}
	}
}
All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
lukew
Posts: 1
Joined: Fri Jun 22, 2018 10:28 am

Re: ES3 & PlayMaker

Post by lukew »

Hi,

Instead of creating a new topic I think that It would be ok to post a related question here.

Are there any plans for update for Playmaker array type? I'm using latest version of ES3 and I'm getting this error when selecting array type for Save/Load actions.

"System.ArrayTypeMismatchException: Unknown FsmArray Type: Use ArrayEditorAttribute to specify a VariableType.

BTW. As this is my first post I would just like to add that ES is a great tool. Good job!
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: ES3 & PlayMaker

Post by Joel »

Hi there,

Thanks for the praise, much appreciated!

We're currently working on the fix for this, and it will be available in the next update.

In the meantime I've attached a custom action below which saves Int Arrays. It can also be modified to save the different types of arrays by replacing the int and Int with the type of array you wish to save (for example to make it work with float arrays, replace int with float and Int with Float.

All the best,
Joel
Attachments
ES3SaveLoadIntArrayActions.cs
(1.63 KiB) Downloaded 247 times
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply