misterhup
|
  |
| Joined: 07 Jul 2010 |
| Total Posts: 280 |
|
|
| 18 Jun 2017 01:37 PM |
So, I used mainly data persistence in the past for saving models. But now that there is a new way to save data, I was wondering if it possible to save a model with data store. I managed to save values and such, but I dont really know how to hande models. If anyone could give me an example, or even just point me in the right direction, as the wiki doesnt cover more advanced uses of the data store feature, that would be amazing. Thanks in advance! |
|
|
| Report Abuse |
|
|
cabbler
|
  |
| Joined: 19 Jun 2015 |
| Total Posts: 735 |
|
|
| 18 Jun 2017 02:06 PM |
| Data store can't save instances. You have to save a dictionary of its properties, which is what instances really are anyway. Use persistence if you are lazy. |
|
|
| Report Abuse |
|
|
ParaText
|
  |
| Joined: 15 Aug 2016 |
| Total Posts: 799 |
|
|
| 18 Jun 2017 02:14 PM |
And use sub tables for each class property, CFrame, Size, Position, BrickColor, etc
|
|
|
| Report Abuse |
|
|
|
| 18 Jun 2017 02:26 PM |
"Use persistence if you are lazy."
no, use persistence if you're dumb
never use persistence, just go through the pain of serializing models
keep in mind you might not even need to do that. if you're just using prefabs or something you can store basic things like colors, rotation, etc, and then load the model needed with those properties. |
|
|
| Report Abuse |
|
|
misterhup
|
  |
| Joined: 07 Jul 2010 |
| Total Posts: 280 |
|
|
| 18 Jun 2017 03:58 PM |
| I'm afraid that is close to impossible. My models contain all sort off stuff, from vector3 objects, to intValues, booleans, parts, meshes. And the thing is, everything is dynamic, and I can't tell what objects will be inside, as the contents of the model which has to be saved depend entirely on the player. So yeah, back to the persistance. Used it before in the past, never really had any problems with it, but I was gone for a while and I am unfamiliar with the updates the ROBLOX made, so if anyone can tell what are the main issues with persistance data besides occasionally data loss (from what I read on the forum) and the fact that its old. I mean, can it cause any problems to the player? |
|
|
| Report Abuse |
|
|
cabbler
|
  |
| Joined: 19 Jun 2015 |
| Total Posts: 735 |
|
|
| 18 Jun 2017 07:19 PM |
| It's not inherently bad but outdated that's what deprecated means. Honestly if this is so complex you can't save in data store you should rethink your data structure. |
|
|
| Report Abuse |
|
|
misterhup
|
  |
| Joined: 07 Jul 2010 |
| Total Posts: 280 |
|
|
| 23 Jun 2017 07:39 AM |
I managed to do it. I went trough all the elements of the model, created a table with all the properties I need, etc then made a function to load them. After that, all I had to do was structure the model in more tables as saving everything in one table gave me a memory error, but now everything works just fine.
@cabbler I actually found one of your old model to table things, and followed that pattern and made one that works kinda the same way, but using data store. But your script, helped me a whole lot! I used the way you stored the properties of each object and saved me a lot of time! Thanks!
I will try to structure my code a little bit, and soon enough, ill try to post here how I managed to save a model with data store as there are not many examples about this topic on the forum atm. |
|
|
| Report Abuse |
|
|
Snow_Dude
|
  |
| Joined: 11 Jun 2016 |
| Total Posts: 713 |
|
|
| 23 Jun 2017 07:45 AM |
| Look the tutorial by SpooksHD |
|
|
| Report Abuse |
|
|
cabbler
|
  |
| Joined: 19 Jun 2015 |
| Total Posts: 735 |
|
|
| 24 Jun 2017 12:08 PM |
| Well gj misterhup. My script is overly complicated because I wanted to retain hierarchy, which it does well. You don't have to do it |
|
|
| Report Abuse |
|
|
cabbler
|
  |
| Joined: 19 Jun 2015 |
| Total Posts: 735 |
|
|
| 25 Jun 2017 12:26 AM |
| @misterhup I've just updated that model to be way way better and since you recently use it, I think you should know! |
|
|
| Report Abuse |
|
|
misterhup
|
  |
| Joined: 07 Jul 2010 |
| Total Posts: 280 |
|
|
| 25 Jun 2017 02:24 AM |
| @cabbler Thanks a lot! I'll definitely check it out! The faster, the better! |
|
|
| Report Abuse |
|
|
|
| 05 Jul 2017 03:32 PM |
| @Cabbler I Need Some Help. If You Have Any Dive/And Catch Animations Just Let Me Know. Thanks! |
|
|
| Report Abuse |
|
|
Glistre
|
  |
| Joined: 20 May 2016 |
| Total Posts: 14 |
|
|
| 18 Aug 2017 08:20 PM |
| Would you possibly share with me an example of how to do this? I would like to save models purchased in my tycoon |
|
|
| Report Abuse |
|
|