How to make an entity with circuit_wire_connection_point(s)

Place to get help with not working mods / modding interface.
Post Reply
User avatar
IngoKnieto
Fast Inserter
Fast Inserter
Posts: 106
Joined: Mon Oct 03, 2016 9:29 am
Contact:

How to make an entity with circuit_wire_connection_point(s)

Post by IngoKnieto »

I would like a modded nuclear reactor to give out its content (=fuel cell and empty fuel cells) to the circuit network, therefor the circuit wires need to be attachable to the reactor.
Can anybody tell me how to do this?

I tried to add circuit_wire_connection_point and circuit_wire_max_distance to the entity definition, but that does not seem to be enough. Can an entity with type="reactor" not have circuit wires attached, or am I missing something?

Code: Select all

    
  {
    type = "reactor",
    name = "test-reactor",

    [...]

    circuit_wire_connection_point =
    {
      shadow =
      {
        red = {22.5/32, 23.5/32},
        green = {18.5/32, 28.5/32},
      },
      wire =
      {
        red = {12/32, 23/32},
        green = {12/32, 28/32},
      }
     },
    circuit_wire_max_distance = 7.5
}

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: How to make an entity with circuit_wire_connection_point(s)

Post by eradicator »

IngoKnieto wrote:Can anybody tell me how to do this?
No. Because it's impossible. If you can't connect a wire to it in base you can't add one in a mod.
You'll have to use an invisible proxy entity that can connect to wires (i.e. a lamp) and then script the rest.
Look at any of the "inventory combinator" mods that allow you to get circuit counts of inventory content.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

User avatar
IngoKnieto
Fast Inserter
Fast Inserter
Posts: 106
Joined: Mon Oct 03, 2016 9:29 am
Contact:

Re: How to make an entity with circuit_wire_connection_point(s)

Post by IngoKnieto »

That's what I was afraid of :cry:
I already figured out the solution with a second entity, but if I see it correct, blueprints taken of both entities will not contain the wiring to that entity (from a pole also in the blueprint for example). That's what I was trying to "workaround".
Thanks for your answer though...

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: How to make an entity with circuit_wire_connection_point(s)

Post by eradicator »

Not sure what you mean with that. Blueprints store circuit wires just fine. The only thing they don't store is copper wires.
Unless your problem is that the invisible entities aren't blueprintable because they have no placer item, in which case you simply add one.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Post Reply

Return to “Modding help”