Jump to content

Recommended Posts

Hello Guys!

I want to know how to store data in Don't Starve Together. Basically, all I want to is to store a single number and only that. This number will be created and it's initial value will be zero, but after world generation it'll store a single number (my mod is server-side). After that, this number will be loaded when the mod is enabled or when the master sim enters a world with the mod enabled.

Can someone help me? Thank you :)

Edited by Provoked

There are a few possibilities:

You can use the function TheSim:SavePersistenString to save a string into a file

Or you can use the io commands of lua to create your own file with the number.

Or you can make a dummy component that you add to TheWorld where you save your number.

This will depend on what will be the best for you, the persistent string will be saved in the folder of the cluster, so you will need a new file for each world. Same goes for the dummy component.

The created file will be saved in the data folder of Don't Starve Together, so it will be the same for each world.

  • Like 1
  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...