Page 1 of 3

Saving and loading a CSV spreadsheet using PlayMaker

Posted: Fri Apr 17, 2020 6:33 pm
by Joel
Saving and loading a CSV spreadsheet using PlayMaker

This example shows how to use the ES3Spreadsheet actions to create a CSV file, and then load data from the CSV file you just saved.

Simply import the scene into a project containing Easy Save 3 and PlayMaker.
SavingLoadingSpreadsheetPlayMakerFSM.PNG
SavingLoadingSpreadsheetPlayMakerFSM.PNG (81.95 KiB) Viewed 11523 times

Re: Saving and loading a CSV spreadsheet using PlayMaker

Posted: Thu Apr 30, 2020 10:41 pm
by TipOfTheDay
I've downloaded this unity package to try out but the scene appears to be empty? This asset is exactly what I need so any tutorials like this would be helpful!

Re: Saving and loading a CSV spreadsheet using PlayMaker

Posted: Fri May 01, 2020 4:06 am
by TipOfTheDay
Sorry to double post! I'm not sure the best forum here to post this question and it's about this exact "saving and loading CSV files into Playmaker" topic! Please forgive me if the answer is so simple and I look really dumb by the end of this. . . I've tried following the image above and get an error at the save and load steps: Specified Cast is not Valid.

I'm using EasySave 3 in a new project, Unity v2019.2.8f1, and basically trying to load up values from a spreadsheet to add into this game.
- I've setup the same states as the above tutorial with the same actions suggested beneath each state
- This get fuzzy for me when I need to specify the file path. I try putting C:\examplepath\test.csv. . . but this fails. The I leave the full path name out and just use test.csv thinking maybe the Persistent Data Path will automatically apply as the path? That fails too like in the screenshot I'm attaching here. I've also tried typing the full file path out and doing a Set String in Playmaker first and passing the Set String variable, just to try. I still get the same error?

No matter which way I try to setup a path, I keep getting a Specified Cast is not Valid error. I feel like this is probably something super simple and I'm just not recognizing it. Any help would be greatly appreciated! Once I can finally save/load to a CSV file, SOOOO much opens up in-game!

Thanks for the help!
Peter V.

Re: Saving and loading a CSV spreadsheet using PlayMaker

Posted: Fri May 01, 2020 7:55 am
by Joel
Hi there,

With regards to the test scene being empty, there won't be anything visible in the viewport because it's just demonstrating how to use ES3Spreadsheet. However, if you click the Fsm GameObject you will be able to view the FSM in the PlayMaker Editor. You will also want to make sure you've opened the example scene; it will be located in Assets/Easy Save 3/Examples.

It looks like you're not using the latest version of the PlayMaker action as the 'ES3Spreadsheet' field seems to be missing from your Save action. If you private message me your invoice number I'll be happy to send over the latest version, just in case the Asset Store is not updating the ES3PlayMaker.cs file for you.

All the best,
Joel

Re: Saving and loading a CSV spreadsheet using PlayMaker

Posted: Wed May 06, 2020 10:45 pm
by ferfrogger
Hello, I am currently having problems with the spreadsheet example.
Apparently there is a problem related to the action "ES3 Spreadsheet Get Cell", since I did my own procedure and the wrong result is the same. The rest of actions work correctly.
The .csv file was created correctly on the persistent path.

I am using Unity 2019.3.11f1, Playmaker 1.9.0 and Easy Save 3.3.0 (currently the latest version)

Could you check it out please?

Thank you

Re: Saving and loading a CSV spreadsheet using PlayMaker

Posted: Thu May 07, 2020 6:37 am
by Joel
ferfrogger wrote:Hello, I am currently having problems with the spreadsheet example.
Apparently there is a problem related to the action "ES3 Spreadsheet Get Cell", since I did my own procedure and the wrong result is the same. The rest of actions work correctly.
The .csv file was created correctly on the persistent path.

I am using Unity 2019.3.11f1, Playmaker 1.9.0 and Easy Save 3.3.0 (currently the latest version)

Could you check it out please?

Thank you
Hi there,

Thanks for the detailed information, I've managed to replicate this. It looks like there's an edge case we didn't account for, but it's an easy fix at our end. I'll private message you an update to resolve this.

All the best,
Joel

Re: Saving and loading a CSV spreadsheet using PlayMaker

Posted: Sun Nov 07, 2021 5:49 am
by 4d.printer
Hi Moodkie,

I am trying to import data from my own CSV (exported from google sheets) using the ES3 actions.
I'm looking at your example package attached and when I look at the CSV it creates, each entry looks something like this:

"{
""__type"" : ""int""1
}",

Is there no way to just have the CSV be a value/string with a comma delimiter? (Must there be brackets and the type specified before the value?)

Otherwise I am hard pressed on how to use a normal CSV exported from google sheets without manually editing each entry to include the other characters. Would you agree that this is a difficult thing to do using this tool? Or is there a workaround I am not considering?

Thanks -A

Re: Saving and loading a CSV spreadsheet using PlayMaker

Posted: Sun Nov 07, 2021 8:40 am
by Joel
Hi there,

I've managed to replicate this, and it seems like PlayMaker is using Object as the type rather than the individual type of the variable.

If you private message me your invoice number I'll send over an update which resolves this.

All the best,
Joel

Re: Saving and loading a CSV spreadsheet using PlayMaker

Posted: Mon Jan 17, 2022 2:52 pm
by Zandan
Hello, I posted in the general forum, but I see there is an example here which works.
Could I please ask do we need to use ES3 Spreadsheet create action every single time we launch or once created it's there as variable?

Re: Saving and loading a CSV spreadsheet using PlayMaker

Posted: Mon Jan 17, 2022 7:57 pm
by Joel
Hi there,

You only need to create one, and you can keep adding to it and store it multiple times.

All the best,
Joel