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

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.
Vallar
Prole
Posts: 6
Joined: Wed Aug 27, 2014 3:29 pm

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

Post 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.
Attachments
Test.love
(861 Bytes) Downloaded 187 times
Last edited by Vallar on Thu Aug 28, 2014 8:21 am, edited 1 time in total.
User avatar
Plu
Inner party member
Posts: 722
Joined: Fri Mar 15, 2013 9:36 pm

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

Post by Plu »

You have a typo in your function name, so it's never called:

Code: Select all

function love.cof(t)
Vallar
Prole
Posts: 6
Joined: Wed Aug 27, 2014 3:29 pm

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

Post 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.
User avatar
Xrott
Prole
Posts: 16
Joined: Thu Aug 15, 2013 1:28 pm
Location: Augsburg

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

Post 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.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

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

Post 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.
Vallar
Prole
Posts: 6
Joined: Wed Aug 27, 2014 3:29 pm

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

Post 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?
User avatar
TurtleP
Party member
Posts: 147
Joined: Thu Mar 22, 2012 9:20 pm
Contact:

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

Post 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
Vallar
Prole
Posts: 6
Joined: Wed Aug 27, 2014 3:29 pm

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

Post 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 :)
User avatar
Xrott
Prole
Posts: 16
Joined: Thu Aug 15, 2013 1:28 pm
Location: Augsburg

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

Post 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
Vallar
Prole
Posts: 6
Joined: Wed Aug 27, 2014 3:29 pm

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

Post 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.
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 2 guests