Saving model positions on a baseplate

Hello!

I’m working on a sandbox tycoon model where players can build their base and I want that base to save as well. I was wondering what might be the most efficient way to do so. Usually I get the get the position relative to the baseplate by subtraction, which is all good and works, but sometimes I get floating point errors in those values and they take up a lot of data characters. I’ve tried converting a rounded value to a string and then back to a number when loading the base but that solution just seems stupid.

Any ideas are appreciated!

1 Like

Check out :toObjectSpace and :toWorldSpace
http://wiki.roblox.com/index.php?title=CFrame#Methods

1 Like

Hello! You may think your solution is bad but it’s not actually. It’s good to save things in string but try to put as much things as you can in a string. For example, let’s say you have an ID for a dropper, and that is 3. Let’s say that dropper is upgradable and it’s level is 5. That model has a main part and we gonna save it’s position and rotation only, so it could be like ID-Level(Or other stats)-Position-Rotation. Something like this: "3;5;15;2;20;0;90;0"

You could save multiple objects in a string too. Let’s put another character to seperate them.
"3;5;15;2;20;0;90;0:::4;2;30;2;10;0;-45;0"

A function in a module that you could write could encode and decode those strings easily as well.

Additionally, methods xuefei sent would work pretty well for you too!

3 Likes

Thank you for your replies! I’ll give them a try :slight_smile:

1 Like