game.isconnected(ent1, ent2) / entity.isconected(ent)

Post Reply
ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

game.isconnected(ent1, ent2) / entity.isconected(ent)

Post by ficolas »

It would be useful if we could check if two electric poles/ a pipe and a pump/ a pipe and a assembling machine (in the future next update? :D) etc are connected.
I could make my boiler "problem" system less laggy, and I can think of more uses (mainly with the "liquid" update that im really looking forward to :D)

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: game.isconnected(ent1, ent2) / entity.isconected(ent)

Post by kovarex »

It makes sense and is easy to do, so yes :)

Nirahiel
Filter Inserter
Filter Inserter
Posts: 351
Joined: Mon Sep 23, 2013 2:18 pm
Contact:

Re: game.isconnected(ent1, ent2) / entity.isconected(ent)

Post by Nirahiel »

Also, maybe a way to connect two poles ? like, ent1.connectTo(ent2) or something, will place a cable to connect them IF the distance is ok ?

ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: game.isconnected(ent1, ent2) / entity.isconected(ent)

Post by ficolas »

Regarding this topic, could you also add a game.findentitiesinnetwork{entity, name, type} command? That returns a table with the entities in that network (maybe two commands, one filtered and one non filtered) (for pipes)
Last edited by ficolas on Wed Jan 29, 2014 2:58 pm, edited 1 time in total.

immibis
Filter Inserter
Filter Inserter
Posts: 303
Joined: Sun Mar 24, 2013 2:25 am
Contact:

Re: game.isconnected(ent1, ent2) / entity.isconected(ent)

Post by immibis »

ent1.connectTo(ent2) would need to know the cable type - so ent1.connectTo(ent2, type) where type is "copper", "green" or "red".

Nirahiel
Filter Inserter
Filter Inserter
Posts: 351
Joined: Mon Sep 23, 2013 2:18 pm
Contact:

Re: game.isconnected(ent1, ent2) / entity.isconected(ent)

Post by Nirahiel »

immibis wrote:ent1.connectTo(ent2) would need to know the cable type - so ent1.connectTo(ent2, type) where type is "copper", "green" or "red".
Well, if we're talking about electricity, it's obvious it's a copper cable.
Now there could be a method using the wire type.
Or another method, one to connect (electricity) and one to link (logic network) ?

immibis
Filter Inserter
Filter Inserter
Posts: 303
Joined: Sun Mar 24, 2013 2:25 am
Contact:

Re: game.isconnected(ent1, ent2) / entity.isconected(ent)

Post by immibis »

Nirahiel wrote:
immibis wrote:ent1.connectTo(ent2) would need to know the cable type - so ent1.connectTo(ent2, type) where type is "copper", "green" or "red".
Well, if we're talking about electricity, it's obvious it's a copper cable.
Now there could be a method using the wire type.
Or another method, one to connect (electricity) and one to link (logic network) ?
Well, you need to specify copper cable, so the game knows you're talking about electricity.

What's the difference between "linking" and "connecting"?

Post Reply

Return to “Implemented mod requests”