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 » Roblox » I Made That
Home Search
 

Re: Object Converter

Previous Thread :: Next Thread 
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
30 Jun 2014 06:59 PM
Need a CFrame, Vector3, Vector2, BrickColor or Color3 stored as a String for saving to Data Stores or converting to JSON?

Well, I have made a ModuleScript to do so!

All you need to do is require the ModuleScript and use the following functions:

toString(object, type)

Will convert the CFrame/Vector3/Color3/whatever into a string (You have to specify if it is a CFrame, Vector3, Color3 or whatever)

fromString(string)

Will convert the string back into its original state, automatically detecting the type for you!

Furthermore, CFrame values are stored as quaternions to reduce space, and all numbers are stored at up to 16 decimal places to conserve quality (Don't worry, it automatically chops off any trailing zeros!) with the exception of BrickColor and Color3 values, which are stored as integers for space reduction.

Link to model: http://www.roblox.com/Object-Conerter-item?id=164043356

Enjoy your strings!

-Notunknown99
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
30 Jun 2014 07:50 PM
Next version will include conversion of (almost every) instance into a string, although Instance properties (Weld.Part0/InstanceValue.Value/etc) and the source of Scripts will be lost. Scripts will retain their LinkedSource, though.
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
30 Jun 2014 09:56 PM
Now Version 2.0.0:

NEW FEATURES:
Can now convert Strings, Numbers, Booleans, Rays, UDim2s and Instances to and from Strings.
BUGFIXES:
Fixed it generally not working. Sorry about that!

NOTE: It (currently) cannot handle Instance properties, and will leave those blank.

Next up: Increase efficiency of storing Instances (I will create an "Integer" field for properties that can only store integers) and allow for Instance properties (Provided the Instance in question is a Descendant of the main instance)
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
30 Jun 2014 10:16 PM
Version 2.1.0

BUGFIXES:
Made warnings correctly outputted (They are outputted in a lovely orange).
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
30 Jun 2014 10:50 PM
Version 2.2.0

NEW FEATURES:
Can now convert Integers which will not have any decimals. ("integer" instead of "number")
Now removes redundant information when converting instances into strings.
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
01 Jul 2014 01:10 PM
Bump
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Roblox » I Made That
   
 
   
  • 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