Page 1 of 1

Invalid chain signals show with wrong LuaEntity::chain_signal_state, and no equivalent for regular signals

Posted: Sun Nov 04, 2018 5:44 am
by dewiniaid
The API docs for chain signal states show:

Code: Select all

defines.chain_signal_state.none	Invalid, blinking.
defines.chain_signal_state.all_open	Green.
defines.chain_signal_state.partially_open	Blue.
defines.chain_signal_state.none_open	Red.
However, an invalid chain signal shows as "all_open" rather than "none". Tested in a simple circle of rail with a single chain signal, and with a chain signal placed far away from any rail.

Rail signals behave in a similar fashion, but lack their own 'invalid' definition.

Re: Invalid chain signals show with wrong LuaEntity::chain_signal_state, and no equivalent for regular signals

Posted: Sun Nov 04, 2018 4:39 pm
by Rseding91
That's just a case of the documentation bring wrong. Chain signals can either have "none" or "green" when invalid. The state doesn't always match the actual color you see in the world since that's just rendering logic.

Re: Invalid chain signals show with wrong LuaEntity::chain_signal_state, and no equivalent for regular signals

Posted: Fri Nov 09, 2018 11:22 am
by Rseding91
Ok. I just removed the docs for chain signal state because no matter how I worded them it seemed like it would just add confusion.

The "none" state should never happen when a mod goes to read the state. However, it exists as a state the signal can be in at least while it's being updated so it's included in the lua defines.

A chain signal is in the "open" state when it has no valid setup and blinks only visually.