Constant combinator improvment

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Post Reply
Pat4yczek
Inserter
Inserter
Posts: 46
Joined: Thu Aug 03, 2017 1:40 pm
Contact:

Constant combinator improvment

Post by Pat4yczek »

Hi everyone

This item is usefull, but when you have a lot of signals to set is painfull.
So I think a good idea is to add 3 options
1 is checkbox to set numbers as negative
2 is checkbox with input to multiply
3 is not only here, to set signal as default stack size

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Constant combinator improvment

Post by ssilk »

Pat4yczek wrote:
Tue Oct 19, 2021 12:00 pm
1 is checkbox to set numbers as negative
You mean to multiply every value with -1 before output?
2 is checkbox with input to multiply
Could be already be done with an arithmetic combinator. :)
3 is not only here, to set signal as default stack size
Don’t understand what you mean. The default stack size is in inserters not constant combinator?! You can set it already to a constant value in the inserter.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

mrvn
Smart Inserter
Smart Inserter
Posts: 5682
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Constant combinator improvment

Post by mrvn »

ssilk wrote:
Wed Oct 20, 2021 5:33 am
Pat4yczek wrote:
Tue Oct 19, 2021 12:00 pm
1 is checkbox to set numbers as negative
You mean to multiply every value with -1 before output?
2 is checkbox with input to multiply
Could be already be done with an arithmetic combinator. :)
3 is not only here, to set signal as default stack size
Don’t understand what you mean. The default stack size is in inserters not constant combinator?! You can set it already to a constant value in the inserter.
I think he means that when you select a new signal to output by the constant combinator and it is an item that the default value then is the stack size of the item. I think there used to be an option to have default size for selected items be 1 or stack size for something. Was it requester chests? Players request slots?

Looking up the stack size of items and entering it in a combinator is one of the annoying things left every time I blueprint a train station. So +1 for having constant combinators default to stack size for new items, at least as an option.

Pat4yczek
Inserter
Inserter
Posts: 46
Joined: Thu Aug 03, 2017 1:40 pm
Contact:

Re: Constant combinator improvment

Post by Pat4yczek »

with negative numbers should be usefull cuz a lot circuit desings use negative numbers, using aritmetic combinator on constant combitator is not efficient.
2nd statment like upstairs.
with 3rd idea, maybe i could make mod if it's possible to make vallidation for input method

Example:
All aritmetics writed will work 2+2=4, 4*5=20 etc.
about stack size: if you write (-)*20 for iron ore wil give you (-)20*50=10k
for fluids will be amount of storage tank

kryojenik
Inserter
Inserter
Posts: 20
Joined: Fri Jun 26, 2020 8:18 pm
Contact:

Re: Constant combinator improvment

Post by kryojenik »

I'm sorry if this is too self promoty...

I don't know if you're using LTN or not, but LTN Combinator Modernized has _some_ of what you're looking for. While it is mostly intended for use with LTN, it can be used as a stand alone constant combinator.

https://mods.factorio.com/mod/LTN_Combinator_Modernized

Bilka
Factorio Staff
Factorio Staff
Posts: 3123
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Constant combinator improvment

Post by Bilka »

I don't understand point 1, if you want a negative number for the signal, just input that negative number as the signal value.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

mrvn
Smart Inserter
Smart Inserter
Posts: 5682
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Constant combinator improvment

Post by mrvn »

Pat4yczek wrote:
Wed Oct 20, 2021 2:38 pm
with negative numbers should be usefull cuz a lot circuit desings use negative numbers, using aritmetic combinator on constant combitator is not efficient.
2nd statment like upstairs.
with 3rd idea, maybe i could make mod if it's possible to make vallidation for input method

Example:
All aritmetics writed will work 2+2=4, 4*5=20 etc.
about stack size: if you write (-)*20 for iron ore wil give you (-)20*50=10k
for fluids will be amount of storage tank
I don't get the request for checkboxes. But I do like the suggestion that you could just input an expression and it gets computed.

Not sure what to think about (-)*20. That seems overly complicated to type and ambigious to evaluate. Why not simply have "S" to denote stack size. So you type in "20 * S" or "20S" for short. And then you can just do 1K, 1M, 1G, too. Also ~32 and 2^17.

Would be best if the combinator remembers the original while outputing the resulting value. Shouldn't be too hard to mod if you have the time and incling to learn. Would love to use it or see it added to the LTN combinator mod (which would be a good place to look at as example).

Pat4yczek
Inserter
Inserter
Posts: 46
Joined: Thu Aug 03, 2017 1:40 pm
Contact:

Re: Constant combinator improvment

Post by Pat4yczek »

I don't try lua too much, don't know it have some RE module
It will have than great, long time ago I wrote CNC decoding lib, so write RE expression for one line it's not big deal.

(-) mean optional negative number
* at beginning mean to muliply by stack size
with S it's not problem

mrvn
Smart Inserter
Smart Inserter
Posts: 5682
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Constant combinator improvment

Post by mrvn »

Well, - before a number already works. That just falls naturally out of any string to int conversion.

And, yes, LUA has a regular expression module. But that seems like the wrong tool. You want an expression evaluator. Expressions can be arbitrarily complex. So you want to implement a stack machine or simple recursive parser. There are tons and tons of examples on how to evaluate a math expression as it's usually the first example in anything about parsers and grammars.

If you make the GUI side work I would be happy to pitch in with evaluating the strings the user input.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Constant combinator improvment

Post by ssilk »

Bilka wrote:
Wed Oct 20, 2021 5:08 pm
I don't understand point 1, if you want a negative number for the signal, just input that negative number as the signal value.
It’s super nervy, if you don’t have a number block on your keyboard. On German keyboard for example the minus is then easy to miss type because of the big distance between minus and numbers.

I really like the idea of having a input for the stack size. I lately searched for example the stack size of some item. I searched about 15 minutes around and there is no way (o.k. I didn’t find one) to find that out in game but by producing that numbers. I don’t understand why this isn’t printed in the item-window.
Or - to find that out by using a constant combinator…
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

User avatar
Silari
Filter Inserter
Filter Inserter
Posts: 488
Joined: Sat Jan 27, 2018 10:04 pm
Contact:

Re: Constant combinator improvment

Post by Silari »

ssilk wrote:
Fri Oct 22, 2021 4:14 am
I searched about 15 minutes around and there is no way (o.k. I didn’t find one) to find that out in game but by producing that numbers.
You can get that information (and basically anything else) in-game with the Prototype Browser - Ctrl+Shift+E.

It is weird that the only way to just look it up is with a debug tool though. I've needed that info a few times in my Space Exploration save and keep having to check there.

mrvn
Smart Inserter
Smart Inserter
Posts: 5682
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Constant combinator improvment

Post by mrvn »

F4 -> show-debug-info-in-tooltip and then hover over the item. Works inside the constant combinator so you don't first have to produce one to hover over. Works in recipes or crafting menu too.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Constant combinator improvment

Post by ssilk »

Besides that, there is also a mod, that does exactly this:

https://mods.factorio.com/mod/stack-combinator
And as part of https://mods.factorio.com/mod/utility-combinators-plus
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

mrvn
Smart Inserter
Smart Inserter
Posts: 5682
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Constant combinator improvment

Post by mrvn »

ssilk wrote:
Sat Oct 23, 2021 5:19 am
Besides that, there is also a mod, that does exactly this:

https://mods.factorio.com/mod/stack-combinator
And as part of https://mods.factorio.com/mod/utility-combinators-plus
Forget about stack-combinator. That uses a LUA script to compute the values in the on_tick event. You can use 1, 2 or 10 but each one will cut into the UPS.

The suggestion was to just have the input have a stack "unit" so you enter iron plates: 2 stacks and it configures the constant combinator to 200 iron plates. No runtime cost please.

Post Reply

Return to “Ideas and Suggestions”