[B]Problem solved. [URL="http://www.facepunch.com/showthread.php?t=949978"]The module needs to be changed or wrapped to work with gmod.[/URL][/B]
Hello,
Does gmod support importing C-based Lua modules? E.g., [I]require "foobar"[/I] where module [I]foobar[/I] is defined in foobar.dll (standard Lua stuff here, nothing fancy or gmod-specific).
I have a Lua module in a DLL that I'd like to import into gmod, but I can't: [I]packages.cpath[/I] is [I]nil[/I] in gmod, and setting it to a valid cpath doesn't seem to work either, although I'm still digging into this. The module works fine in stand-alone Lua, so there's something I'm not getting about gmod's interaction with external modules. Searching the forum for "cpath" gave me a bunch of noise, so I don't know if this has been answered here or not. Sorry if it has -- but I'll gladly accept a link to the answer. :wink:
Before I fuss with the cpath too much more, I thought I'd see if anyone has gotten something like this to work.
Thanks a lot.
You can do modules in C++, here is a link.
[url]http://wiki.garrysmod.com/?title=GLuaModule[/url]
[QUOTE=zzaacckk;32088559]You can do modules in C++, here is a link.
[url]http://wiki.garrysmod.com/?title=GLuaModule[/url][/QUOTE]
Thanks, zzaacckk. It looks like standard Lua binary modules are not supported (modules that work with stand-alone Lua), but they can be rewritten or wrapped to make them gmod-friendly.
Sorry, you need to Log In to post a reply to this thread.