Detecting belts stopped by circuit conditions
Posted: Thu Apr 11, 2019 6:21 pm
I need to know when a belt stops due to a circuit condition.
My best idea so far is thus:
First, keep track of which belts are connected to the circuit network by...
A) Poll entities near the player cursor if the player is holding a wire, to find out if circuit connections are created or removed. I saw code to do this recently and have lost it.
B) Events to detect entity destruction, entity and wire creation via bots, etc
C) Being sad if a mod creates a wire connection that we can't detect, or adds a controlbehavior to a belt with no wires. maybe poll all belts in the game every minute or two if we suspect this could happen?
Then every tick poll all the belts connected to the circuit network to see if they are on/off.
I'm hoping someone here can recommend a better approach.
My best idea so far is thus:
First, keep track of which belts are connected to the circuit network by...
A) Poll entities near the player cursor if the player is holding a wire, to find out if circuit connections are created or removed. I saw code to do this recently and have lost it.
B) Events to detect entity destruction, entity and wire creation via bots, etc
C) Being sad if a mod creates a wire connection that we can't detect, or adds a controlbehavior to a belt with no wires. maybe poll all belts in the game every minute or two if we suspect this could happen?
Then every tick poll all the belts connected to the circuit network to see if they are on/off.
I'm hoping someone here can recommend a better approach.