Rick Posted July 26, 2016 Share Posted July 26, 2016 Using require in sandbox mode has failed. Im wondering why because many useful Lua libraries, if not all, use require. But in leadwerks that doesn't work. Is there any way we can get require working in leadwerks so we can use these pure Lua libraries that exist that can help make things easier for us? I can help change the way ppl make ai in leadwerks easier if this works. 2 Quote Link to comment Share on other sites More sharing options...
Josh Posted July 26, 2016 Share Posted July 26, 2016 Is this for loading DLLs? Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Rick Posted July 26, 2016 Author Share Posted July 26, 2016 No, just pure Lua libraries. All are built using require. package.loadlib() is how you load dlls and I totally get not allowing that but require should be safe to load just Lua libsraies. Quote Link to comment Share on other sites More sharing options...
Josh Posted July 26, 2016 Share Posted July 26, 2016 Where can I download one of the libraries you want to use? Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Rick Posted July 26, 2016 Author Share Posted July 26, 2016 https://github.com/tanema/behaviourtree.lua Quote Link to comment Share on other sites More sharing options...
Josh Posted July 26, 2016 Share Posted July 26, 2016 Okay, so it works in non-sandbox mode as expected, and does not work in sandbox mode, right? Just to be clear. I think it might be because the i/o module is disabled in sandbox mode. Also, this won't work with zip-encrypted games. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted July 26, 2016 Share Posted July 26, 2016 You can still use Import, but I think require is dependent on the IO module. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Rick Posted July 26, 2016 Author Share Posted July 26, 2016 the problem with import is that we would have to go thru each library and change it from using require, because they all use require internally, and I've tried that and it's a pain in the *** and it's error prone. Is there any way you can make le's own version of require so these will work? When require is used the module can return the object from the source. Import doesn't seem to allow that and so we have to go in and heavily modify these libraries to work differently for le which sucks. So for example try to use import in that library and try to create an object like in the example page on git and you'll see you quickly go down a rabbi hole of modifying every file and how it works to get the thing to work in le and hope what you just did didn't screw something up. 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.