Page 1 of 1

Trying to get love2d to read text files in the same directory.

Posted: Tue Sep 03, 2024 5:12 pm
by Redward
Hello, I am having some issues finding the correct way to get my packaged game to read text files that are in the same directory as the game. These text files are linked to StreamerBot, which writes the name of the chat user into the text file to be shown while streaming.

Every method I have found seems to make it impossible for the game.love to read the files in the folder of the same directory. The code works if I haven't packaged it, and I don't want to have Visual Studio running while using this program. So, I am seeing if anyone has a solution for this.

Thanks if anyone can help.

Re: Trying to get love2d to read text files in the same directory.

Posted: Wed Sep 04, 2024 4:31 am
by marclurr
What methods have you tried?

Re: Trying to get love2d to read text files in the same directory.

Posted: Wed Sep 04, 2024 6:27 am
by zorg
You are probably looking for love.filesystem.getSourceBaseDirectory that you need to mount up.

Re: Trying to get love2d to read text files in the same directory.

Posted: Wed Sep 04, 2024 9:19 am
by pgimeno
It appears that zorg made a mistake in the link. Here's the correct one: love.filesystem.mount

Re: Trying to get love2d to read text files in the same directory.

Posted: Thu Sep 05, 2024 12:35 am
by Redward
So i tested some of those tips. and i found a half solution, and that is i created an input where it reads the file so i type in the directory where the .txt file is, and manged to get it to read from the roaming/love directory
,