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

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Redward
Prole
Posts: 2
Joined: Fri Aug 02, 2024 3:47 pm

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

Post 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.
User avatar
marclurr
Party member
Posts: 157
Joined: Fri Apr 22, 2022 9:25 am

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

Post by marclurr »

What methods have you tried?
User avatar
zorg
Party member
Posts: 3468
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

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

Post by zorg »

You are probably looking for love.filesystem.getSourceBaseDirectory that you need to mount up.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
pgimeno
Party member
Posts: 3672
Joined: Sun Oct 18, 2015 2:58 pm

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

Post by pgimeno »

It appears that zorg made a mistake in the link. Here's the correct one: love.filesystem.mount
Redward
Prole
Posts: 2
Joined: Fri Aug 02, 2024 3:47 pm

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

Post 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
,
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 5 guests