System API availability

crash, gui, go, profiler, render, sys — seems to be always available right after app start.
resource, window — available a little later.

That way we can’t, for example, write

local resource = resource

in script/module files — sometimes resource is nil at that times.
Why is this?

Really? Hmm, you’re doing the check outside the lifecycle functions or in init()?

In module outer scope and in render_script init().
I see no reason for resource to be not available here.

True, not sure. @sven?

up

I’d say there’s no real reason, other than that it wasn’t considered, and currently the render script is initialised before the other modules.

2 Likes