ElunaLuaEngine / Eluna

Eluna Lua Engine © for WoW Emulators
https://elunaluaengine.github.io
GNU General Public License v3.0
372 stars 356 forks source link

Add Lua package path setup script #456

Closed iThorgrim closed 6 months ago

iThorgrim commented 7 months ago

This commit introduces a script that updates the package.path and package.cpath variables in Lua. These updates allow Lua to know where it should look when requiring modules. The script is designed to work with both LuaJit and standard Lua interpreters and adds several commonly used directories to the paths.

Foereaper commented 6 months ago

I am thinking that this might be better to introduce as a config variable in the world config. The following PR introduces the use of the cpath, and it populates it dynamically with paths scanned from lua_scripts. We could expand this logic to take in a configured path string as well as the scanned paths. This would probably be more transparent for the end users.

https://github.com/ElunaLuaEngine/Eluna/pull/460