LUA Engine Refuses To Load File

I am having a problem with the LUA Engine refusing to load a LUA file. Here is the error I am getting and a picture of the code & file structure.

LuaGetfile: Not Loading ./effects/food.lua

(Don’t mind all of the other includes, I was just testing to see if it was just me giving it the wrong path.)

As you can see, the file name and path to the file is correct. Nevertheless, it still refuses to load the file. There has to be something I’m missing. What is it?


You’re not allowed to include files with a … in the path


Or . for that matter

So if I can’t have a ‘.’ in the path then how can I include files that are in subfolders?

You don’t. A subfolder to the base folder would have to be outside of the Garry’s Mod folder.

To make it clear the path is not relative to the lua file’s location.

… are allowed. . most likely isn’t.

The root of ‘include’ is the directory the current file file loaded from. So if you include something from a file in ‘gamemode/’, it will search for that file in ‘gamemode/’.

So according to this “effects/food.lua” should work. The effects.lua file is in the “gamemode/” directory and the food.lua file is in the “gamemode/effects/” directory. I already tried “effects/food.lua” though, with no success.

Well are you trying to include it from itself? That’s not how it works.

Where are you calling ‘effIncludeObjects’ from? Every gamemode/script I have that does this works.

I’m calling effIncludeObjects from init.lua which is in the gamemodes/ folder.