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

This subforum contains all the issues which we already resolved.
Post Reply
dewiniaid
Long Handed Inserter
Long Handed Inserter
Posts: 96
Joined: Tue Mar 07, 2017 8:50 pm
Contact:

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

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

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post 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.
If you want to get ahold of me I'm almost always on Discord.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post 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.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Resolved Problems and Bugs”