Don't return zero-value signals in get_merged_signals
-
- Burner Inserter
- Posts: 9
- Joined: Fri Jun 14, 2024 12:33 am
- Contact:
Don't return zero-value signals in get_merged_signals
Instead of returning a signal with a count of 0, could get_merged_signals() instead leave the signal out of the list, and if there aren't any non-zero signals, just return nil?
My idea to detect changes is to have the iopoint linked to a lamp on a hidden surface, and the lamp would have a constant combinator connected to it with the other color of wire. Whenever a signal comes in, the mod will detect when get_merged_signals !=nil. The constant combinator would then negate the signal at the lamp so that the merged signal is once again nil.
- Stringweasel
- Filter Inserter
- Posts: 367
- Joined: Thu Apr 27, 2017 8:22 pm
- Contact:
Re: Don't return zero-value signals in get_merged_signals
If you're looking for an (relatively) easy way to detect curcuit events look at what this mod does: https://mods.factorio.com/mod/glutenfre ... ork-events
Alt-F4 Author | Factorio Modder
My Mods: Hall of Fame | Better Victory Screen | Fluidic Power | Biter Power | Space Spidertron | Spidertron Dock |Weasel's Demolition Derby
Official Contributor to Space Exploration
My Mods: Hall of Fame | Better Victory Screen | Fluidic Power | Biter Power | Space Spidertron | Spidertron Dock |
Official Contributor to Space Exploration
Re: Don't return zero-value signals in get_merged_signals
Implemented for 2.0: get_signals [due to rename] will not return signals with value of 0.