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

Place to get help with not working mods / modding interface.
Dubstep Squirrel
Burner Inserter
Burner Inserter
Posts: 6
Joined: Wed Oct 30, 2024 8:32 pm
Contact:

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

Post 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}) 
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3038
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

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

Post 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)
Dubstep Squirrel
Burner Inserter
Burner Inserter
Posts: 6
Joined: Wed Oct 30, 2024 8:32 pm
Contact:

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

Post 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...
Post Reply

Return to “Modding help”