|
| 03 Jul 2014 09:03 PM |
I want to load a model from DataStore that I've stored encoded in JSON, but do not know how to retrieve the encoded string. Is there any way to do this? I am doing this in a server script.
|
|
|
| Report Abuse |
|
|
|
| 03 Jul 2014 09:18 PM |
| Would calling :GetChildren() and then storing the returned table when saving, then loading the table using UpdateAsync to load the table work? |
|
|
| Report Abuse |
|
|
mu6666mu
|
  |
| Joined: 09 Apr 2012 |
| Total Posts: 952 |
|
|
| 03 Jul 2014 09:20 PM |
Data:GetAsync(NameOfStoredValue)
--The next statement is true. The previous statement is false-- |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2014 10:03 PM |
| I want to avoid using GetAsync, as players may want to save two different models within the 10 second cache period, causing them to lose the newer model. I'm looking for how to do this using the UpdateAsync method, if possible. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 04 Jul 2014 12:59 PM |
| I just want to know if it's possible to load a model using the UpdateAsync method and if so, how? |
|
|
| Report Abuse |
|
|
|
| 04 Jul 2014 01:01 PM |
| You cannot load models under any circumstances unless you have the model preloaded in the game and have the name of the model set in datastore. Either that or the model id. |
|
|
| Report Abuse |
|
|
|
| 04 Jul 2014 01:04 PM |
| I'm saving the model as a table of it's children. I am not able to load the model by id, as the models are user-created in-game and cannot be assigned an asset id. |
|
|
| Report Abuse |
|
|
| |
|
|
| 04 Jul 2014 01:46 PM |
| Use DataPersistance :SaveModel then or create your own brick loader(creates objects based off the information it is given). |
|
|
| Report Abuse |
|
|
|
| 04 Jul 2014 02:07 PM |
| It's :SaveInstance, not :SaveModel. I'm not going to use DataPersistence due to the data loss a couple weeks ago and I've never had any luck with the :SaveInstance method. I believe what I may be trying to make would be a brick loader. I am still unsure on how to load the model's data into the game. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 04 Jul 2014 03:04 PM |
REALLY INEFFICIENT WAY:
make a list of all the properties of every type of object you will be using, save each of these and upload to datastore, if something is a child of an object, just make it a table.(sorry such a bad teacher)
for example, ds:setasync(plr.userId, model = { Name = "", ["brick1"] = {} })
|
|
|
| Report Abuse |
|
|
|
| 04 Jul 2014 03:11 PM |
| I guess I'll have to use GetAsync along with a debounce, to prevent data loss, for loading and iterate through the table to add the parts to the game. Thanks anyways for those who tried to help. |
|
|
| Report Abuse |
|
|