Page 1 of 1

Unknown Error Message: "Wireless radar inner wires cannot be changed from Lua"

Posted: Fri Nov 15, 2024 9:59 am
by Dubstep Squirrel
Does anyone have any idea what "Wireless radar inner wires cannot be changed from Lua" mean as a fatal error when connecting a lamp prototype and a combinator prototype with circuit wires?

Code: Select all

local input_wire_connectors = input.get_wire_connectors(true)
local lampctrl_wire_connectors = lampctrl.get_wire_connectors()

input_wire_connectors[defines.wire_connector_id.circuit_green].connect_to(lampctrl_wire_connectors[defines.wire_connector_id.circuit_green], false, defines.wire_type.green)
The error was on the last line.

Alternatively, this used to be done with connect_neighbour, if you know another way to do this now that would also be great.

Code: Select all

  input.connect_neighbour({target_entity=lampctrl, wire=defines.wire_type.green}) 

Re: Unknown Error Message: "Wireless radar inner wires cannot be changed from Lua"

Posted: Fri Nov 15, 2024 10:03 am
by boskid
With wire connectors there are 3 so called "wire origins": Player, Script and Radars. Players can touch Player wires. Scripts can touch Player and Script wires, using Script for cases mods do not want wires to be removed by any means by players. Radars origin is used by game itself where i do not want mods to mess with those wires ever because it would break consistency of the radar networks. Simply saying: mods cannot add or remove wires with wire_origin.radars.

Your mistake is here:

Code: Select all

input_wire_connectors[defines.wire_connector_id.circuit_green].connect_to(lampctrl_wire_connectors[defines.wire_connector_id.circuit_green], false, defines.wire_type.green)
Third parameter is not `wire_type`, it is a `wire_origin` and you are passing wire_type.green (==3) which gets interpreted as wire_origin.radars (==3)

Re: Unknown Error Message: "Wireless radar inner wires cannot be changed from Lua"

Posted: Fri Nov 15, 2024 10:21 am
by Dubstep Squirrel
Thank you, that solved it. I'm not sure why I thought it was the way I had it to begin with...