Some question (playmaker)

Easy Save 2 has been replaced by Easy Save 3, so is no longer supported.
User avatar
Joel
Moodkie Staff
Posts: 4846
Joined: Wed Nov 07, 2012 10:32 pm

Re: Some question (playmaker)

Post by Joel »

Hi there,

Would you be able to send me the file with the Chinese signs? And also the one which is asking for encryption again? The one you sent me definitely does not ask for a password.

Also if you're not using the latest version of Easy Save, please try updating incase that is causing the issue.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
gozda
Posts: 45
Joined: Wed Jun 24, 2015 3:14 pm

Re: Some question (playmaker)

Post by gozda »

This file what i got these chinesse signs is that file what i send to you, also this file in one project i can read in other. But this file was not saved using encryption. He was working all time right, but i dont know why he changed to this signs.

I will try to update ES.

Thanks for help
User avatar
Joel
Moodkie Staff
Posts: 4846
Joined: Wed Nov 07, 2012 10:32 pm

Re: Some question (playmaker)

Post by Joel »

Hi there,

That confirms that the reason it shows up as Chinese signs is because the text editor you're opening it with is trying to apply an encoding with it. Even though it shows up as Chinese signs, it will still be in Easy Save's format (as long as you don't save the file in text editor you are using).

If the data was corrupt you would receive an error. Please check the Playmaker Log and the Unity Log to see if you get an error. If not, it is more likely an error with how you've organised your FSM. If you can provide me with a project which reproduces this, and detailed instructions on how to replicate the issue, I can try to take a look at it. However, I can only give limited assistance with regards to specific implementations.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
gozda
Posts: 45
Joined: Wed Jun 24, 2015 3:14 pm

Re: Some question (playmaker)

Post by gozda »

Thanks for big support, but for a moment i will stay with this what i have. I will try to update and check if that will happend again.
gozda
Posts: 45
Joined: Wed Jun 24, 2015 3:14 pm

Re: Some question (playmaker)

Post by gozda »

Hello,

There is possible to save in file game object with all childs in hierarchy?
I want to do something like save all objects with childs to file, upload this file, and download it in to other unity project. its possible or will be possible? or is there any other way to do something like this?

Cheers
Gozda
User avatar
Joel
Moodkie Staff
Posts: 4846
Joined: Wed Nov 07, 2012 10:32 pm

Re: Some question (playmaker)

Post by Joel »

Hi there,

Unfortunately there would be no way to do this with Playmaker, as you would need to generate and maintain your own list of references (in particular to the Transforms of objects you wish to be parents). There's an example of doing this with code in the following link, but I wouldn't advise tackling such a project without experience of coding: http://moodkie.com/forum/viewtopic.php?f=4&t=522

Easy Save 3, which will be a free update to existing users and enter beta in the coming weeks, will have tools to make this easier however.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
gozda
Posts: 45
Joined: Wed Jun 24, 2015 3:14 pm

Re: Some question (playmaker)

Post by gozda »

Hello,

I am searching a way to get a variable type, before i will load it. It is possible using playmaker?

In practice i want to get list of all variable in file ("get tag" action) and check what is that, bool, float, int.... when i will know what is that i will use proper action for load.

Cheers,
Gozda
User avatar
Joel
Moodkie Staff
Posts: 4846
Joined: Wed Nov 07, 2012 10:32 pm

Re: Some question (playmaker)

Post by Joel »

Hi there,

Unfortunately PlayMaker doesn't provide us with a way of doing this as it doesn't provide a variable which can hold System.Objects or System.Types.

An alternative is simply to save to a different tag depending on the type of the data. i.e. "myTagVector3", "myTagTransform", "myTagInt", etc.

And then you can use the Exists action to check whether the tag exists.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
gozda
Posts: 45
Joined: Wed Jun 24, 2015 3:14 pm

Re: Some question (playmaker)

Post by gozda »

This will take me a days to change naming of all variable what project can generate. I was thinking this will be simple action named "Check Type"(or something) and for result will give me a simple string "Int,float,color..." or event but if its not possible... also I was trying to use a error event in load actions for auto-recotnizer of data type, but this dont work. Now i need to create my own system for variable naming with coded type.

But thanks :)

Cheers,
Gozda
User avatar
Joel
Moodkie Staff
Posts: 4846
Joined: Wed Nov 07, 2012 10:32 pm

Re: Some question (playmaker)

Post by Joel »

If you just want the type name as a string, this action should work:
using System;
using UnityEngine;
using System.Collections.Generic;

namespace HutongGames.PlayMaker.Actions
{
	[ActionCategory("Easy Save 2")]
	public class GetTagType : ES2LoadAction
	{
		[RequiredField]
		[Tooltip("The string we want to store the type string in.")]
		public FsmString loadValue;

		public override void Reset()
		{
			loadValue = null;
			base.Reset (); // Ensure that base.Reset() is called when done.
		}

		public override void OnEnter()
		{
			try
			{
				loadValue.Value = ES2.LoadObject(filename.Value, GetSettings(new ES2Settings())).GetType().Name;
				base.OnEnter(); // Ensure that base.OnEnter() is called when done.
			}
			catch(System.Exception e)
			{
				if(ifError != null)
				{
					LogError(e.Message);
					Fsm.Event(ifError);
				}
			}
		}
	}
}
Note that it will return the Class name, which is the equivalent to calling the System.Type.Name property. So for example, instead of int it will return Int32.

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