Problems with package.path and relative paths
Posted: Tue Feb 21, 2012 3:52 am
Hello lovers,
This is my first post on these very fine forums, and I'm quite excited to be using LOVE for my game programming needs!
Here is my issue: I have project arranged like this:
root
->main.lua (this require's the test module)
->lua
--->test.lua
And everything works just fine if I run my code from the root directory there. I can do it by making a .love and placing it there and double-clicking it, I can run love from the command line and give it the root directory. Those both work.
However, if I try to drag that love onto the LOVE icon on my desktop, or try to drag the root directory onto that icon, I get errors telling me that it can't find the files and checking the lua package.path and all that.
I've included the code for you nice people to look at if you're so inclined.
Please, if I've not explained myself clearly enough, or the code does not work for you, please ask and I'll try to explain better. Thanks very much for taking a look at this issue.
This is my first post on these very fine forums, and I'm quite excited to be using LOVE for my game programming needs!
Here is my issue: I have project arranged like this:
root
->main.lua (this require's the test module)
->lua
--->test.lua
And everything works just fine if I run my code from the root directory there. I can do it by making a .love and placing it there and double-clicking it, I can run love from the command line and give it the root directory. Those both work.
However, if I try to drag that love onto the LOVE icon on my desktop, or try to drag the root directory onto that icon, I get errors telling me that it can't find the files and checking the lua package.path and all that.
I've included the code for you nice people to look at if you're so inclined.
Please, if I've not explained myself clearly enough, or the code does not work for you, please ask and I'll try to explain better. Thanks very much for taking a look at this issue.