AlexGCC Posted January 17, 2018 Share Posted January 17, 2018 Hello. Tell me how to make the save at the beginning of the level? For example, I have five levels in the game. I finish the first level. And after leaving the game, I must continue from the second level. Sorry for my English. Quote Link to comment Share on other sites More sharing options...
Core Posted January 17, 2018 Share Posted January 17, 2018 I found this: https://steamcommunity.com/sharedfiles/filedetails/?id=413295203&searchtext= I have not tried it yet, but I'm guessing it will need you to know atleast basics of lua scripting! Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted January 17, 2018 Share Posted January 17, 2018 You would have to write your settings/save data to a file. This could be any kind of file. For instance like savegame.json or .xml. --Load the save game file local path = "mysavegame.data" local stream = FileSystem:WriteFile(path) if (stream==nil) then Debug:Error("Failed to write save game.") end --Write save game data stream:WriteLine("LevelFinished:1") stream:Release() --Load the save game stream = FileSystem:ReadFile(path) if (stream==nil)then Debug:Error("Failed to read file.") end --Loop over save game lines while (not stream:EOF()) do System:Print(stream:ReadLine()) end stream:Release() Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.