After several months of work (twice), my latest work is ready…Vanillin. With Vanillin, you can build Lua binary modules that use the regular Lua C API, for GMod, with no modifications to the source code needed. It provides implementations of every Lua C API function using the underlying GMod C API (and a lot of black magic round-aboutness and magical incantations). Whether you’re rebuilding existing modules for GMod, or simply building new modules using a more consistent and easily-testable API, library writers are sure to find some use for this.
As it is, it’s basically ready for release, and I’ve tried to clean it up as much as possible. I’ve given it some testing with LPeg, LuaSocket, and LuaMD5 (pictures below, builds of those libraries included) and I’d like testers who can both try out the features of those libraries as much as possible, but even moreso, I’d like testers who can try it with as many other libraries as possible in order to really make sure that Vanillin works widely. If you use Vanillin or one of the sample libraries included with it, reply here with how it works out! I’ll try to get out an updated build within a day or two of learning about any new problems.
Basic knowledge of the build process will be necessary to use Vanillin.
Edit: Should’ve updated this text months ago…the sources ARE currently included.
No modification to sources! Vanillin takes the form of a static library, lua51.lib, which is a drop-in replacement for the normal Lua 5.1 DLL’s import library lua51.lib. Just re-link your program against that, give the files appropriate filenames to fit into GMod’s library-naming scheme, and you’re good to go!
Supports every function except the following:
lua_checkstack() (kinda? read the notes)
As well, the thread-manipulation functions are not supported currently, but may be in the future.
Aside from the ones listed, every function is supported, and matches “proper” behavior as closely as possible! Regular and light userdata are supported correctly, function upvalues are supported correctly, execution stack info is supported correctly, pseudoindices are supported correctly, **everything **(but check the instructions that come with the package for more details).
A test using the LPeg library that searches through every serverside Lua file, checking for any occurrence of a Garry syntax extension to Lua, noting the file, line, and type.
A test using the MD5 library created as part of the Kepler Project. It goes through every serverside Lua file and calculates a hash of it.
A test using both a GMod Lua and Vanilla Lua version of the LuaSocket library (and my own LuaWinCon library) that sends basic info regarding the gamemode name, map name, and some basic info about every player and NPC on the server, every tick, to somewhere else on the internet.
Latest version: Full Release 1
Works with: Garry’s Mod 13 Release (BUT, do read “Known Issues” below)
How To Use**
Instructions are included with the download.
Technically not a Vanillin issue, GMod 13’s require() function currently does not work with the Lua portions of many of the libraries you might try to get working with Vanillin. I’ve created a compatibility fix for this, which you can get here.
The first version I worked on was for GMod 12, and right as it was nearly finished, GMod 13 came out with a new API and I stopped working on it. It’s about 99% finished though, if in rather rough state, and since I’m not working on it anymore, I’m offering up the GMod 12 version of Vanillin, the sample libraries built with it (again, LPeg, LuaMD5, and LuaSocket), and the source code. I’m not supporting this library anymore, so I won’t make any updates to it, but feel free to ask questions about how it works.
Download GMod 12 Vanillin here. *Edit: fixed the package, it was missing a few files.
*Edit 2: And obviously, you cannot actually do anything with GMod 12 Vanillin anymore, it’s just here for historical purposes.
These are just from the unsupported GMod 12 version:
A simple test of LPeg.
A simple test of my LuaXInput library.
A simple test of the MD5 and DES56 libraries.
Wired Socket Radio, running using its original LuaSocket for the first time in many years.