"2" is considered False when using AND/OR combinators

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Mabbus
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sun Apr 24, 2016 1:05 pm
Contact:

"2" is considered False when using AND/OR combinators

Post by Mabbus »

This has bugged me for years, I guess it´s intended and not a bug since its pretty obvious, but I dont see the reason for it.

If you make a combinator with for example condition A OR B, it will only consider A as True if it has the value 1. If it has the value 2 or more it is considered False.

It would simplify many of my designs if 2 was considered True.
I think it could work in one of two ways to make sense. I prefer the first, but both is fine.

First acceptable way:
Zero or smaller = False
Bigger then zero = True

Second acceptable way:
0 = False
every other number = True

Is there a reason for the current functionality or am I just the only ones who is disturbed by this?
Rseding91
Factorio Staff
Factorio Staff
Posts: 16276
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: "2" is considered False when using AND/OR combinators

Post by Rseding91 »

I have no idea what you’re referring to, do you have a save file or screenshots?
If you want to get ahold of me I'm almost always on Discord.
Kyralessa
Filter Inserter
Filter Inserter
Posts: 751
Joined: Thu Sep 29, 2016 5:58 pm
Contact:

Re: "2" is considered False when using AND/OR combinators

Post by Kyralessa »

Mabbus, you do know that AND/OR/XOR are bitwise, not boolean, right?

If you do A=5 AND B=6 and output as C, you'll get C=4. This is because the bit positions are 1, 2, 4, 8, 16... So 5 is 1 + 4, and 6 is 2 + 4, so the 4 is what they have in common. If you use A=5 OR B=6 -> C, you'll get C=7. If you use A=5 XOR B=6 -> C, you'll get 3.

In no case will you get "true" or "false".

You can decide for yourself, though, what constitutes true or false by setting a decider combinator to any condition you like.

So you can test for >0 or >= 0 or whatever you like.
Mabbus
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sun Apr 24, 2016 1:05 pm
Contact:

Re: "2" is considered False when using AND/OR combinators

Post by Mabbus »

Ooooooh. This didnt cross my mind.

Adding a decider combinator is how I normally solve it, but I was hoping to save some combinators for a neater sollution.
Well, I guess its not worth adding boolean operators too just to save a few combinators in some cases.

Thanks for the clarification.
Tertius
Smart Inserter
Smart Inserter
Posts: 1469
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: "2" is considered False when using AND/OR combinators

Post by Tertius »

Mabbus wrote: Thu Nov 06, 2025 11:03 pm Adding a decider combinator is how I normally solve it, but I was hoping to save some combinators for a neater sollution.
You can add multiple conditions to a single decider combinator, combined with AND or OR.
Post Reply

Return to “Gameplay Help”