I want to reload lua scripts at run-time. What are the ways to do this? Do you just have to reinitialize the lua system and then re-read all the lua files?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If (a) the Lua scripts are in modules, and (b) the modules don’t affect globals or tables outside the scope of the module, you can use
package.loaded.????? = nilto causerequireto reload the module:Similarly, if the non-module scripts are well behaved in that they (a) only define a single table, and (b) don’t affect globals or other tables, then simply reloading the script will work as well.