Crates.io | rglua |
lib.rs | rglua |
version | 3.0.0-beta2 |
source | src |
created_at | 2021-11-26 06:23:13.729812 |
updated_at | 2022-04-01 00:05:27.117889 |
description | Toolkit for garrysmod development with the source sdk and luajit api |
homepage | |
repository | https://github.com/Vurv78/rglua |
max_upload_size | |
id | 487927 |
size | 122,519 |
rglua
This is a crate that allows interop with the (g)luajit c api as well as the source sdk through libloading and vtable bindings. You can then use these for binary modules or manually injected code, like with Autorun-rs
More information on binary modules can be found on the garrysmod wiki: Creating Binary Modules and examples can be found here.
If you are targeting 32 bit make sure to install the toolchain and build to it:
rustup target add i686-pc-windows-msvc
cargo build --target=i686-pc-windows-msvc
There are actually a decent amount of libraries out there for gmod development. Here's a comparison and why you could use this one.
Library | rglua | rust-glua-sys | gmod-rs | gmrs |
---|---|---|---|---|
Full Lua C Api Bindings | ✔️ | ❌ | ❌ | ❌ |
On Crates.io | ✔️ | ❌ | ✔️ | ❌ |
Proc Macros | ✔️ | ❌ | ✔️ | ✔️ |
Interfacing w/ Source SDK | ✔️ | ❌ | ❌ | ❌ |
Returning Result<> from functions | ✔️ | ❌ | ❌ | ✔️ |
Can be used on stable | ✔️ | ✔️ | ❌ | ✔️ |
Real world examples | ✔️ | ❌ | 〰️ | ✔️ |
Linux / OSX Support | ✔️ | ❌ | ✔️ | ✔️ |
Github Stars | 😢 | 👍 | 👑 | 🤷♂️ |
You can help with that last one 😉
This is heavily based off of garrysmod_common, in how we export the lua_shared functions and trying to replicate everything from the Lua C Api.