File paths: I've tried everything
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: File paths: I've tried everything
love.filesystem.getWorkingDirectory() tells you what the current directory is (what ./ is)-
Re: File paths: I've tried everything
On my machine:
D:/Program Files (x86)/Notepad++
(my love editor)
Am I right in saying that
should simply look in the same folder as the exe? I mean - I'm not overthinking that am I?
D:/Program Files (x86)/Notepad++
(my love editor)
Am I right in saying that
Code: Select all
sqlite3 = require("lsqlite3");
Current project:
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life. Simple to learn, hard to master. Learn when to advance, dodge, strike and counter. Learn how to strike without being struck.
https://discord.gg/HeHgwE5nsZ
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life. Simple to learn, hard to master. Learn when to advance, dodge, strike and counter. Learn how to strike without being struck.
https://discord.gg/HeHgwE5nsZ
Re: File paths: I've tried everything
If that's what you want, maybe you can try this?
I don't know if love.filesystem.setCRequireDirectory() should be used instead. I haven't used binary packages. My guess is that it should be this one, as that's the real filesystem, as opposed to PhysFS's virtual filesystem.
Note also that love.filesystem.getSourceBaseDirectory() is broken. I need to use `love ./` instead of `love .` for it to return the correct directory.
Code: Select all
package.cpath = love.filesystem.getSourceBaseDirectory() .. "/*.dll;" .. package.cpath
sqlite3 = require 'lsqlite3'
Note also that love.filesystem.getSourceBaseDirectory() is broken. I need to use `love ./` instead of `love .` for it to return the correct directory.
Re: File paths: I've tried everything
Unfortunately, that's not right. The "." in a path always means the "current working directory" (called the "default directory" in DOS/Windows.)togFox wrote: ↑Thu Apr 08, 2021 12:45 pm On my machine:
D:/Program Files (x86)/Notepad++
(my love editor)
Am I right in saying that
should simply look in the same folder as the exe? I mean - I'm not overthinking that am I?Code: Select all
sqlite3 = require("lsqlite3");
So your problem is that you're executing the game from a directory other than the game directory. IMO, LOVE really should CD into the game directory before starting, but that's not happening. So what you need to do is build a startup script that does it for you. Then run the game from the startup script.
On my development instances, I use a .cmd file to make that happen, which looks like this:
Code: Select all
%~d0
cd %~dp0
"C:\Program Files\LOVE\love.exe" %~dp0 --console
1. %~d0 Changes to the drive that the script sits in (very important, since CD doesn't do that for you)
2. cd %~dp0 Changes to the directory game lives in
3. "C:\Program Files\LOVE\love.exe" %~dp0 --console actually starts LOVE and passes it the game path. I use --console to pass debug information back while testing, but you can leave that out if you're not testing. (I have a separate "play.cmd" and "test.cmd" for that reason.)
Who is online
Users browsing this forum: Google [Bot] and 7 guests