How to set the “Require” path when embedded in Lua?

I embedded lua in the directory structure of my game engine and lua files, and I started to use a lot of lua scripts. I want to use “requrie” to optimize module inclusion, but I don’t Determine how to set the CPATH and PATH values, because I have embedded lua. How do I set it?

Also, since I need to find the module instead of the path, can I use * to view all subfolders of the folder and view each lua file? And can lua module files be “compiled” with structures?

Thank you!

You can set package.cpath and package.path. Wildcards are not supported in the path.

I embedded lua in the directory structure of my game engine and lua files, and I started to use a lot of lua scripts. I want to use “requrie” to optimize module inclusion, but I am not sure how to set it up CPATH and PATH values, because I have embedded lua. How do I set it?

Also, since I need to find the module instead of the path, can I use * to view all subfolders of the folder and view each lua file? And can lua module files be “compiled” with structures?

Thank you!

You can set package.cpath and package.path. Wildcards are not supported in the path.

Leave a Comment

Your email address will not be published.