Page 1 of 1

Quick question about absolute paths

Posted: Thu Jun 10, 2021 3:06 pm
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

Re: Quick question about absolute paths

Posted: Thu Jun 10, 2021 3:11 pm
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

Re: Quick question about absolute paths

Posted: Thu Jun 10, 2021 8:18 pm
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

Re: Quick question about absolute paths

Posted: Thu Jun 10, 2021 8:27 pm
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

Re: Quick question about absolute paths

Posted: Fri Jun 11, 2021 12:25 am
by ElChile
That did it! Thanks a bunch Joel! :D