how to change default file path at runtime?

Discussion and help for Easy Save 3
Post Reply
wethecom
Posts: 12
Joined: Sun Aug 16, 2015 7:39 pm

how to change default file path at runtime?

Post by wethecom »

how to change default file path at runtime?
anyone have a clue?
i need to change it from defualt.dat to someusername.dat
anyone have a clue how this is done




var settings = new ES3Settings();
// Change the save location to PlayerPrefs.
settings.path = "UserName.dat";


im confused because of the use of the words ,path ,directory and the word file.. i want to change this at runtime the "default file Path" the name of the file to be stored.. i may have to rewrite all the code to use a varable for file paths but its just seems like you should be able to change this easily
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: how to change default file path at runtime?

Post by Joel »

Hi there,

Defaults are initialised when the scene loads, so it's not possible to change them at runtime.

However, you can create your own static variable containing an ES3Settings object and use this as your default settings. Then you just need to provide this ES3Settings object as the settings parameter whenever you call an Easy Save method.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
wethecom
Posts: 12
Joined: Sun Aug 16, 2015 7:39 pm

Re: how to change default file path at runtime?

Post by wethecom »

thank you that seem to work well.. i didnt understand the power of those settings..
Post Reply