Event when logistic cells are added/removed from a logistic network

Things that we aren't going to implement
Post Reply
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2809
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Event when logistic cells are added/removed from a logistic network

Post by Optera »

Like I said in the final post here having an on_logistics_network_created event similar to on_train_created firing each time a logistic cell is added or removed from that network would make tracking networks a lot easier than having to check cells each tick.

To make this work the API also needs to expose the id for a logistic network we can see in the ui. Though it seems those ids are not behaving like train ids.

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

Re: Event when logistic cells are added/removed from a logistic network

Post by Rseding91 »

That's not likely to ever happen. The train-created event was already super error prone and caused several save corruption bugs due to how many different ways it happens and the fact that when it happens mod can screw with *everything* about the game in the events.

To make it so the game has to account for mods screwing with logistic cells and logistic networks when they're merging/splitting is just not something I want to do. It would be so buggy and error prone that it's not worth it.

The bottom line is: mods can't be trusted because they can and will do things like destroy unrelated entities during random events or just cause script errors during random events. As such, some events are just not going to happen - such as this and inventory-changed style events.
If you want to get ahold of me I'm almost always on Discord.

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2809
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Event when logistic cells are added/removed from a logistic network

Post by Optera »

Rseding91 wrote:
Sun Aug 11, 2019 4:01 pm
That's not likely to ever happen. The train-created event was already super error prone and caused several save corruption bugs due to how many different ways it happens and the fact that when it happens mod can screw with *everything* about the game in the events.

To make it so the game has to account for mods screwing with logistic cells and logistic networks when they're merging/splitting is just not something I want to do. It would be so buggy and error prone that it's not worth it.

The bottom line is: mods can't be trusted because they can and will do things like destroy unrelated entities during random events or just cause script errors during random events. As such, some events are just not going to happen - such as this and inventory-changed style events.
I get what you are saying, but it feels odd to hear that years after Factorios API became the most mod friendly of any game I've ever modded.
If we go strictly by "mods can mess things up so we won't support a feature" the whole modding API should be removed.

Logsitic Networks to circuit network connectivity is severely lacking. Due to lacking API support mods adding those features like Ghost Scanner have terrible performance.

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

Re: Event when logistic cells are added/removed from a logistic network

Post by Rseding91 »

It's just how it is. Mods sometimes try to do things which they will never be able to do with good performance and it's not always viable to add in some way for them to do what they want with better performance.

In this case, I'd say just don't use that mod.
If you want to get ahold of me I'm almost always on Discord.

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2809
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Event when logistic cells are added/removed from a logistic network

Post by Optera »

Your advice seems needlessly patronizing.

I made that mod to read items missing for construction to circuit network. If reporting missing items was a feature of base roboports, like they report items available, I could just not use my mod for a smart self replicating base.

FuryoftheStars
Filter Inserter
Filter Inserter
Posts: 389
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: Event when logistic cells are added/removed from a logistic network

Post by FuryoftheStars »

IMO, if a mod does something wrong, then it’s the mod’s fault. Not adding an API for something because a mod could potentially do something doesn’t make sense to me.

But I guess this goes along with us being told that we shouldn’t be using compound entities, and yet it’s the only way to achieve what we want cause native support for it won’t be added.
Optera wrote:
Sun Aug 11, 2019 4:32 pm
Factorios API became the most mod friendly of any game I've ever modded.
I think I got spoiled modding for Supreme Commander: Forged Alliance years ago. No game I’ve ever modded for has ever achieved its level of modability. I really miss that. :(

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

Re: Event when logistic cells are added/removed from a logistic network

Post by Rseding91 »

FuryoftheStars wrote:
Sun Aug 11, 2019 6:34 pm
IMO, if a mod does something wrong, then it’s the mod’s fault. Not adding an API for something because a mod could potentially do something doesn’t make sense to me.
That's not how the Factorio mod API is written. The entire mod API is written such that mods can't corrupt your save files and should never be able to crash your game to desktop.

It's part of the design philosophy of Factorio: Unless something can be done (as humanly possible) perfectly we do it. We strive to never half-ass anything. Having come from using mods in Minecraft where any mod for any reason could corrupt your entire save file I never want to get to that state.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Won't implement”