Advanced Combinator

by zomis

Make combinators great again! One combinator to rule them all.

Content
4 years ago
0.16 - 1.1
1.46K
Circuit network

b Error in "add function"

5 years ago
(updated 5 years ago)

I'm getting a repeatable error in the combinator when i want to add 2 values, which both are accessed via the current function. the values of the inputs are 38 and 5. the result is 44. it does not depend on the position or the name of the signal, I tried to change that... I thought you should know....

Edit: one of the input is the result of a devision and the other of a modulo-calculation, therefore I thought it could be caused by a rounding issue, when it might be internaly representet by a variable with digits after the decimal point....

5 years ago

This is not really an error but is caused by the division result being 38.5 for example and the modulo result being 5.5, then 38.5 + 5.5 equals 44.

5 years ago
(updated 5 years ago)

I didn't expect the calculation done with more than integer precision, because all combinators in the game don't do it. It is okay when that is the result that should be there, but a rounding function (round up, round down, round mathematical) would be awesome to control the results...

5 years ago
(updated 5 years ago)

I`m curious: Do you plan to implement something like rounding functions? For my project I need to have the values with integer precision and if I have to deal with numbers that are to large for some result I end in infinit loops an my calculation doesn't make sense at all.

Edit: I took a look in your implementation, especially the numeric class, and tried to do it. I have no Lua experience and forgive me if this is annoying... I bet there are more lines where adjustments would be necessary, but I didn't understood the whole mod

floor = {
description = "Returns the largest integer less than or equal to the value",
parameters = { "number" },
result = "number",
parse = function(params, logic)
  local param = params[1]
  return function(entity, current)
    return math.floor(logic.resolve(param, entity, current))
  end
end

},

ceil = {
description = "Returns the largest integer greater than or equal to the value",
parameters = { "number" },
result = "number",
parse = function(params, logic)
local param = params[1]
return function(entity, current)
return math.ceil(logic.resolve(param, entity, current))
end
end
},

P.S.: I love your mod and what it is capable of. It is just great work :)

5 years ago

Yes, I am planning on adding rounding functions to the mod. Have you tried your implementation, did it cause any issues?

New response