Does a game have to have built-in functions to accept and run lua scripts, or can I design Events and Hooks using Lua on any game I please, akin to the days where C code could be used to hook into the WinAPI using dlls?
The reason I ask is, I am trying to create a background application that will perform events and hooks on a particular game that does not currently support lua in-game.
Events: - An action executed by the PLAYER is detected. For instance, hitting the Q key will normally make my character use an ability, but with my Lua script running in the background, will cause a sound to play on my computer (or something).
Hooks: - An action within the GAME is detected. For instance, the game spawns an enemy every minute. When an enemy spawns, the script will detect this and perform an action, for instance playing a sound locally on the computer.
I would like to do both, but I know for games like Garry's Mod, the game already has built-in support for running lua scripts.
Is there a way to do either events OR hooks using lua similarly to how C/C++ can connect to a game using WinAPI dlls?