Joe
Joe

Reputation: 474

How do you set the "require" path when lua is embedded?

I have lua embedded in my game engine and a directory structure of lua files, and i am starting to use lots of lua scripts. I want to use "requrie" to optimize module includes, but i am unsure how to set the CPATH and PATH values because i have lua embedded. How can I set this up?

And also, since require looks for modules and not paths, can i use a * to look in all sub-folders of a folder, and does it look inside each lua file? and can the lua module files be "compiled" with the structure?

Thanks!

Upvotes: 4

Views: 2492

Answers (1)

lhf
lhf

Reputation: 72312

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

Upvotes: 6

Related Questions