Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can you tell Data usage? [Solved] [closed]

Asked by
dyler3 1510 Moderation Voter
9 years ago

So basically, my question is as stated. How can I tell the amount of data units something takes up? I'm trying to use Data Persistence to save places when players leave my game.

(To check that out to see what my problem is, go here and try to build something that's decent sized, leave, and come back. If you built enough, it shouldn't have saved)

Anyways, I know that I should probably use Data Stores for saving things that are this large, but I just want to make sure that my problem is what I think it is. If anyone could help me, or possibly leave an example script, that'd be awesome. Thanks in advance to whoever may help :P

Locked by Goulstem and Redbullusa

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

1 answer

Log in to vote
1
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
9 years ago

There is no way to actually measure the amount of data units there are in-game


But, the closest thing is using the DataCost member of instances. This can read how much data(in units) will be used while saving with Data Persistence, but it cannot be used in a script or localscript - only through the Command Bar or Plugins.


To get around this, then just use DataStores as they have pretty much unlimited storage and you won't lose data.


But there's a setback while using DataStores to save instances, you cannot directly save Instances through DataStores.. so you're going to have to constuct a lua compiler(make a table inside of the main table for every instance you're saving, this table will include every property of the instance). Then when the player joins, iterate through these tables and create instances according to the saved data.

1
Ok, well that sucks lol. Thanks for the answer, and also giving me a start on how to go about saving an Instance in DataStore. I was trying to figure that out, which was the main reason I didn't want to use Data Store. Anyways, thanks again :P dyler3 1510 — 9y
1
Anytime(: Goulstem 8144 — 9y
Ad