Lua 'require' module/library functionality in LY

0

Hello all,

I'm looking to use the 'require' functionality in Lua (as described here) as in this example:

mymodule = require "mymodule"
mymodule.foo()

to utilise Lua's version of libraries (modules) in Lumberyard, however I'm getting the following error when attempting to do so:

[Warning] levelname/scripts/test.lua:5: module 'mymodule' not found:Module "mymodule.luac" has not been registered with the Asset Database.---------- START STACK TRACE ---------- ---------- END STACK TRACE ----------

I get the feeling that this functionality is not implemented for use in Lumberyard? Could this please be confirmed if so, or insight given as to the proper way to achieve this effect in LY if implemented differently?

Thanks a lot,

Alex

質問済み 7年前205ビュー
5回答
0
承認された回答

Hey @REDACTEDUSER FileName: mymodule.lua

REMOVEDUPLOAD

FileName: lua_test.lua

Output:

Note: There is a known bug where lua files do not reload into the Lua Script component after we make changes to the scripts. For this, we simply need to re-browse for the Lua file in the Lua Script component to load the latest changes. We are working on fixing this issue ASAP —

Hope this was helpful!

回答済み 7年前
0

Bumping this hoping for an answer, it's proving to be a blocker to implementing functionality!

回答済み 7年前
0

Hey @REDACTEDUSER

回答済み 7年前
0

Thank you @REDACTEDUSER

回答済み 7年前
0

i still get the: "has not been registered with the Asset Database." error when trying load a module (1.9.0.1)

Thanks

回答済み 7年前

この投稿はクローズされています。新しい回答、コメント、投票の追加はできません。

関連するコンテンツ