Page 1 of 1
Arithmetic Combinator mod question
Posted: Tue Mar 20, 2018 1:57 pm
by Arcorio
Hi, I am new and learning modding, and have an idea for a mod but want to know if its possible before I invest a lot of time into it.
I was wondering if someone could tell me if its possible to modify the ArithmeticCombinatorParameters table to add additional fields,
so it can take more than one input? (
http://lua-api.factorio.com/0.16.32/Con ... Parameters)
To explain further I want the Arithmetic Combinator to be able to take up to 4 inputs and apply the same operation to all of them,
so, for example, ANDing together A and B and C and D, not just A and B.
Also, the 'Each' wildcard isn't what I want, as I want the combinator to only work on certain signals in the network not all of them.
Thankyou
Re: Arithmetic Combinator mod question
Posted: Tue Mar 20, 2018 2:13 pm
by DaveMcW
No, arithmetic combinator is not extensible at all.
You need to use 2 entities for input, constant-combinator for output, and do all the logic in Lua.
Re: Arithmetic Combinator mod question
Posted: Tue Mar 20, 2018 2:19 pm
by eradicator
A⋀B⋀C⋀D is equivalent to (A⋀B) ⋀ (C⋀D). Yes, that requires 3 combinators instead of one. But is orders of magnitues faster than implementing the reading/writing of circuit signals in lua. So unless you want to do some really slow operations that require massive amounts of combinators you're best off using vanilla combinators as they are.
Re: Arithmetic Combinator mod question
Posted: Tue Mar 20, 2018 4:07 pm
by Aeternus
It also will introduce one tick delays from input to output if you need to nest the inputs, but I think you're not going to be able to get around that.
Re: Arithmetic Combinator mod question
Posted: Tue Mar 20, 2018 4:10 pm
by Arcorio
Well oddly enough the reason I want to make a 4 input AND gate and maybe other compound chips is that, I am interested in building some very complex circuits in Factroio so wanted to compress some simpler functions into single combinators, and of course learn a thing or two about modding at the same time, probably that this is impossible!
Re: Arithmetic Combinator mod question
Posted: Tue Mar 20, 2018 4:12 pm
by Arcorio
Good point Aeternus, this is all purely experimentation anyway.
Re: Arithmetic Combinator mod question
Posted: Tue Mar 20, 2018 5:51 pm
by eradicator
Arcorio wrote: I am interested in building some very complex circuits in Factroio
Well, if you're really interested in building those circuits
in factorio and
not in lua, then possibly your only option would be to make combinators smaller. Maybe even so small that several fit into one tile if you're really into learning to mod ;). If you're ok with implementing half the algorythm in lua you can do that too. The
really slow part of the operation is getting the signals from "the world" into lua, and then from lua back into "the world". So for something as common as an AND gate it's not really feasible performance wise.
Re: Arithmetic Combinator mod question
Posted: Tue Mar 20, 2018 7:00 pm
by Arcorio
Thanks eradicator! Miniature combinators is actually not a bad idea!
I have actually managed to make some changes to my designs in factorio and now I am using the 'each' wildcard to create multi-input gates.
And thanks for the tip about performance that makes complete sense. So maybe if I do decide to make a mod for this I could miniaturise existing combinators and not do any logic in LUA and therefore not take the performance hit.