Page 1 of 2

[SOLVED]Conf.lua being ignored even with "required"

Posted: Wed Aug 27, 2014 3:40 pm
by Vallar
Hello everyone,

Recently I have decided to try my hands on real programming while making games rather than just depend on Construct 2-like tools. So I thought LOVE (I don't know how to make the two dots on top of the "O" sorry) would be fit for a beginner.

I started following these tutorials and they seem to be really good. However in his first episode he created a conf.lua file and placed it in the main folder along with main.lua.

I did the SAME EXACT thing but the console never appeared. I searched in the forums and it seems there are threads like this one but no real answer in them. I tried one of the solutions inside which is to do a require ("conf") or require("conf.lua") and both didn't work. They produced an error saying there is no conf.lua file in the folder. Except the file is RIGHT THERE next to main.lua.

I have attached the .love file and maybe someone can shed some light to this madness, please.

Thank you very much in advance.

Re: Conf.lua being ignored even with "required"

Posted: Wed Aug 27, 2014 4:07 pm
by Plu
You have a typo in your function name, so it's never called:

Code: Select all

function love.cof(t)

Re: Conf.lua being ignored even with "required"

Posted: Wed Aug 27, 2014 4:35 pm
by Vallar
I fixed the typo but still the same exact thing happens. The console window doesn't appear.

Thank you very much though for spotting that.

Re: Conf.lua being ignored even with "required"

Posted: Wed Aug 27, 2014 6:00 pm
by Xrott
Are you using Windows? Because that option only works for that.

Also, why don't you just simply copy the full list of options from the wiki and change it to what you need? I always start with that.

Re: Conf.lua being ignored even with "required"

Posted: Wed Aug 27, 2014 6:31 pm
by bartbes
Vallar wrote:require("conf.lua") [...] produced an error saying there is no conf.lua file in the folder. Except the file is RIGHT THERE next to main.lua.
While off-topic, it's important that you realize that require doesn't want file names or paths, it takes module names. Now module names can be turned into paths fairly easily, by replacing every dot with a slash, and then appending '.lua', so you're looking for a file called 'conf/lua.lua' there.

Re: Conf.lua being ignored even with "required"

Posted: Wed Aug 27, 2014 6:59 pm
by Vallar
Are you using Windows? Because that option only works for that...
Yes, Windows 7 64 bit. I was following the tutorial since I am just starting out. But when I looked at what is inside the Wiki I found just a few more options that is all. Besides, it appeared in the video why not for me?
While off-topic, it's important that you realize that require doesn't want file names or paths, it takes module names. Now module names can be turned into...
Now I didn't know that. I thought me including conf.lua was a convention to include the extension of the file. However, when I omit the ".lua" part and just use require("conf") the game runs without errors but the console window doesn't appear.
If I remove the require("conf") all together it doesn't appear still.

How do other people make it appear?

Re: Conf.lua being ignored even with "required"

Posted: Wed Aug 27, 2014 8:35 pm
by TurtleP
Vallar wrote:
Are you using Windows? Because that option only works for that...
Yes, Windows 7 64 bit. I was following the tutorial since I am just starting out. But when I looked at what is inside the Wiki I found just a few more options that is all. Besides, it appeared in the video why not for me?
While off-topic, it's important that you realize that require doesn't want file names or paths, it takes module names. Now module names can be turned into...
Now I didn't know that. I thought me including conf.lua was a convention to include the extension of the file. However, when I omit the ".lua" part and just use require("conf") the game runs without errors but the console window doesn't appear.
If I remove the require("conf") all together it doesn't appear still.

How do other people make it appear?
For the debug console to appear, do the following:

Code: Select all

function love.conf(t)
   t.console = true
end
False makes it not appear, or not having this makes it false by default. Also check out the wiki (it's a very handy resource): http://love2d.org/wiki/conf

For anything to appear in that console, do a print (for example in love.load):

Code: Select all

function love.load()
   print("Hello, world!")
end

Re: Conf.lua being ignored even with "required"

Posted: Wed Aug 27, 2014 8:41 pm
by Vallar
I have that line of code inside conf.lua already. But still doesn't work and it is set to true as well. That is what is dazzling me. Everything checks out as the wiki and the tutorials I found around but still wouldn't work.

Not sure what I am missing.

Thank you very much nonetheless :)

Re: Conf.lua being ignored even with "required"

Posted: Wed Aug 27, 2014 9:19 pm
by Xrott
Wait, are you using that "play.bat" to start your game? It looks like that's possibly what's keeping the console from opening. I don't know for sure, but try running your game another way.

http://www.love2d.org/wiki/Getting_Star ... ning_Games

Re: Conf.lua being ignored even with "required"

Posted: Wed Aug 27, 2014 9:42 pm
by Vallar
I tried 4 ways of running the game to be honest:

1- I have Notepad++ with the add-on that was added here on the site so you can get code auto-complete and start the game from Notepad++. So I run it from there. The console doesn't appear.
2- I tried the play.bat method he mentioned in the file and same thing, no console window.
3- I tried dragging the whole folder on the Love.exe in the LOVE installation folder, still no window.
4- Finally I packaged the game up (same package I uploaded to this topic) and tried to run that and still no window.