Page 1 of 2

conf.lua is not affecting the rest of the game

Posted: Fri Nov 21, 2014 11:08 pm
by vitto
I'm trying to set some default param on my [wiki]Config_Files[/wiki] to give a base of params for my game, for example:

Code: Select all

-- file conf.lua
function love.conf(t)
    t.identity = "Game name"
end
Then I'm try to read the data from it without success:

Code: Select all

-- file main.lua
function love.draw()
    local identity
    identity = love.filesystem.getIdentity()
    love.graphics.print(identity, 20, 50) -- this writes on the window "game" instead of "Game name"
end
Is conf.lua supposed to be used to set there default values, and if yes, how should i retrieve these data?

Re: conf.lua is not affecting the rest of the game

Posted: Sat Nov 22, 2014 4:04 am
by Azhukar
Conf.lua is to configure the startup of love framework, not for actual values specific to your game.

getIdentity and setIdentity are for setting the write directory for your game, also called savegame folder. This is also the folder where you will want to save user settings later on, should you code any.

Re: conf.lua is not affecting the rest of the game

Posted: Sat Nov 22, 2014 6:56 pm
by s-ol
Azhukar wrote:Conf.lua is to configure the startup of love framework, not for actual values specific to your game.

getIdentity and setIdentity are for setting the write directory for your game, also called savegame folder. This is also the folder where you will want to save user settings later on, should you code any.
He is getting the value back from love though, so "basically" this should work - I have no idea how the love.filesystem api works though.

Re: conf.lua is not affecting the rest of the game

Posted: Sat Nov 22, 2014 7:45 pm
by Azhukar
S0lll0s wrote:He is getting the value back from love though
No he is not.

Re: conf.lua is not affecting the rest of the game

Posted: Sat Nov 22, 2014 8:15 pm
by slime
vitto wrote:I'm trying to set some default param on my [wiki]Config_Files[/wiki] to give a base of params for my game, for example:

Code: Select all

-- [...]
Is conf.lua supposed to be used to set there default values, and if yes, how should i retrieve these data?
That code works for me (it displays 'Game name' onscreen.) Do you have anything else in your love.conf function that might be causing an error when love tries to load it?

Azhukar wrote:Conf.lua is to configure the startup of love framework, not for actual values specific to your game.

getIdentity and setIdentity are for setting the write directory for your game, also called savegame folder. This is also the folder where you will want to save user settings later on, should you code any.
conf.lua configures values of LÖVE specific to your game. The t.identity field in [wiki]love.conf[/wiki] sets the game's write directory.

Re: conf.lua is not affecting the rest of the game

Posted: Sat Nov 22, 2014 8:34 pm
by Azhukar
slime wrote:The t.identity field in [wiki]love.conf[/wiki] sets the game's write directory.
My mistake, didn't realize it was identity as he wasn't getting the correct value. Perhaps the space causes some strange bug?

Re: conf.lua is not affecting the rest of the game

Posted: Sun Nov 23, 2014 11:30 pm
by Positive07
Azhukar wrote:
slime wrote:The t.identity field in [wiki]love.conf[/wiki] sets the game's write directory.
My mistake, didn't realize it was identity as he wasn't getting the correct value. Perhaps the space causes some strange bug?
No it isnt (I'm answering like you do ;) )

Re: conf.lua is not affecting the rest of the game

Posted: Fri Nov 28, 2014 4:56 pm
by iggyvolz
Oddly enough, I've been having problems with the identity functions not changing in the actual script, but pasting your example works fine for me.

What platform are you on? That might help to diagnose the issue.

Re: conf.lua is not affecting the rest of the game

Posted: Fri Nov 28, 2014 10:24 pm
by Azhukar
Positive07 wrote:No it isnt (I'm answering like you do ;) )
Only you're making neither grammatical nor contextual sense. I appreciate you trying to be more succinct, it saves a lot of time.

Re: conf.lua is not affecting the rest of the game

Posted: Fri Nov 28, 2014 10:54 pm
by s-ol
Azhukar wrote:
Positive07 wrote:No it isnt (I'm answering like you do ;) )
Only you're making neither grammatical nor contextual sense. I appreciate you trying to be more succinct, it saves a lot of time.
Dude, seriously. This is a forum, people are coming here for help and social interaction. In a forum you try to strike a balance between good conversation and information and your short and cold answers are useless. If you disagree, state why, be productive and help out. If you agree, motivate. If you are tired of people asking questions that were answered before or that you do not seem worthy being asked then fucking ignore it.
A forum is not a place where information density or anything like that matters, people asking questions are usually thankful for longer and more detailed answers. With your post style you are mostly just being a dick. You can talk about how you are only to-the-point all you want but your posts make you a dick, no more, no less.