I’m trying to make a dynamic MapData-style serverside inclusion system. I coded it in another gamemode, where it worked fine. Below is all the code.
[lua]include( game.GetMap() … “.lua” );[/lua]
Tested on three maps, all map lua files in the same directory, with correct spelling (eg, gm_flatgrass.lua). For some reason, I get an error saying that the file cannot be found. However, if I copy and paste the files into the garrysmod/lua folder, they work perfectly. It is serverside, being called in the InitPostEntity hook. The gamemode is new, being coded on a clean GMod install.
Any ideas why/how to get around it? This has never been an issue for me.