LoTROInterface

LoTROInterface (https://www.lotrointerface.com/forums/index.php)
-   Lua Programming Help (L) (https://www.lotrointerface.com/forums/forumdisplay.php?f=50)
-   -   Lua and "import" (https://www.lotrointerface.com/forums/showthread.php?t=4040)

Morgantine 09-09-2023 11:27 PM

Lua and "import"
 
Where is the "import" command defined? It doesn't seem to be a standard Lua command; standard Lua seems to use "require" instead. Is it a Turbine thing?

Garan 09-10-2023 10:18 AM

Quote:

Originally Posted by Morgantine (Post 13217)
Where is the "import" command defined? It doesn't seem to be a standard Lua command; standard Lua seems to use "require" instead. Is it a Turbine thing?

Yes, it is a Turbine thing. Note, it does not only allow gaining access to user defined .lua source files, it also determines what portion of the built-in tables/methods (and their underlying C objects) are accessible to each apartment - if you don't import Turbine.Gameplay, for instance, you will not have access to anything defined there, but your plugin will have a smaller memory footprint (unless another plugin loaded into the same apartment did import Turbine.Gameplay).


All times are GMT -5. The time now is 06:03 AM.

vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI