_Q_ Posted March 21, 2014 Share Posted March 21, 2014 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. Link to comment Share on other sites More sharing options...
simplex Posted March 21, 2014 Share Posted March 21, 2014 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 Link to comment Share on other sites More sharing options...
_Q_ Posted March 21, 2014 Author Share Posted March 21, 2014 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 = falseThanks.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. Link to comment Share on other sites More sharing options...
simplex Posted March 21, 2014 Share Posted March 21, 2014 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.