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 » Scripters
Home Search
 

So here's a complicated question concerning Data Stores.

Previous Thread :: Next Thread 
StaySpy is not online. StaySpy
Joined: 04 Jan 2009
Total Posts: 2311
20 Oct 2016 05:07 PM
I'm writing a code that saves an instance with Data Store, and basically, the table that is to be saved looks like this:

table = {
part(Name) = { -- every part name is 4-5 characters long
part[1](Relevant Info) -- is a string, contains 12 characters
{X, Y, Z}(Position)
{X, Y, Z}(Rotation)
{X, Y, Z}(Size)
}
}

So, we know that Data Stores can store up to 256 kibibytes(262144 bytes) per instance. My question here is, how many bytes would it take for one part and/or the table? I'm trying to figure out how many parts can be saved at once.
Report Abuse
StaySpy is not online. StaySpy
Joined: 04 Jan 2009
Total Posts: 2311
20 Oct 2016 05:09 PM
Or if you can figure out a way to reduce the size for each part, that would be great.
Report Abuse
Wowgnomes is online. Wowgnomes
Joined: 27 Sep 2009
Total Posts: 26255
20 Oct 2016 05:15 PM
use http service convert to json save json then convert back


Report Abuse
StaySpy is not online. StaySpy
Joined: 04 Jan 2009
Total Posts: 2311
20 Oct 2016 05:16 PM
Whoa wait what

I didn't get any of that. More in-depth please?
Report Abuse
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
20 Oct 2016 05:18 PM
the maximum length of the JSON data is 2^18 characters
Report Abuse
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
20 Oct 2016 05:19 PM
print(string.len( httpservice:JSONEncode(table) ) )
Report Abuse
StaySpy is not online. StaySpy
Joined: 04 Jan 2009
Total Posts: 2311
20 Oct 2016 05:20 PM
Yeah, that is 262144 characters/bytes. Figured that out, thanks tho
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
20 Oct 2016 05:30 PM
Store the CFrame, not the Position and Rotation.
Report Abuse
StaySpy is not online. StaySpy
Joined: 04 Jan 2009
Total Posts: 2311
20 Oct 2016 05:39 PM
Aggressive, thanks a lot. This helps.

^ Can you actually store CFrame values using Data Stores? Either way, I'll end up storing the 6 values(3vel, 3rot).
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
20 Oct 2016 05:42 PM
CFrames consist of 12 values, 3 for position 9 for rotation.

http://wiki.roblox.com/index.php?title=CFrame#components
Report Abuse
Crimsonal is not online. Crimsonal
Joined: 23 Apr 2011
Total Posts: 1795
20 Oct 2016 05:45 PM
https://www.roblox.com/library/517716505/SaveInstance-BETA-RELEASE
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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