A Saving Lib? [SOLVED]
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
A Saving Lib? [SOLVED]
Does know of a library which will allow me to save different variables and then load them up in the next game session. Eg: Save the level number, close the game, reopen, and you are still on the same level.
Last edited by Davidobot on Fri Apr 06, 2012 4:06 pm, edited 1 time in total.
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
- trubblegum
- Party member
- Posts: 192
- Joined: Wed Feb 22, 2012 10:40 pm
Re: A Saving Lib?
What's wrong with love.filesystem?
Using something like TSerial, it's as simple as :
Using something like TSerial, it's as simple as :
Code: Select all
local savedata = {...}
love.filesystem.write('save.sav', TSerial:pack(savedata))
local loaddata = TSerial:unpack(love.filesystem.read('save.sav'))
Re: A Saving Lib?
Can you give me an example of a .love that uses this?trubblegum wrote:What's wrong with love.filesystem?
Using something like TSerial, it's as simple as :Code: Select all
local savedata = {...} love.filesystem.write('save.sav', TSerial:pack(savedata)) local loaddata = TSerial:unpack(love.filesystem.read('save.sav'))
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
Re: A Saving Lib?
Yes that is perfect for one variable, what about a whole bunch of them?TechnoCat wrote:viewtopic.php?f=4&t=2075&p=22657&hilit=love.quit#p22657
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: A Saving Lib?
You put all the variables into one single table, and save that.
When I write def I mean function.
Re: A Saving Lib?
I tried, but it gave me an error.kikito wrote:You put all the variables into one single table, and save that.
- Attachments
-
- Dungeon Crawler.love
- (17.86 KiB) Downloaded 153 times
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
Re: A Saving Lib?
Using json with loves filesystem does the trick for me.
Re: A Saving Lib?
You can serialize your gamestate as is with DataDump, then save to a file.
Re: A Saving Lib?
Json?Averice wrote:Using json with loves filesystem does the trick for me.
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
Who is online
Users browsing this forum: No registered users and 2 guests