Quick question about absolute paths

Discussion and help for Easy Save 3
Post Reply
ElChile
Posts: 8
Joined: Thu Jan 07, 2021 2:15 pm

Quick question about absolute paths

Post by ElChile »

Hi Moodkie community!

I'm trying to combine ES3 with unity's user reporting so I get a save file everytime the players submit a report. However, to do this I need to get the absolute file path of the save file regardless of platform (my game is for win, OSX & linux). I found this page in the documentation https://docs.moodkie.com/easy-save-3/es ... ons/#paths which talks about paths, but I'm wondering if using

Application.persistentDataPath + "\"+saveFileName;

would work for all platforms? If not is there a way to automatically get the full path of the current directory?

In advance, thanks!

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

Re: Quick question about absolute paths

Post by Joel »

Hi Rafa,

That would work all platforms except WebGL, which needs to store data to IndexedDB. However, if you use a relative filename when using Easy Save then we manage this for you. For more information please see the Paths section of the Getting Started guide:

https://docs.moodkie.com/easy-save-3/getting-started/

Note that paths outside of the persistent data path are not guaranteed to be writable.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
ElChile
Posts: 8
Joined: Thu Jan 07, 2021 2:15 pm

Re: Quick question about absolute paths

Post by ElChile »

Hi Joel,

Thanks for the quick reply! I am indeed using a relative filename to create/store the save file. In this case, how would you recommend I extract the complete file path? I'm trying to feed it to a System.IO streamreader so I can get all the text inside the save file as a string and send it via email to unity's user reporting dashboard...

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

Re: Quick question about absolute paths

Post by Joel »

Hi there,

You can use ES3.LoadRawString to get a file as a string, and this accepts a relative filename.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
ElChile
Posts: 8
Joined: Thu Jan 07, 2021 2:15 pm

Re: Quick question about absolute paths

Post by ElChile »

That did it! Thanks a bunch Joel! :D
Post Reply