Saving and loading a CSV spreadsheet using PlayMaker

Examples using PlayMaker. Note that to view these examples, you will need to have purchased PlayMaker.
User avatar
Joel
Moodkie Staff
Posts: 5037
Joined: Wed Nov 07, 2012 10:32 pm

Saving and loading a CSV spreadsheet using PlayMaker

Post 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 18506 times
Attachments
Saving and loading a CSV spreadsheet using PlayMaker.unitypackage
(17.38 KiB) Downloaded 1130 times
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
TipOfTheDay
Posts: 14
Joined: Thu Apr 30, 2020 10:39 pm

Re: Saving and loading a CSV spreadsheet using PlayMaker

Post 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!
TipOfTheDay
Posts: 14
Joined: Thu Apr 30, 2020 10:39 pm

Re: Saving and loading a CSV spreadsheet using PlayMaker

Post 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.
Attachments
ES3 troubleshooting save<br />load to CSV
ES3 troubleshooting save
load to CSV
ES3_issue.png (169.18 KiB) Viewed 18489 times
User avatar
Joel
Moodkie Staff
Posts: 5037
Joined: Wed Nov 07, 2012 10:32 pm

Re: Saving and loading a CSV spreadsheet using PlayMaker

Post 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
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
ferfrogger
Posts: 2
Joined: Wed May 06, 2020 8:21 pm

Re: Saving and loading a CSV spreadsheet using PlayMaker

Post 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
Attachments
Screenshot_7.png
Screenshot_7.png (6.64 KiB) Viewed 18408 times
Screenshot_6.png
Screenshot_6.png (162.5 KiB) Viewed 18408 times
User avatar
Joel
Moodkie Staff
Posts: 5037
Joined: Wed Nov 07, 2012 10:32 pm

Re: Saving and loading a CSV spreadsheet using PlayMaker

Post 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
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
4d.printer
Posts: 1
Joined: Sat Nov 06, 2021 9:52 pm

Re: Saving and loading a CSV spreadsheet using PlayMaker

Post 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
User avatar
Joel
Moodkie Staff
Posts: 5037
Joined: Wed Nov 07, 2012 10:32 pm

Re: Saving and loading a CSV spreadsheet using PlayMaker

Post 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
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Zandan
Posts: 7
Joined: Sun Jun 29, 2014 9:19 am

Re: Saving and loading a CSV spreadsheet using PlayMaker

Post 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?
User avatar
Joel
Moodkie Staff
Posts: 5037
Joined: Wed Nov 07, 2012 10:32 pm

Re: Saving and loading a CSV spreadsheet using PlayMaker

Post 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
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply