Bring back readline!

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.
1stAnd10
Prole
Posts: 22
Joined: Tue Nov 25, 2008 2:09 pm

Re: Bring back readline!

Post by 1stAnd10 »

I put my own values in it and pull their values in and use them. I was going to ask but I figured I would try it first. And it works.

Should it not?
surtic
Citizen
Posts: 74
Joined: Sat Jul 12, 2008 12:18 am

Re: Bring back readline!

Post by surtic »

Probably the only thing you really get from the config file that you can't do in load() is not opening a window if you don't need one. You could add an optional "config()" function to the script and make sure it runs before you open a window. This would make the code lighter (no need to maintain an extra parser) and faster (one file to parse, at least initially).

If you are going to let people change the mainloop code then they can do it themselves, as long as opening the window is explicit (or at least can be overridden with "love.system.openWindow(false)" or something similar).
User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: Bring back readline!

Post by rude »

People will be able to take control over the main loop, but some code still needs to run before main.lua is loaded. For instance, the PhysFS search directories and write directory must be set (and the functions for setting them must self-destruct).

Also, the whole love_version thing could be solved like this, which makes config files even more redundant.

Code: Select all

function load()
   love.system.checkVersion("0.5.0") -- Cause error if incompatible.
end
User avatar
mike
Administrator
Posts: 364
Joined: Mon Feb 04, 2008 5:24 pm

Re: Bring back readline!

Post by mike »

Are we actually deciding to remove the config file completely and just give people more control over how LÖVE works? I'm not sure I favor this decree. Of course, it's great that people CAN change the window size within LÖVE, but I want to be able to write it into the file and then forget about it. The config file MAKES SENSE to me... then again, I've been wrong before.
Now posting IN STEREO (where available)
u9_
Citizen
Posts: 54
Joined: Thu Oct 23, 2008 7:12 am

Re: Bring back readline!

Post by u9_ »

I think the config file makes sense, if it can be left out of the .love file and still work. That way i can actually edit it to change the behaviour of my game without "recompiling."
User avatar
TsT
Party member
Posts: 161
Joined: Thu Sep 25, 2008 7:04 pm
Location: France
Contact:

Re: Bring back readline!

Post by TsT »

mike wrote:Wait... we can have comments in the config files????
See my patch to support comments : http://love2d.org/forum/viewtopic.php?f=4&t=195
My projects current projects : dragoon-framework (includes lua-newmodule, lua-provide, lovemodular, , classcommons2, and more ...)
surtic
Citizen
Posts: 74
Joined: Sat Jul 12, 2008 12:18 am

Re: Bring back readline!

Post by surtic »

This is only my opinion (as usual), but I prefer a single mechanism. It's easier on my brain.

My preferred solution is to have LÖVE's default main-loop function dofile "game.conf", then create the window (using the parameters from the config file), then run load() etc. That way, the behaviour will be pretty much the same, but with two advantages: 1. custom parameters and 2. control over this mechanism (in case I don't want game.conf).

It's not like the current situation is so bad. It's quite good, really. It's just that LÖVE has two very similar (to a point, of course) parsers. After comments, people might start expecting simple expression evaluation ("I want to have width = 1.5 * height") etc. Maintaining (and extending) an extra parser is a pain, especially when you get one for free (with good documentation, tutorials, etc.)
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest