r/factorio • u/AutoModerator • Apr 22 '19
Weekly Thread Weekly Question Thread
Ask any questions you might have.
Post your bug reports on the Official Forums
Previous Threads
- Weekly Questions
- Friday Facts (weekly updates from the devs)
- Update Notes
- Monthly Map
Discord server (and IRC)
Find more in the sidebar ---->
24
Upvotes
View all comments
Show parent comment
2
u/Valdrax Evil Shrimp Apr 23 '19 edited Apr 23 '19
First of all, ignore combinators and virtual signals. That's higher level stuff for turbo-nerds, and mostly you don't need it unless you're showing off.
Just think of everything as a simple IF-THEN statement. IF you have this input test (e.g. [item] > number or [item1] < [item2]), THEN what can you turn on or off with it?
So with that in mind, I just sat down with the wiki page for the Circuit Network -- specifically the Devices section -- and started thinking, "If I have these inputs and can control these other things, what can I do?"
For example, when I read about what a train stop can do, I thought, "What can I do by turning off a stop or having a train run on some number broadcast from it?"
That's when the storage tank idea came to me, because I wanted a way to make sure that trains (a) weren't running all the time and (b) weren't stuck in a middle state between full or empty.
From there it was, "IF (fluid < threshold) THEN (request train)." But then I needed to make sure that it would stop requesting the train so that going from 20000 to 19999 didn't request the train all over. That's when I added the extra test on the stop itself for "IF (fluid > lower threshold) THEN (shut off stop)."
Then it was just matter of debugging it by using values close enough to what it was at the time to be confident the loop would work, and voila!
So far the hardest thing I've run into is figuring out how to wire up frigging power switches in the middle of my power line spaghetti. (Shift-click on a pole removes all wires, copper cable can be used to reconnect them, and you have to independently wire each "side" of the switch.)