• where to put modules?
    5 replies, posted
so i want to create my own module for my gamemode, but where would i put it? can't figure it out on my own :( [code]ERROR: Couldn't include file 'includes\modules\skills.lua' (File not found)[/code] [lua]local skill = require("skills")[/lua]
garrysmod/lua/includes/modules/skills.lua in the server install of Garrys Mod.
so your saying it's impossible to have it somewhere in my "\garrysmod\gamemodes\xxx" ??
If you're trying to make a modular based system, the way I've done it is like so: [lua] local function loadModules() local fol = "mods/" local files, folders = file.Find(fol .. "*", "LUA") for k,v in pairs(files) do print("Including - ".. v) include(fol..v) end end loadModules() [/lua]
[QUOTE=grunewald;44040247]so your saying it's impossible to have it somewhere in my "\garrysmod\gamemodes\xxx" ??[/QUOTE] That's where it's looking for it. Pretty sure you could also put it in your game-mode directory as a module but I'm not 100% on that but if I recall correctly I think I've seen it done. Just include it instead of require it.
[QUOTE=Acecool;44040265]That's where it's looking for it. Pretty sure you could also put it in your game-mode directory as a module but I'm not 100% on that but if I recall correctly I think I've seen it done. Just include it instead of require it.[/QUOTE] thanks! :)
Sorry, you need to Log In to post a reply to this thread.