My idea its like require('module') but not equal.
In open tibia, change somethings in source to able to use some DLL just for Open Tíbia, and in this dlls there are c++ functions but with luaL_register to use in scripts.
This an example:
I have an dll called my_functions.dll and insite i have this functions registred to lua: getCreatureMaxHealth and setCreatureMaxHealth, so i set it on script:
lua Code:
It is easier to post, to install, or sell a script for another person.
You just send the DLL and script, all need functions its inside the DLL and you dont need recompile your server.
In open tibia, change somethings in source to able to use some DLL just for Open Tíbia, and in this dlls there are c++ functions but with luaL_register to use in scripts.
This an example:
I have an dll called my_functions.dll and insite i have this functions registred to lua: getCreatureMaxHealth and setCreatureMaxHealth, so i set it on script:
lua Code:
local dat = loadDll('my_functions.dll')
print(dat.getCreatureMaxHealth(creature))
It is easier to post, to install, or sell a script for another person.
You just send the DLL and script, all need functions its inside the DLL and you dont need recompile your server.