I'm running an AzerothCore server for personal access over LAN. I have the server running on docker as per the setup provided on the official website. I've also managed to attach the Eluna lua enging via the module provided on the AzerothCore GitHub.
I can see that Eluna has been successfully compiled with the worldserver, as I get this message following a call to docker-compose up:
ac-worldserver_1 | [Eluna]: Executed 0 Lua scripts in 0 ms
I also have no problems logging in via a client and playing normally.
Now, the problem I'm encountering is that I cannot seem to find where to place my lua scripts so that they will be used by the server. Digging through config files, I found this parameter in azerothcore-wotlk/modules/mod-eluna-lua-engine/conf/mod_LuaEngine.conf.dist:
Eluna.ScriptPath = "lua_scripts"
This constant is loaded into the main LuaEngine.cpp file, so I'm convinced this is the right place to be looking. However, there is no lua_scripts directory in the entire repository, including the attached module. I've tried placing it (and a basic hello_world.lua script) in multiple subdirectories to no avail. Thinking it might be found outside the repository due to the use of docker, I ran sudo find / | grep lua_scripts and found a copy of the folder in this very inaccessible location:
/var/snap/docker/common/var-lib-docker/overlay2/3d7f9d1de6602baf9a33ee24333ecdf01d537c2b7b439e90d645ff9643bfdd07/diff/azeroth-server/bin/lua_scripts
Obviously this is only accessible via sudo, and I cannot easily use this location for development purposes.
As a last resort, I tried changing the Eluna.ScriptPath constant to an absolute path in the repository, but this was also unsuccessful. No scripts loaded, no hello world on login. Anyone know where I might look or place the directory?
For reference, the hello_world.lua:
local PLAYER_EVENT_ON_LOGIN = 3
local function OnLogin(event, player)
player:SendBroadcastMessage("Hello world")
end
RegisterPlayerEvent(PLAYER_EVENT_ON_LOGIN, OnLogin)
I fixed this by binding the
lua_scriptsfolder in thedocker-compose.ymlby addingin the
volumessection ofdocker-compose.yml. I put it right under theworldserver/binbind.Then in
docker/worldserver/etc/mod_LuaEngine.confsetEluna.ScriptPath = "/azeroth-server/bin/lua_scripts"and put your scripts indocker/worldserver/bin/lua_scripts.