[0.12.32] set_circuit_condition doesn't work on constant combinators
Posted: Mon May 02, 2016 10:28 pm
by Adil
set_circuit_condition function doesn't alter constant combinator's state.
It's unclear whether it should, however, but the following code simply does nothing silently.
If not fixed it'd be good to have at least clear information on that function in docs.
const=defines.circuitconditionindex.constant_combinator
string2logic=function(ent,str)
local par={}
for i = 1, #str,2 do
par[i]={
count=1,
index=i,
signal={
type="virtual",
name=num2sign[str:sub(i, i)],
}
}
end
ent.set_circuit_condition(const,{parameters=par})
end
sign2num={
["signal-1"]=1,
["signal-2"]=2,
["signal-3"]=3,
["signal-4"]=4,
["signal-5"]=5,
["signal-6"]=6,
["signal-7"]=7,
["signal-8"]=8,
["signal-9"]=9,
["signal-0"]=0,
}
num2sign={}
for k,v in pairs(sign2num) do num2sign[v]=k end
To reproduce
In addition to pushing the above code to console, the following command will be needed.