Skip to content

Commit

Permalink
Save/Load states based on current game
Browse files Browse the repository at this point in the history
This change saves / loads a save state based on the games filename.

This will allow the ability to:

a) Use a previously saved state to start a run
b) Distinguish states from the same rom file (but differently named filenames) refs: brossentia#1
  • Loading branch information
alexjpaz committed Dec 31, 2020
1 parent 58d5ec6 commit 1a6eb25
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Empty file added CurrentSaves/DeleteMe
Empty file.
7 changes: 4 additions & 3 deletions SoloShuffler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ i = 0
x = 0
romSet = {}
gamePath = ".\\CurrentROMs\\"
savePath = ".\\CurrentSaves\\"
settingsPath = "settings.xml"
if userdata.get("countdown") ~= nil then
countdown = userdata.get("countdown")
Expand Down Expand Up @@ -180,11 +181,11 @@ function nextGame(game) -- Changes to the next game and saves the current settin
console.log("Reroll! " .. ranNumber)
end
end
currentGame = newGame
userdata.set("first",1)
savestate.saveslot(1)
savestate.save(savePath .. currentGame .. ".save")
currentGame = newGame
client.openrom(gamePath .. currentGame)
savestate.loadslot(1)
savestate.load(savePath .. currentGame .. ".save")
console.log(currentGame .. " loaded!")
userdata.set("currentGame",currentGame)
userdata.set("timeLimit",timeLimit)
Expand Down

0 comments on commit 1a6eb25

Please sign in to comment.