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

Data Persistance and/or Data Store?

Asked by 10 years ago

Alright so I am trying to save a model that a user has made on the game, how can I save it to the game so they have access later? on the wiki it said saving models with data store is not going to work so should i use DP?

2 answers

Log in to vote
2
Answered by
jobro13 980 Moderation Voter
10 years ago

It actually depends on what you are going to do with the model. You need to ask you only one main question which will do in most cases:

  • Do I also need to access this data if the player is not in the game?

For example, if you create a game in which you can create "levels" it would be cool if you could play every level once created. In this case, you need to use Data Store. If you only need the data when the player is in-game, you can use Data Persistence. Data Persistence is easier to use as it allows to save instances directly - Data Store cannot save instances directly.

However, there is a limitation on how much you can save with Data Persistence. Data Store has unlimited data capacity.

So, a small overview:

Data Persistence

  • Used for per-player data, only accessible when they are in-game
  • Has a data limit
  • Can save instances directly

Data Store

  • Can also be accessed if the player is not in the game
  • Does not have a data limit
  • Cannot save instances directly - you need to provide a custom way to do this, but this is possible and shouldn't be that hard

So, see what fits your needs!

Ad
Log in to vote
1
Answered by 10 years ago

Data persistence is needed to save Instances using :SaveInstance() and :LoadInstance ()

Answer this question