Page 2 of 4

Re: Use Easy Save to download a mp4 file from WWW

Posted: Wed May 10, 2017 12:21 pm
by PET
Ah ok. Just wanted to see if you somehow integrated a Split String during your Playmaker Actions.

Thanks for the info!

Re: Use Easy Save to download a mp4 file from WWW

Posted: Wed May 10, 2017 1:11 pm
by PET
Image

Ughhh yeaaaa... so at least now I have the FILE NAME. This fileName I will have to give to the Downloader... but also to check if the file exists.

Sometimes things aligh... and it's so beautiful. :D

Re: Use Easy Save to download a mp4 file from WWW

Posted: Wed May 10, 2017 1:20 pm
by Joel
Glad you managed to work out something which works for you. Especially love the idea of reversing the array so you don't need to get the length of the array to find out the index of the last item :D

- Joel

Re: Use Easy Save to download a mp4 file from WWW

Posted: Wed May 10, 2017 1:29 pm
by PET
Joel wrote:Glad you managed to work out something which works for you. Especially love the idea of reversing the array so you don't need to get the length of the array to find out the index of the last item :D

- Joel
Exactly. The thing with Playmaker, since it's State based ... you can't have a nice flow. So a lot of the times you need to store the info into variables, so you can access them into a next state.. but those variables are temporary, so they can easily clog your Variables Window. I would have probably had to store the ArraySize into a variable, then maybe substract that number to something something... you get the idea.

I wanted to dinamically Instantiate the buttons. I can do it let's say at 0, 0, 0. The problem is that the next button has to be at 0, 1, 0 so... store this in a variable, access it, Add to it, etc. Get's annyoing.

For example with FlowCanvas I can access info without storing the info in a variable... because that is Flow Based.

Re: Use Easy Save to download a mp4 file from WWW

Posted: Wed May 10, 2017 1:52 pm
by Joel
I understand what you mean. I once tried to validate an email field using purely Playmaker actions, before Playmaker supported arrays, and I ended up biting the bullet and creating a custom action in code. I'll have to take a look at FlowCanvas, sounds really powerful.

Re: Use Easy Save to download a mp4 file from WWW

Posted: Wed May 10, 2017 2:03 pm
by PET
Joel wrote:I understand what you mean. I once tried to validate an email field using purely Playmaker actions, before Playmaker supported arrays, and I ended up biting the bullet and creating a custom action in code. I'll have to take a look at FlowCanvas, sounds really powerful.
FlowCanvas is that plugin we talked about last year, to make an integration with EasySave.

Re: Use Easy Save to download a mp4 file from WWW

Posted: Wed May 10, 2017 2:34 pm
by Joel
Ahh yes, I remember now. For some reason I thought that was uScript. Unity users are too spoilt for choice when it comes to visual scripting these days :D

In the likely case that someone searches the forums for FlowCanvas nodes and comes across this thread, Nuverian have made their own FlowCanvas nodes and NodeCanvas nodes.

Re: Use Easy Save to download a mp4 file from WWW

Posted: Fri May 12, 2017 1:52 pm
by PET
Hmm... te current Exists action is like this:
Image

I'm thinking. Could you make it so if the file exists, to set a BOOL to true?
I would like if possible to do this from inside the action and not create another special state for this.

Right now I want to do a checkup in 2 places.
To see if the file is in the App folder but also on the SD card.

My theory was to make a bool for each o the checkup and then compare the 2 bools. If one of them is TRUE then I'm "all goooood 8-) "

Re: Use Easy Save to download a mp4 file from WWW

Posted: Fri May 12, 2017 2:10 pm
by Joel
Hi there,

I've made a quick action to do this for you. As always, as it's not an official piece of functionality it's provided without warranty.
namespace HutongGames.PlayMaker.Actions
{
	[ActionCategory("Easy Save 2")]
	[Tooltip("Checks if data exists at the specified path and loads the result into a bool.")]
	public class ExistsIntoBool : FsmStateAction
	{
		[Tooltip("Whether the file exists.")]
		public FsmBool exists = false;
		public FsmEvent ifError = null;
		[Tooltip("The tag that we want to check for (Optional).")]
		public FsmString tag = "";
		[RequiredField]
		[Tooltip("The file we want to check the existence of.")]
		public FsmString filename = "defaultFile.txt";

		public override void Reset()
		{
			exists = false;
			tag = "";
			filename = "defaultFile.txt";
		}

		public override void OnEnter()
		{
			ES2Settings settings = new ES2Settings();

			if(tag.Value != "")
				settings.tag = tag.Value;

			Log("Checked existence of "+filename);

			try
			{
				exists.Value = ES2.Exists(filename.Value, settings);
			}
			catch(System.Exception e)
			{
				if(ifError != null)
				{
					LogError(e.Message);
					Fsm.Event(ifError);
				}
			}
			Finish();
		}
	}
}
All the best,
Joel

Re: Use Easy Save to download a mp4 file from WWW

Posted: Fri May 12, 2017 2:21 pm
by PET
All right! Thanks!

Right now it looks like this:
Image

Let me see how it will look when I will simplify it :D