Jump to content

Recommended Posts

The question is how to make game save/load files without encryption.

I want to have world saves and saveindex files as plain txt files for some time.

Well, the saves aren't really encrypted, just compressed. See this thread for how to decode an existing save.

However, making the game save uncompressed saves from now on is much simpler. Simply create a mod with the following in modmain:

GLOBAL.ENCODE_SAVES = false

Well, the saves aren't really encrypted, just compressed. See this thread for how to decode an existing save.

However, making the game save uncompressed saves from now on is much simpler. Simply create a mod with the following in modmain:

GLOBAL.ENCODE_SAVES = false

Thanks.

Now I'm stuck on other thing. How to get the save file name or any other variable that will let me detect current place i'm in.

Every save file surface world and caves have diffrent file names that would be ideal to dectect where the player currently is.

Thanks.

Now I'm stuck on other thing. How to get the save file name or any other variable that will let me detect current place i'm in.

Every save file surface world and caves have diffrent file names that would be ideal to dectect where the player currently is.

To get the current save slot:

GLOBAL.SaveGameIndex:GetCurrentSaveSlot()
To get the current game mode (as a string, whose possibilities include "survival", "adventure" and "cave"):

GLOBAL.SaveGameIndex:GetCurrentMode()
To get the current cave level if inside the cave (1 being "regular cave", 2 being "ruins"):

GLOBAL.SaveGameIndex:GetCurrentCaveLevel()
To get the current cave number if inside a cave (the first visited cave in a save has number 1, the second has number 2, etc.):

GLOBAL.SaveGameIndex:GetCurrentCaveNum()
Finally, if you really want the save name:

GLOBAL.SaveGameIndex:GetSaveGameName(GLOBAL.SaveGameIndex:GetCurrentMode(), GLOBAL.SaveGameIndex:GetCurrentSaveSlot())
If you need something different from that, take a look at saveindex.lua.

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...