Mind you all stop with this lib nonsense for task that are trivial and have inbuilds?
Youre all looking for table.concat here.
love.filesystem.write("save", table.concat (score,"\n") )
Anotther difficulty
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- BrotSagtMist
- Party member
- Posts: 607
- Joined: Fri Aug 06, 2021 10:30 pm
Re: Anotther difficulty
Code: Select all
function saveScore()
local serialize = require '/libraries/ser'
local ScoreData={bestscore, coins}
love.filesystem.write("data.txt", serialize(ScoreData))
end
function loadScore()
--missing
end
A coding begginer that is migrating from 8 years of Scratch... yea yikes.
Re: Anotther difficulty
BrotSagtMist wrote: ↑Mon Jun 27, 2022 1:41 pm Mind you all stop with this lib nonsense for task that are trivial and have inbuilds?
Youre all looking for table.concat here.
love.filesystem.write("save", table.concat (score,"\n") )
Code: Select all
function saveScore()
local serialize = require '/libraries/ser'
local ScoreData={bestscore, coins}
love.filesystem.write("data.txt", table.concat(ScoreData,"\n"))
end
A coding begginer that is migrating from 8 years of Scratch... yea yikes.
- BrotSagtMist
- Party member
- Posts: 607
- Joined: Fri Aug 06, 2021 10:30 pm
Re: Anotther difficulty
At this point i just assume youre looking at the wrong location.
my save dir is ~/.local/share/love
So this is os/settings specific. You may just wanna search the file.
my save dir is ~/.local/share/love
So this is os/settings specific. You may just wanna search the file.
obey
Re: Anotther difficulty
is this related to conf.lua and t.indentity?
Mine is just t.identity = "Balloon_adventure"
Mine is just t.identity = "Balloon_adventure"
A coding begginer that is migrating from 8 years of Scratch... yea yikes.
- BrotSagtMist
- Party member
- Posts: 607
- Joined: Fri Aug 06, 2021 10:30 pm
Re: Anotther difficulty
I usually dont set it and it then just copies the name of the folder/file.
But yea, youre looking for that folder.
But yea, youre looking for that folder.
obey
Re: Anotther difficulty
even with t.identity = love.filesystem.getIdentity() theres still nothing beeing written in the data.txt, i'm really at a loss here
A coding begginer that is migrating from 8 years of Scratch... yea yikes.
- BrotSagtMist
- Party member
- Posts: 607
- Joined: Fri Aug 06, 2021 10:30 pm
Re: Anotther difficulty
t.identity = love.filesystem.getIdentity() <-- What?
Like what is the thought process in that?
Anyway check these paths https://love2d.org/wiki/love.filesystem
There should be a folder folder named after your game in these.
And there is very little chance that the write function failed.
Actually do
to see if there is an error.
Like what is the thought process in that?
Anyway check these paths https://love2d.org/wiki/love.filesystem
There should be a folder folder named after your game in these.
And there is very little chance that the write function failed.
Actually do
Code: Select all
local s, e = love.filesystem.write("data.txt","test" )
print(s,e)
obey
Re: Anotther difficulty
You can get real path to data.txt by
Code: Select all
love.filesystem.getRealDirectory("data.txt")
- BrotSagtMist
- Party member
- Posts: 607
- Joined: Fri Aug 06, 2021 10:30 pm
Re: Anotther difficulty
Duh yea.
But its love.filesystem.getSaveDirectory()
Yours works on folders.
But its love.filesystem.getSaveDirectory()
Yours works on folders.
obey
Who is online
Users browsing this forum: No registered users and 46 guests