i saw a video of someone using mods on a game called GTA 5. i was interested in making a menu that looks as good as there's. i then realised there menu was made in Lua and in-fact most mod menus are made in Lua, but GTA 5 was written in c and other languages. so my question is how come people use lua for modding most games and not c?
1 Answers
Lua is frequently used in games--Garry's Mod, mods for the original Star Wars Battlefront II, to name a couple--as an embedded scripting language; it is also used as an embedded language by other programs such as Wireshark and NMap.
Lua is implemented in pure ANSI C and it features a C API that allows it to be easily integrated into a C/C++ program. (The principal header files used are lua.h
, lualib.h
, and lauxlib.h
.) Despite its rather lightweight design, it is a robust, easy-to-learn language, making it an appealing choice for game developers that are embedding a scripting language into their games.
So, in summary, while the engine that GTA V runs on it indeed written in C/C++, Lua can easily be included over the top of it as an embedded language for modders to use.

- 464
- 4
- 13