Explicit errors for removed Lua features

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
mrudat
Fast Inserter
Fast Inserter
Posts: 229
Joined: Fri Feb 16, 2018 5:21 am
Contact:

Explicit errors for removed Lua features

Post 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.

Bilka
Factorio Staff
Factorio Staff
Posts: 3129
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Explicit errors for removed Lua features

Post 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.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Post Reply

Return to “Modding interface requests”