Combinators

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Doylecan
Burner Inserter
Burner Inserter
Posts: 6
Joined: Thu Aug 02, 2018 1:38 am
Contact:

Combinators

Post by Doylecan »

Hello all,

First post, I have played for approx 300 hours, searched the forums, gone through the wiki, visited various sites and watched dozens of hours of youtube tutorials and have not been able answer my idea for outposts. I have an isolated, looped yellow belt travelling the interior perimeter of each of my outposts and my main base, supplying gun turrets with piercing rounds (as well as artillery shells) via yellow inserters. I supply my outposts via train bringing flamethrower turret fuel, walls, etc and have inserters pulling off a cargo wagon the necessary replacement items with circuit network conditions and bots repairing and replacing what is needed. What I really want to set up is a counter for the loop that I can then connect to an inserter which will pull piercing rounds from a chest (supplied from the train) when my entire loop falls below 100 (or whatever # I decide) total rounds on it. I haven't used combinators for anything complicated and I've read up on them extensively but to no avail, or at least the setup is above my pay-grade. My biggest outpost belt loop right now is only 650 long, I really enjoy using trains, belts, artillery and skimp on laser turrets many for the fun of supply logistics so I'd sure like to learn how I can achieve this through circuit network conditions. I understand, at least at an intermediate level in my opinion, the terminology and mechanics of the game but advanced combinator rules I could use more knowledge. My screenshot probably isn't necessary but as you can see, my yellow inserter feeds onto the input lane which dumps onto the loop. Thanks in advance.
Attachments
Screenshot (4).png
Screenshot (4).png (4.78 MiB) Viewed 6110 times
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3722
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Combinators

Post by DaveMcW »

Connect 2 adjacent belts with a green wire. This turns them into scanner belts.

Click each belt and set:
Enable/disable: OFF
Read belt contents: ON
Content read mode: Hold

Create a blueprint of the 2 belts, and drag it along your entire loop. You can now read the contents.
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3722
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Combinators

Post by DaveMcW »

Since an entire loop of scanner belts is rather ugly, we can use math to reduce the number needed.

You want 100 ammo divided among 650 belts, that works out to 1 ammo per 6 belts.

Wire 6 belts together, read the contents and connect it to the inserter. Set the inserter to only operate when ammo = 0. Also restrict stack size to 1.

For best results, run the loop past the inserter and put the 6 scanner belts directly after the inserter to reduce feedback delay.
Doylecan
Burner Inserter
Burner Inserter
Posts: 6
Joined: Thu Aug 02, 2018 1:38 am
Contact:

Re: Combinators

Post by Doylecan »

I did set up as you've instructed and I had thought of doing this but I was wondering if there was a way to set up a counter for a set time frame related to the number of belt tiles in my loop. This will have to suffice and is not difficult, just time consuming. The concern with only doing 6 belts is there may be a large firefight and an entire section of ammo may get gobbled up by spent turrets, or a section of belt may be destroyed, until replaced, would affect the effectiveness of the smaller version, although this concern would exist for a counter/timer as well, I think ugly is ok for me if it gives me less stress of running out and paying the consequences of a severely damaged outpost. Thanks for the help Dave.
Zavian
Smart Inserter
Smart Inserter
Posts: 1649
Joined: Thu Mar 02, 2017 2:57 am
Contact:

Re: Combinators

Post by Zavian »

Personally, if I wanted to do something like this, I would use a loop with a 3 tile gap. Add a chest in the middle of that gap, with an circuit controlled inserter grabbing from a chest and depositing on the perimeter loop, and another inserter grabbing from the other end of the loop and depositing back in the chest. Circuit control the inserter depositing onto the loop so that it can only swing once every three seconds or whatever rate is appropriate. (Even simpler just use a yellow inserer with the stack size set to one item per swing). That isn't quite what the OP wanted but is simple and robust, and more UPS performant than reading the entire belt.
Zanthra
Fast Inserter
Fast Inserter
Posts: 232
Joined: Fri Mar 25, 2016 8:18 am
Contact:

Re: Combinators

Post by Zanthra »

You could wire all the inserters leading to the guns back to the center unload point, and set them to read contents of hand. Whenever an inserter is holding ammo feeding it to a gun (piercing rounds > 0) then another inserter is unloading from boxes onto the loop. This gives a head start to unloading onto the belt, and can help keep things supplied in a big firefight (inserters constantly holding ammo). You can then use the belt detection methods to handle any shortfall with the associated delays.

If you want to build a counter/timer system:

An item travels across one yellow belt in 32 ticks. So if you create a counter that times 32 * yellow belt tiles, you can get a timer that gives you one full revolution. Now build a second counter, but instead of counting ticks, wire it to a segment of transport belt set to pulse mode. This counts the number of items that pass that tile. Now wire the first counter to trigger a shift of the loop counter into a storage register, and reset the loop counter once each revolution. Then you can use that register to decide how many piercing rounds magazines to unload onto the belt. If I recall correctly, an inserter only needs a single tick pulse to transfer one item, so use a third counter to send one pulse every few seconds to an inserter, and a fourth counter to only fill the belt from the last loop count register to the desired value. The issue is of course there is a full rotation of delay before more ammo can be added.

Timers and counters consist of just a decider combinator with it's output wired to it's input. The added value for each tick can come from a constant combinator with T = 1. Then the decider can be T < 500 (for example) ouput T. Each tick the output of the constant combinator, 1, is added to the output of the decider, last ticks value, and it rises by 1 until the decider stops outputing T because it's too large, at that tick it's just 1 and it starts over. You can use the T = 1 signal to trigger other circuits. Belt counter would work the same, with the belt on pulse mode input into the decider instead of a constant. Set the decider absurdly high, like Piercing Rounds < 1000000. Then you can reset by sending a signal of 1000000 piercing rounds.
The Eriksonn
Fast Inserter
Fast Inserter
Posts: 230
Joined: Wed Jun 08, 2016 6:16 pm
Contact:

Re: Combinators

Post by The Eriksonn »

Or you could have a dummy item on the belt, iron plate maybe, and using that to see if there has passed 100 ammo for every lap of the iron
Zanthra
Fast Inserter
Fast Inserter
Posts: 232
Joined: Fri Mar 25, 2016 8:18 am
Contact:

Re: Combinators

Post by Zanthra »

The Eriksonn wrote:Or you could have a dummy item on the belt, iron plate maybe, and using that to see if there has passed 100 ammo for every lap of the iron
That's clever, especially if you are expanding the gunwall to cover more area, you don't have to go back and change the combinator options.
mrvn
Smart Inserter
Smart Inserter
Posts: 5952
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Combinators

Post by mrvn »

Zanthra wrote:
The Eriksonn wrote:Or you could have a dummy item on the belt, iron plate maybe, and using that to see if there has passed 100 ammo for every lap of the iron
That's clever, especially if you are expanding the gunwall to cover more area, you don't have to go back and change the combinator options.
But do you really only want 100 ammo on the belt no matter the size? Isn't 1 ammo per 10 tiles better? A larger base has more turrets and gets attacked more. So you want more ammo on the belt so that some ammo is near every turret and reload times remain constant at every size.
Zanthra
Fast Inserter
Fast Inserter
Posts: 232
Joined: Fri Mar 25, 2016 8:18 am
Contact:

Re: Combinators

Post by Zanthra »

mrvn wrote:
Zanthra wrote:
The Eriksonn wrote:Or you could have a dummy item on the belt, iron plate maybe, and using that to see if there has passed 100 ammo for every lap of the iron
That's clever, especially if you are expanding the gunwall to cover more area, you don't have to go back and change the combinator options.
But do you really only want 100 ammo on the belt no matter the size? Isn't 1 ammo per 10 tiles better? A larger base has more turrets and gets attacked more. So you want more ammo on the belt so that some ammo is near every turret and reload times remain constant at every size.
I don't tend to play enough with biters to know. It may be clever, but not applicable.

One interesting possibility would be to have an inserter that unloads single iron plates onto the belt, attached to another counter such that if it has not seen an iron plate in N * 2 tiles, it places one on the belt N tiles ahead of the sensor and subtracts N from the clock. When an iron plate it seen the clock resets completely. This maintains each section between N and N * 2 tiles long automatically if the belts grow in length (does not remove iron plates, so needs to be manually adjusted to shrink. The ammo loader counts the ammo on each section, and sends the signal to the loader placed such that it's N tiles from the end of the section just counted.

Perhaps better just to time each section, and use the one iron plate to reset the clock such that if the entire belt is not a multiple of your section length it does not change the section boundaries. Any expansion of the wall would change section boundaries, but that may lead to some sections having too much ammo, but expanding the wall probably happens less than the loop makes full revolutions.

Of course this all perhaps more complex than the OP really wanted in the end.
Doylecan
Burner Inserter
Burner Inserter
Posts: 6
Joined: Thu Aug 02, 2018 1:38 am
Contact:

Re: Combinators

Post by Doylecan »

Thanks all for the input, I do like the idea of a counter/timer*belt idea but the more I think about the negative possibilities that can happen in 1 revolution of the loop, the more I like the ugly option. (I don't think it's that ugly in relation to its practicality) I like using Artillery so supplying 1 or 2 Artillery cannons at an outpost with shells on the same loop really leans me to using the idea Dave originally suggested. I can trust it completely as long as my supply train is always supplied. I still want to learn more about combinators though so keep talking. For anyone wanting to utilize the completely wired up loop, I made a blueprint of 5 consecutive wired belts with 'read belt contents' and 'hold' conditions, I connected by hand, the corner belts (the last belt into corner and first belt running perpendicular) and the input and output of underground belts, I didn't test but I was just being thorough. It really didn't take long at all. Added a couple screenshots just for fun.
Attachments
Screenshot (8).png
Screenshot (8).png (2.1 MiB) Viewed 6007 times
Screenshot (7).png
Screenshot (7).png (1.31 MiB) Viewed 6007 times
Screenshot (6).png
Screenshot (6).png (4.11 MiB) Viewed 6007 times
mrvn
Smart Inserter
Smart Inserter
Posts: 5952
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Combinators

Post by mrvn »

My solution is to only wire up the T junction bit of your screenshots. Set the passing belt to read content for a bunch of tiles and the supply belt to enable when ammo < 10. Do the same again with artillery shell < 1, repair pack < 1, turret < 1, belt < 1, stone wall < 1.. whatever else you want on the belt. You can use different sides of the belt too.

Also every so often have a passive provider chest that takes repair packs, turrets, belts and stone walls from the belt if below some limit. Those are for the construction bots to repair damage or replace items over time.
Post Reply

Return to “Gameplay Help”