I would like to store information like render.get_window_width() so that scripts outside of the render script can access it. There are a few posts that suggest using a Lua module to hold this information. I’m trying to do this using the following line (which works in my other scripts):
require "scripts.renderer_helper";
The error I’m getting back is:
ERROR:SCRIPT: custom_render/custom.render_script:1: module 'renderer_helper' not found: no file 'renderer_helper'
How do I load a module in the render script? Or am I going about this the wrong way?
I know Defold can see the renderer_helper.lua script because my input_test script is able to load and access the information inside. It seems like something different about the custom.render script works with require.
It’s actually not stupid. Semi-colons are not forbidden. In Lua you can use semi-colons to have multiple statements on a single line. On the other hand I wouldn’t say that it is encouraged and you will rarely see it used.
During our build process we scan all script files for require() statements to get a list of all *.lua files to include in the build, and it seems like that semi-colon confused our build tool.