Hi, please help my about file manipulation

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
ThibsLeNoob
Prole
Posts: 1
Joined: Thu Dec 03, 2020 4:03 pm

Hi, please help my about file manipulation

Post by ThibsLeNoob »

Hello,

the love.filesystem reads or writes everything at the same time,
how can I write and retrieve data in 2 different variables with a single file?
thank you in advance.

-Thibs-
User avatar
darkfrei
Party member
Posts: 1197
Joined: Sat Feb 08, 2020 11:09 pm

Re: Hi, please help my about file manipulation

Post by darkfrei »

I make the file savefile.lua and save here the global table.
Your save file can be such as

Code: Select all

return {1, 2, {a="1, b=2"}}
So you can save any amount of any variables just to one table.

http://lua-users.org/wiki/SaveTableToFile
https://github.com/gvx/Ser
https://love2d.org/forums/viewtopic.php?t=81799
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest