Factorio

Factorio

Ver estatísticas:
Combinators are difficult and illogical.
So, I want to count the number of trains that have passed a signal and reset the counter if the number is higher than a specific amount (say 10).

If the train signal turns red, I want a single pulse to be given and counted.
Then, when the counter is at a certain number, I want it to reset.

Sooooo... how the F do I do this ingame?

I'm stuck really, because how do I convert a constant signal to a single-tick pulse ingame?
And how do I reset a counter?

< >
Exibindo comentários 110 de 10
HuggernautNL 20/fev./2017 às 5:52 
Also,

How do I send a signal that is 0? Because to be able to reset, you need to right?
I can't tell the counter to substract itself, because that will make the counter keep jumping to an active/inactive state because of the 60tick/s rule in the game.

Última edição por HuggernautNL; 20/fev./2017 às 5:52
Ruges 20/fev./2017 às 5:57 
Not sure if this would be the best way to do it.

But you have the pulse signal going to the arithmitic com that is counting every train that goes by. This outputs to what ever your trying to send a signal too. But it also sends a signal to a decider com that when the signal equals 10 it sends a signal to a power switch. The power switch then powers an artmitic com that sends a signal of negative 10 to your first arithmitic com.

Make sense? or should I do a picture?
AlexMBrennan 20/fev./2017 às 6:10 
Sooooo... how the F do I do this ingame?
What you want to do is build an edge detector(background[www.allaboutcircuits.com]) - output 1 if the current state is red and the previous state is not red. http://steamcommunity.com/sharedfiles/filedetails/?id=868434148

And yes, logic is difficult - that's why we now use high level programming languages instead of manually drawing equivalent circuit board designs.

And how do I reset a counter?
You will need 2x decider, 1x arithmetic combinators:
Use 1x decider to output 1 of a dummy variable when you want to reset, multiply the signal by -1, and add that to a decider connected to itself set to ALL > 0.
That way, the decider will keep whatever value it is set to until such a time that the dummy negative input triggers a reset.

How do I send a signal that is 0? Because to be able to reset, you need to right?
You should probably use 1 for true and -1 for false (which requires two extra combinators)

And yeah, combinators could be less cumbersome if you had more options (e.g. output current value or a constant instead of the current value or 1 we have right now), but it makes a certain amount of sense to force the player to build these with physical blocks instead of having a singly block that can run a C# script because Factorio is a game where you build systems by physically placing lots of entities on the map.

On a related note, if you have been watching reddit you might have seen the GreyGoo Mk1, featuring a version of BASIC implemented using blueprintable combinators. https://imgur.com/a/Ewhsv
You really can do a lot with these combinators.
Última edição por AlexMBrennan; 20/fev./2017 às 7:57
HuggernautNL 20/fev./2017 às 7:12 
Escrito originalmente por Ruges:
Not sure if this would be the best way to do it.

But you have the pulse signal going to the arithmitic com that is counting every train that goes by. This outputs to what ever your trying to send a signal too. But it also sends a signal to a decider com that when the signal equals 10 it sends a signal to a power switch. The power switch then powers an artmitic com that sends a signal of negative 10 to your first arithmitic com.

Make sense? or should I do a picture?

Yes this makes sense, except that for every tick it takes for the signal to move the counter will be set off by 1 as well.

So if it takes 5 ticks for the signal to move around, the end result is not 10 but 15.
HuggernautNL 20/fev./2017 às 7:45 
This is seriously ♥♥♥♥♥♥ up guys.

Signal red, counter A goes to 4, at count=2 counter B adds 1 (to be able to count per tick).
When signal goes back to green and counter A=4 then take signal A*-1 and add back into counter A.

Now when I test this.... counter A goes to -4 ?!?!?!?!?!

WHYYYY OH GOD WHYYYY ????
Última edição por HuggernautNL; 20/fev./2017 às 7:46
AlexMBrennan 20/fev./2017 às 8:15 
Are you still working on the train counter? If so then try this
http://steamcommunity.com/sharedfiles/filedetails/?id=868440372
http://steamcommunity.com/sharedfiles/filedetails/?id=868444566

Edit: Maybe a composite image is easier to understand? http://steamcommunity.com/sharedfiles/filedetails/?id=868470819
Thanks Steam for making it easy to post helpful images btw. </sarcasm>
Última edição por AlexMBrennan; 20/fev./2017 às 9:00
HuggernautNL 20/fev./2017 às 8:21 
Escrito originalmente por AlexMBrennan:
Are you still working on the train counter? If so then try this
http://steamcommunity.com/sharedfiles/filedetails/?id=868440372
http://steamcommunity.com/sharedfiles/filedetails/?id=868444566

Call me an idiot, but I don't get it...
HuggernautNL 20/fev./2017 às 8:28 
Also,

I managed to make a counter, its an arithmic cell that feeds into itself and is set to input A+0 output A.

Now the real challenge is, how do I reset this thing back to 0? NOT FCKGN -4 ....
HuggernautNL 20/fev./2017 às 8:43 
OMG, I feel like a huge idiot now.

All this time I was using an arithmic operator and not a decider as my counter.
The arithmic one doesnt reset obviously....

And that trick of yours is quite ingenious Alex, using those two deciders the signal Red=2 will only be alive 1 tick...
Última edição por HuggernautNL; 20/fev./2017 às 8:43
impetus_maximus 20/fev./2017 às 15:47 
Escrito originalmente por HuggernautNL:
Also,

I managed to make a counter, its an arithmic cell that feeds into itself and is set to input A+0 output A.

Now the real challenge is, how do I reset this thing back to 0? NOT FCKGN -4 ....
that is a memory cell. that is a huge step in the right direction.
< >
Exibindo comentários 110 de 10
Por página: 1530 50

Publicado em: 20/fev./2017 às 5:35
Mensagens: 10