Construction Probes
Type: Mod
Description: Scan new constructions within and around a logistics network to assist in automated delivery of construction materials. Proficiency in the use of combinators for mixed shipments is recommended. Or a good set of blueprints.
License: MIT license
Version: 1.0.5
Release: 19 Feb 2022
Tested-With-Factorio-Version: 1.1.53
Category: Gameplay
Tags: Construction, Logistics, Circuit Network
Download-Url: https://mods.factorio.com/mod/eketek-construction-probe
Long Description
The Construction Probes mod is intended to be a highly performant and non-cheaty means to automate the delivery of materials to construction sites. When anything is built, ghost-built, planned with blueprints, copied, or when anything is destroyed, the mod searches for the most suitable construction probe, then pulses out the construction materials needed to either build the object or to replace items used for building. The mod prefers to select a construction probe which is inside of the logistic network which the construction is taking palce. If that is unavailable, it will search for the network with a roboport (or a modded roboport-like thing) positioned closest to the construction site. If there are none available within the [configurable] maximum range, it will search for a construction probe which is simply nearby the construction site (not tied to a logistic network). If no probes are found, the construction will be ignored.The construction probe mod is event-driven (mostly on_built-entity and on_pre_build). It temporarily uses on_tick to pulse out construction signals (and unregisters the event if it has nothing it pulse out). If the construction needs more types of items than the construction probe can signal on any one tick, it will use multiple ticks to send the signal (and even merge signals if there are simultaneous builds. I have not attempted any performance profiling, but I doubt that the mod will have any major performance problems - aside perhaps from the logic needed to handle building from the blueprint library.
Construction probes monitor and emit signals for: blueprint building, copy & paste building, direct building, ghost building, upgrade planner actions, actions by other mods which trigger custom construction events (such as Chuomiko's "Module Inserter" mod), and building destruction (resulting from damage).
Limitations
Items which are auto-replaced or removed as part or smart-dragging are not removed emitted from construction signals. The mod does not attempt to order cliff explosives. Aside from the signal which a construction probe pulses out, the logistics is entirely dependent on your circuit-network-based logistic system. To avoid accidentally ordering many more things than one might ordinarily expect, the mod disregards click & drag construction with blueprints and copy & paste.Planned Features
Ability to directly pace one-time logistics requests from a remotely-accessible interfaces (tied to construction probes).Features under consideration
Signals for modules manually inserted into machines. Not sure how to do this.
Integration with other mods
For common cases, the Construction Probes mod recognizes anything that triggers a "script_raised_build" event.If your mod involves a special case which you would like to handle with Construction Probes, there is also a remote interface available. The interface name is "eketek-construction-probe" and the functions it provides are "item_single" and "item_table". "item_single" causes it to emit a signal for just one item, given a prototype name, and "item_table" causes it to emit signals for a table of prototype names and quantities {[prototype-name]=quantity, ...}. Both functions require references to the surface the construction is taking place on, the player who ordered the construction, and the position of the construction site.
Example calls:
/c remote.call("eketek-construction-probe", "item_single", game.player, game.player.surface, game.player.position, "assembling-machine-2")
/c remote.call("eketek-construction-probe", "item_table", game.player, game.player.surface, game.player.position, {["assembling-machine-2"]=100, ["fast-transport-belt"]=1000 })
Development Status
Construction probes is mostly feature-complete, and has successfully been used to provide signals needed to allow enable transfers construction materials from a combinator-controlled logistics hub to a remote outpost connected by train. Testing is not quite extensive as it ought to be, and some features have thus far not seen any testing (mainly the "unadvertised" handling for multiple surface / multiple player / multiple force situations). It could maybe use something better than programmer art, should anyone volunteer to provide it.
License