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
access value of belt speed? factorio 0.12.26/27
Re: access value of belt speed? factorio 0.12.26/27
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.
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.
Re: access value of belt speed? factorio 0.12.26/27
Or you would save only modified ones if they differ from prototype and skip saving for unmodified onesRseding91 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.
Re: access value of belt speed? factorio 0.12.26/27
makes sense. both.orzelek wrote:Or you would save only modified ones if they differ from prototype and skip saving for unmodified onesRseding91 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.
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?)
Re: access value of belt speed? factorio 0.12.26/27
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.orzelek wrote:... Or you would save only modified ones if they differ from prototype and skip saving for unmodified ones
If you want to get ahold of me I'm almost always on Discord.