Include file in directory


I have the file gamemodename/gamemode/init.lua and want to include gamemodename/gamemode/settings/config.lua

I thought I could write in init.lua ‘include( “settings/config.lua” )’ as it’s relative to the file that includes it, but I get the error: ‘Couldn’t include file ‘settings/config.lua’ (File not found) (@gamemodes/gamemodename/gamemode/init.lua (line 8))’

I really don’t know what I’m doing wrong, but I obviously am making some stupid mistake, so if anyone can point me in the right direction I’d be grateful.

Make sure config.lua is not empty.

It has variables in it:

And as it’s not including it, it doesn’t seem to find it when I print ADDON_NAME.

[editline]12th May 2014[/editline]

Okay, now I’m confused. I’ve just put config.lua in the same directory as init.lua and put include(“config.lua”) in init.lua and it still says ‘Couldn’t include file ‘config.lua’ (File not found) (@gamemodes/gamemodename/gamemode/init.lua (line 8))’

[editline]12th May 2014[/editline]

Okay, fixed all these problems. Not sure how, but it’s not working. Sorry for the trouble :slight_smile: