Page 1 of 1

Explicit errors for removed Lua features

Posted: Sat Dec 28, 2019 12:29 am
by mrudat
TL;DR
It would be nice if the Lua environment would immediately error when attempting to use a removed feature.
What?
As an example, coroutines are disabled in the control phase, but the error when attempting to use them didn't actually state that, and I had to look around on the forum to find out that the feature was removed on purpose.

I believe that it should be feasible to cause any attempt to access the value of coroutine to emit an error that, "Coroutines are disabled", possibly with a link to a page listing (all of) the ways in which the Lua environment differs from a vanilla interpreter.
Why?
So future mod authors don't spend hours tracking down why their code doesn't work.

Re: Explicit errors for removed Lua features

Posted: Mon Nov 27, 2023 2:34 pm
by Bilka
The docs are better now (https://lua-api.factorio.com/latest/aux ... aries.html) but I agree that erroring more clearly would be nice.