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

Thoughts on this method for saving base data?

Asked by 5 years ago
Edited 5 years ago

I am working on a game, in this game a user can make a base and place objects down in it, this base is saved when they leave and loaded when they join again, I was wondering what the best method of doing this was, this is what I came up with, I am asking for opinions on it, and if possible ways to improve it, maybe even a new method.

The idea is that data is saved like this, each object is represented in a 4 variable list like this:

The first one would be a 'Object ID' this refers to a object in ServerStorage.

The next one is a 'Relative Position' this would be a Vector3 witch would be relative to a point in the center of the base.

Number 3 would be a rotation, all bases will be in the same rotation but this would be the rotation of the object.

The last one would be any extra data about the object, so a chest would need extra data on its contents.

This is only a theory right now, but I wanted some suggestions on better ways to go around it.

An example of the data:

- Player 119226470
    - Object
        - Object 1
        - 30, 1, 40
        - 0, 0, 72
    - Object
        - Object 42
        - 40, 0, 34
        - 0, 0, -81
        - Extra Data
            - Item
                - Item 12
                - 3
            - Item
                - Item 19
                - 1
0
Save the objects name into a table (make sure that each object model has a primary part set in it) and create a new table to save the PrimaryPart's CFrame. awesomeipod 607 — 5y
0
That's my idea about saving not sure how you would set the PrimaryPart's CFrame relative to the plot/basplaste awesomeipod 607 — 5y
0
Less position and rotation, more cframe Vulkarin 581 — 5y
0
Hmm, yes using CFrame would be better, but I wanted it to be Vector3 rotation then I could consolidate the data size down, allowing more objects to be placed and remain in the roblox data limit. AlphaGamer150 101 — 5y

Answer this question