generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Loading a model from DataStore

Previous Thread :: Next Thread 
robokittydestroyer is not online. robokittydestroyer
Joined: 20 Jul 2010
Total Posts: 311
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
robokittydestroyer is not online. robokittydestroyer
Joined: 20 Jul 2010
Total Posts: 311
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 is not online. 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
robokittydestroyer is not online. robokittydestroyer
Joined: 20 Jul 2010
Total Posts: 311
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
robokittydestroyer is not online. robokittydestroyer
Joined: 20 Jul 2010
Total Posts: 311
04 Jul 2014 12:16 PM
b1
Report Abuse
robokittydestroyer is not online. robokittydestroyer
Joined: 20 Jul 2010
Total Posts: 311
04 Jul 2014 12:45 PM
b2
Report Abuse
robokittydestroyer is not online. robokittydestroyer
Joined: 20 Jul 2010
Total Posts: 311
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
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
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
robokittydestroyer is not online. robokittydestroyer
Joined: 20 Jul 2010
Total Posts: 311
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
robokittydestroyer is not online. robokittydestroyer
Joined: 20 Jul 2010
Total Posts: 311
04 Jul 2014 01:40 PM
b3
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
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
robokittydestroyer is not online. robokittydestroyer
Joined: 20 Jul 2010
Total Posts: 311
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
robokittydestroyer is not online. robokittydestroyer
Joined: 20 Jul 2010
Total Posts: 311
04 Jul 2014 02:29 PM
b4
Report Abuse
robokittydestroyer is not online. robokittydestroyer
Joined: 20 Jul 2010
Total Posts: 311
04 Jul 2014 02:53 PM
b5
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
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
robokittydestroyer is not online. robokittydestroyer
Joined: 20 Jul 2010
Total Posts: 311
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image