on_circuit_network_deleted, on_circuit_network_merged

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
phillitwithjuice
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sat Sep 24, 2022 12:10 am
Contact:

on_circuit_network_deleted, on_circuit_network_merged

Post by phillitwithjuice »

TL;DR
An event that fires when a circuit network gets removed and an event that fires when two circuit networks get connected (and one of them gets removed)
Why ?
There is currently no way but expensive polling to tell if a circuit network(-id) is no longer in use when a mod is saving data for that circuit-network(-id), resulting in a memory leak. The on_circuit_network_merged event is a nice to have as it would be helpful to migrate the data related to the removed network to the merged network, but could be worked around with an implementation of on_circuit_network_deleted, if on_circuit_network_deleted also covers the deletion in case of two networks merging.
Signature

Code: Select all

on_circuit_network_deleted
  Called when a circuit network gets removed
  circuit_network :: LuiCircuitNetwork           The circuit network that got removed.
  name :: defines.events                         Identifier of the event.
  tick :: uint                                   Tick the event was generated.

on_circuit_network_merged
  Called when two circuit networks get connected and one of them has to be removed
  merged_circuit_network :: LuiCircuitNetwork    The merged circuit network
  removed_circuit_network :: LuiCircuitNetwork   The circuit network that got removed.
  name :: defines.events                         Identifier of the event.
  tick :: uint                                   Tick the event was generated.
Related Post
on_circuit_network_created

Post Reply

Return to “Modding interface requests”