Get Belts of belt Line

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
ss_Baum
Long Handed Inserter
Long Handed Inserter
Posts: 58
Joined: Wed Apr 04, 2018 10:58 am
Contact:

Get Belts of belt Line

Post by ss_Baum »

Hello everyone, hello dear dev's

I am trying to create a mod which allows you, to built speed editable belt's.
There I have to get the Belt-Line to change the speed, do the electricity calculation and more.
It would be nice, if there would be a way to get all Belt's of one line.
I know there is the belt_neighbors which gives you the neighbor of a single belt.
But I hoped, that you could get all the belt entities from a belt line in one table, to get a better performance.
If you don't store them while creating the path for the Items, you don't need to implement this.
But if the data is already stored in a variable, it would be nice if I could access the variable through the api.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13201
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Get Belts of belt Line

Post by Rseding91 »

Belt speed is just changeable runtime so i'm not sure how this would be of any use to you.
If you want to get ahold of me I'm almost always on Discord.

ss_Baum
Long Handed Inserter
Long Handed Inserter
Posts: 58
Joined: Wed Apr 04, 2018 10:58 am
Contact:

Re: Get Belts of belt Line

Post by ss_Baum »

Rseding91 wrote:
Sun Jan 31, 2021 12:49 am
Belt speed is just changeable runtime so i'm not sure how this would be of any use to you.
I am not sure, if I understood your answer right, maybe I missed the context because englisch isn't my primary language.

So, can you change the Belt_speed while in-game? That's what I have understood from your message.
At the moment I do this with create_entity viewtopic.php?f=34&t=95188

And to my question, accessing all belts of one transport line would make it just easier for me, to handle the built and destroy-events. Because at the mpment I would have to loop through the blet_neighbors pretty often. Not every time a belt is built, but every time a belt is destroyed ore rotated I have to figure out, if the line changed, where it split's to two lines and so on.

So if there would be a way to access all Belt's of a transport line, I would not have to loop through the belt_neighbors and that would be good for the performance.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13201
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Get Belts of belt Line

Post by Rseding91 »

Sorry; I meant to say setting belt speeds runtime is *not* possible.
If you want to get ahold of me I'm almost always on Discord.

ss_Baum
Long Handed Inserter
Long Handed Inserter
Posts: 58
Joined: Wed Apr 04, 2018 10:58 am
Contact:

Re: Get Belts of belt Line

Post by ss_Baum »

Rseding91 wrote:
Sun Jan 31, 2021 4:34 pm
Sorry; I meant to say setting belt speeds runtime is *not* possible.
How you maybe saw in the vid, I decided to use create_entity to make it possible, At the moment I am creating the line-detection.
And that's the point where it would be nice, to get at least the positions of the belts in array.
at the moment I try it with belt_neighbour.

Post Reply

Return to “Modding interface requests”