Hello! I downloaded Love last night and recently got round to starting to learn the language. I was following the website tutorials and realised something was wrong, if I made another file such as "conf.lua" it wouldn't register. I was following a tutorial on youtube and did EXACTLY everything he did, and love didn't execute the code I told it to in my conf.lua, but it DID execute the code in main.lua
I would really appreciate help, thanks guys.
Love seems to only run my main.lua
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: Love seems to only run my main.lua
Well, conf.lua is supposed to be a configuration file. Yes, you can put some code here, but you're not supposed to.
If conf.lua exists, love loads it, then looks for main.lua and starts running it.
Maybe you should post a .love file, it'll be easier to help.
If conf.lua exists, love loads it, then looks for main.lua and starts running it.
Maybe you should post a .love file, it'll be easier to help.
Re: Love seems to only run my main.lua
Yeah, post a .love file - the conf.lua shouldn't have any code that shows an output to the player or is involved with game mechanics.Roland_Yonaba wrote:Well, conf.lua is supposed to be a configuration file. Yes, you can put some code here, but you're not supposed to.
If conf.lua exists, love loads it, then looks for main.lua and starts running it.
Maybe you should post a .love file, it'll be easier to help.
The best use of conf.lua is to treat it as a utility file, putting utility functions (such as math.wrap, math.clamp, split, explode etc)
Lua is not an acronym.
Re: Love seems to only run my main.lua
If you want code in another file to run you should use:
Where script is the name of the file, without an extension.
Code: Select all
require "script"
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.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Love seems to only run my main.lua
What? No! Please don't put anything other than love.conf in conf.lua.qaisjp wrote:The best use of conf.lua is to treat it as a utility file, putting utility functions (such as math.wrap, math.clamp, split, explode etc)
People who read your code will start in main.lua, looking up functions that called but not defined there in the files that are required. conf.lua is loaded in boot.lua, but that's in the LÖVE core, so people will likely not check that.
TL;DR: whatever you put in conf.lua is basically invisible.
Help us help you: attach a .love.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 3 guests