An engine mod for Quake Enhanced that adds plugin/scripting capabilities via C# and Lua.
QuakePlugins is no longer in development and being superceded by QuakeReloaded and Reloaded-II
Plugins repo: QuakePlugins.Plugins
Some documentation: Wiki
- When running QuakePlugins.exe, it will find the quake process and inject a C++ dll.
- The C++ dll then will load .NET host allowing it to load C# dll.
- C# dll then creates hooks and interops with the engine (using Reloaded.Hooks)
- External C# dlls (using native .NET) and Lua scripts are then loaded (using NLua)
- .NET 6.0
- Download the build from the Github releases.
- Extract into a folder somewhere on your computer
- Download plugins or write your own. Make sure you place them in the right place (
<Quake folder>/rerelease/_addons/<plugin name>/main.lua
) - Start game
- Run QuakePlugins.exe, it will now inject itself into the game and load the plugins + runtime. Check console and you should be able to see a bunch of output.
- Done!
You can find another repo with examples and misc plugins here: QuakePlugins.Plugins
Plugins should be installed in the following folder: <Quake folder>/rerelease/_addons/<plugin name>/main.lua
Example plugin:
-- Register a new cvar
local cvar_lua_grenadeexplode = Cvars.Register("lua_grenadeexplode","1.0","Some testing cvar from lua");
function QC_GrenadeExplode()
-- Only print to console if the cvar is set to 1
if cvar_lua_grenadeexplode:GetBool() then
Console.Print("[Lua] A grenade exploded!\n");
end
end
-- Hook into GrenadeExplode QC function
Hooks.RegisterQC("GrenadeExplode",QC_GrenadeExplode);
-- A 'hello world' based on your name
Console.Print("[Cvar] Hello, " .. Cvars.Get("cl_name"):GetString() .. "\n");