Page 1 of 1

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

Posted: Wed Jan 08, 2014 4:49 pm
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)

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

Posted: Wed Jan 08, 2014 9:24 pm
by kovarex
It makes sense and is easy to do, so yes :)

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

Posted: Wed Jan 08, 2014 9:37 pm
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 ?

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

Posted: Sun Jan 26, 2014 7:02 pm
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)

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

Posted: Tue Jan 28, 2014 10:51 pm
by immibis
ent1.connectTo(ent2) would need to know the cable type - so ent1.connectTo(ent2, type) where type is "copper", "green" or "red".

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

Posted: Thu Jan 30, 2014 10:16 am
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) ?

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

Posted: Sun Feb 09, 2014 10:02 am
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"?