access value of belt speed? factorio 0.12.26/27

Place to get help with not working mods / modding interface.
Post Reply
User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 883
Joined: Sun Mar 20, 2016 2:51 am
Contact:

access value of belt speed? factorio 0.12.26/27

Post by Impatient »

Hi,

is there currently (0.12.26/27) a way to access the speed of a belt via the api? i know i can set it in the entities definition. but can i access it programmatically?

thanks

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

Re: access value of belt speed? factorio 0.12.26/27

Post by Rseding91 »

Runtime, not currently.

Read access would be pretty simple to add. Write access would require we save the speed of every single belt in the world to the save file in case it wasn't what the prototype speed was defined at which would waste a ton of space in 95%+ of everyone's save file that didn't have modified speed belts.
If you want to get ahold of me I'm almost always on Discord.

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: access value of belt speed? factorio 0.12.26/27

Post by orzelek »

Rseding91 wrote:Runtime, not currently.

Read access would be pretty simple to add. Write access would require we save the speed of every single belt in the world to the save file in case it wasn't what the prototype speed was defined at which would waste a ton of space in 95%+ of everyone's save file that didn't have modified speed belts.
Or you would save only modified ones if they differ from prototype and skip saving for unmodified ones :)

User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 883
Joined: Sun Mar 20, 2016 2:51 am
Contact:

Re: access value of belt speed? factorio 0.12.26/27

Post by Impatient »

orzelek wrote:
Rseding91 wrote:Runtime, not currently.

Read access would be pretty simple to add. Write access would require we save the speed of every single belt in the world to the save file in case it wasn't what the prototype speed was defined at which would waste a ton of space in 95%+ of everyone's save file that didn't have modified speed belts.
Or you would save only modified ones if they differ from prototype and skip saving for unmodified ones :)
makes sense. both.

read access would help. thanks!


(the problematic scenario i was thinking of, is my modded entity having to interact with belts and me just knowing the speeds of the stock belts. and then, what if it has to deal with some belt from another mod, with a non-stock speed? regarding write access ... that would open up interesting new possibilities. like creating belt structures that adapt their speed to the environment, to other belts, to some conditions ? ... maybe enable write access only for non-stock/modded belt entities?)

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

Re: access value of belt speed? factorio 0.12.26/27

Post by Rseding91 »

orzelek wrote:... Or you would save only modified ones if they differ from prototype and skip saving for unmodified ones :)
That doesn't work because load time how do you know if you need to load the saved data? You'd have to save out a flag for every belt saying it did or didn't save the speed and at that point you might as well just save the speed.
If you want to get ahold of me I'm almost always on Discord.

User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 883
Joined: Sun Mar 20, 2016 2:51 am
Contact:

Re: access value of belt speed? factorio 0.12.26/27

Post by Impatient »

now officially requested here:

viewtopic.php?f=28&t=23187

Post Reply

Return to “Modding help”