Module events on add/remove.

Things that we aren't going to implement
Post Reply
Staplergun
Long Handed Inserter
Long Handed Inserter
Posts: 96
Joined: Sun Mar 25, 2018 5:34 am
Contact:

Module events on add/remove.

Post by Staplergun »

Fire events on module addition and module removal.
Returns entity added to/removed from, module, and player.

Use case: Allows for interfacing with modules to create custom effects when adding or removing modules. My particular idea is allowing addition of "features" of modularity to buildings that can accept modules. Things like, a module that adds a power pole to an assembler, or a logistics box to it or something. Could be used with anything that can accept a module. The concept is very similar to an equipment grid, but more specialized since module slots are limited, and this can be used on a slightly different variety of entities.

Bilka
Factorio Staff
Factorio Staff
Posts: 3123
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Module events on add/remove.

Post by Bilka »

Duplicate with 56963 which is a "won't implement" for the reasons stated in the thread.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Module events on add/remove.

Post by eradicator »

Being the author of the original request...

A possible method i can see to implement this is to intecept all module in/output actions by using a custom gui for the entity in question. It's a lot of coding work though, and if you need modules to be placeable by bots for blueprinting it's even more coding work :/.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Staplergun
Long Handed Inserter
Long Handed Inserter
Posts: 96
Joined: Sun Mar 25, 2018 5:34 am
Contact:

Re: Module events on add/remove.

Post by Staplergun »

Could just stick an event call in the code to fire when the module enters the inventory of the structure. I mean I read it but the counterargument to the request could be used for a large number of other events that do similar stuff. More specifically the event fired for equipment grids.


Or, just don't return the player as part of the event call?

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

Re: Module events on add/remove.

Post by Rseding91 »

Items in inventories can change by loads of different thing compared to the super simpler equipment which is only ever changed by the player doing it.
If you want to get ahold of me I'm almost always on Discord.

Staplergun
Long Handed Inserter
Long Handed Inserter
Posts: 96
Joined: Sun Mar 25, 2018 5:34 am
Contact:

Re: Module events on add/remove.

Post by Staplergun »

Bots and players right?

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

Re: Module events on add/remove.

Post by Rseding91 »

Staplergun wrote:Bots and players right?
robots, players, inserters, loaders, mining drills, assembling machines, boilers, turrets. Anything with ah inventory that isn't a container has different automated methods of "item removed/added".
If you want to get ahold of me I'm almost always on Discord.

Staplergun
Long Handed Inserter
Long Handed Inserter
Posts: 96
Joined: Sun Mar 25, 2018 5:34 am
Contact:

Re: Module events on add/remove.

Post by Staplergun »

Cheese and rice. Fair enough.

Is module slots a type of "inventory" that other things like a mining drill can even interact with though?

Post Reply

Return to “Won't implement”