Hello guys. I made an map editor, and I have a problem.
The tileset have to be loaded from the "gfx/tiles" folder that is located in .exe file directory
But I can't load from game directory, only from .love archive!!!
Guys please help me.
How I can LOAD new IMAGE from game directory, not from .love archive?
How to load a file from game directory
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- Roland_Yonaba
- Inner party member
- Posts: 1563
- Joined: Tue Jun 21, 2011 6:08 pm
- Location: Ouagadougou (Burkina Faso)
- Contact:
Re: How to load a file from game directory
I may be dumb, but I understood nothing.Factis wrote:Hello guys. I made an map editor, and I have a problem.
The tileset have to be loaded from the "gfx/tiles" folder that is located in .exe file directory
But I can't load from game directory, only from .love archive!!!
Guys please help me.
How I can LOAD new IMAGE from game directory, not from .love archive?
Are you trying to access to some files located inside a *.love file ?
If so, why would you that ?
Basically, you just create an empty folder, which is supposed to be your project directory.
Inside, you create your main.lua, and conf.lua.Then you add all your games assets inside, or within subfolders,
still inside this project directory.
Then if you want to load anything, just keep in mind that the project directory is the root.
When you have finished, you zip the project directory contents (not the project directory itself), and rename its extension to .love.
That's basically how we all proceed.
So if I'm totally out of scope, accept my apologies, and restate the problem.
Re: How to load a file from game directory
No, I want load image not from .love file but from the folder where .exe file will be located
Re: How to load a file from game directory
love.filesystem
You can only access files from the save directory or the boot directory (the love file). That said, it's possible to use lua standard i/o stuff, but there is seLÖVE that disabled this behaviour, and for good reasons.
You can only access files from the save directory or the boot directory (the love file). That said, it's possible to use lua standard i/o stuff, but there is seLÖVE that disabled this behaviour, and for good reasons.
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
Re: How to load a file from game directory
Please don't try things like that, putting resources outside the .exe doesn't make you look cool. If you are trying to test without having to repackage, you can simply drag the folder on top of the exe or create a .bat to open it for you.
Lua is not an acronym.
- josefnpat
- Inner party member
- Posts: 955
- Joined: Wed Oct 05, 2011 1:36 am
- Location: your basement
- Contact:
Re: How to load a file from game directory
Unless you include a Lua zip library to be able to add/remove/files from your .love, you're not going to have much fun.Factis wrote:No, I want load image not from .love file but from the folder where .exe file will be located
What I would suggest is distributing your files like so:
Code: Select all
/start.bat --starts love.exe in the src folder.
/src/main.lua
/src/gamelibs.lua
/src/assets/img.png
/libs/love.exe
And then if love.filesystem doesn't do what you need, use the Lua's io to work around it.
wat?qaisjp wrote:Please don't try things like that, putting resources outside the .exe doesn't make you look cool.
But seriously, I don't see whats wrong with distributing non .love files as long as you've exhausted the alternatives.
Missing Sentinel Software | Twitter
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
Re: How to load a file from game directory
I mean, some studios bla de bla have most of their resources outside of the .exe, so I was telling the OP not to try and be like them and keep them in a directory where the .exe lies.
Lua is not an acronym.
- josefnpat
- Inner party member
- Posts: 955
- Joined: Wed Oct 05, 2011 1:36 am
- Location: your basement
- Contact:
Re: How to load a file from game directory
If you install 100 AAA titles, 99% of them will have resources outside of the .exe file. I think as long as you understand the complications, it's a perfectly reasonable way to distribute a game.qaisjp wrote:I mean, some studios bla de bla have most of their resources outside of the .exe, so I was telling the OP not to try and be like them and keep them in a directory where the .exe lies.
I'll say it again;
I don't see whats wrong with distributing non .love files as long as you've exhausted the alternatives.
Missing Sentinel Software | Twitter
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: How to load a file from game directory
I think that was his point: just because AAA titles (which is a ridiculous name, by the way) do it, doesn't mean you have to do it. If you do something like that, do it for the right reasons, not just because you think it makes you seem cool or "professional".josefnpat wrote:If you install 100 AAA titles, 99% of them will have resources outside of the .exe file.
Also, I don't care how you distribute your games, but every time you use Lua's IO library in a LÖVE project, god kills a kitten.
Help us help you: attach a .love.
- Roland_Yonaba
- Inner party member
- Posts: 1563
- Joined: Tue Jun 21, 2011 6:08 pm
- Location: Ouagadougou (Burkina Faso)
- Contact:
Re: How to load a file from game directory
Gee. Wondering how many kitten should've died from that...Robin wrote:every time you use Lua's IO library in a LÖVE project, god kills a kitten.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 9 guests