How to get source directory's path?

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
Factis
Prole
Posts: 14
Joined: Sun Sep 23, 2012 5:38 pm

How to get source directory's path?

Post by Factis »

I'm stuck with this :/

Which function can return source directory's path?
(My .love archive is located in "C:/Love/Test/", how do I return this path?)

Thanks.
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: How to get source directory's path?

Post by Roland_Yonaba »

Factis
Prole
Posts: 14
Joined: Sun Sep 23, 2012 5:38 pm

Re: How to get source directory's path?

Post by Factis »

My game is located at C:/Love/Test
and this function returns me:
C:/Documents and Settings/ADMIN
nothing else
User avatar
Boolsheet
Inner party member
Posts: 780
Joined: Wed Dec 29, 2010 4:57 am
Location: Switzerland

Re: How to get source directory's path?

Post by Boolsheet »

Hm, I don't think the path to the game directory/archive is exposed in any way. You could check the table passed to love.load. That usually contains the directory or archive in 1, but it depends how you start LÖVE of course. Fused games start differently, for them you would need the program path and that's not in the table from love.load, but I think it saves it somewhere in the love table.
Shallow indentations.
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: How to get source directory's path?

Post by Roland_Yonaba »

I'd just like to point out that this works perfect for me, when I drag the *.love file on "love.exe".
But, as it's likely to work in all cases, as BoolSheet said, so it might not be a valuable option.
Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests