Robosubstations for Electric Grid


A Substation with robot recharge ports. Patched for compatibility with the Electric Grid mod.

Content
a month ago
2.0
179
Logistic network Power

Changelog

Version: 0.5.8
Date: 30. 05. 2026
  Bugfixes:
    - Smart pipette (Q) on a robosubstation now reliably puts a robosubstation
      on the cursor in every case -- whether you own the item, own none (you
      get a robosubstation ghost), or are in cheat mode (free conjure). Two
      fixes were needed. The invisible charger and radar are now non-selectable
      so the cursor targets the substation, not an item-less helper. And the
      cursor is now set manually (clear / set_stack / cursor_ghost) instead of
      via LuaPlayer.pipette, whose resolution of the "robosubstation" name
      (which is both an item and an entity) plus ghost handling was unreliable.
      Two triggers feed the same logic: on_player_pipette swaps instantly when
      you own substations (no flicker), and a custom-input linked to the pipette
      control (consuming = "none", so tiles / cursor-clear / wires / blueprints
      stay vanilla) covers the common "I own robosubstations, not substations"
      case on the next tick.
      Known limitation: with consuming = "none" vanilla pipette still runs, so
      if you own no plain substation and the "Pick ghost item if no items are
      available" interface option is off, the engine briefly plays its error
      sound before the cursor is corrected.
Version: 0.5.7
Date: 30. 05. 2026
  Bugfixes:
    - Blueprinting / copying a robosubstation no longer captures a plain
      substation: the captured substation is rewritten back into a
      robosubstation via on_player_setup_blueprint, so pasting the blueprint
      rebuilds robosubstations.
    - The build preview is now accurate. The placement marker carries the
      substation's real collision footprint, so the cursor turns red (and the
      game shows the correct "<thing> is in the way" reason -- tree, player,
      water, ...) wherever a substation genuinely cannot be placed, instead of
      always showing green and only complaining about the substation. The
      marker is destroyed before the substation is spawned so the two no
      longer fight over the tile.
    - The invisible "Security Camera" (and charger) can no longer survive the
      substation. Cleanup now also sweeps the tile for any leftover/duplicate
      attachments, the storage entry remembers its surface and position, and a
      one-shot pass on load reaps any camera/charger already left floating in
      existing saves.
Version: 0.5.6
Date: 17. 05. 2026
  Changes:
    - Smart pipette (Q) on a robosubstation: we now post-process the
      vanilla on_player_pipette event instead of binding our own custom
      input to Q. When vanilla pipette successfully takes a plain
      substation from the inventory because the player aimed at one of
      our tracked robosubstations, we swap that substation for a
      robosubstation item of the same quality (the substation goes back
      into the inventory). In cheat mode the swap is free, matching
      vanilla's free pipette. If the player has no robosubstation of
      the matching quality, the swap is skipped and the vanilla
      substation stays on the cursor.
      Vanilla Q keeps doing everything else itself -- cursor clear,
      wires, tiles, blueprints, ghost cursor, inventory accounting --
      so the wire-into-inventory regression introduced earlier in 0.5.6
      is gone. Known limitation: if the player has no plain substation
      in inventory, vanilla pipette either yields a ghost cursor or
      plays the engine error sound, and we no longer try to suppress
      that; the only way to suppress it cleanly was to consume vanilla
      Q entirely, which broke too many vanilla mechanics.
  Optimisations:
    - The deferred smart-pipette mechanism is gone entirely. With vanilla
      pipette consumed at the input layer there is no race left to wait
      out, so on_nth_tick is no longer registered at all and the cursor
      swap happens synchronously inside the input handler.
    - Substation destruction is now tracked via register_on_object_destroyed
      instead of filtering on_entity_died and script_raised_destroy. We only
      get one event, only for substations we actually placed, and it also
      catches script-driven destroys from other mods that the previous
      filter pair missed.
    - Quality-specific charger prototypes are resolved once at startup into
      a lookup table instead of probing prototypes.entity[...] on every
      build.
    - Removed dead entity.name checks from handlers that already filter on
      name engine-side.
  Migrations:
    - Existing tracked substations are registered for on_object_destroyed
      when an older save is loaded.
Version: 0.5.5
Date: 15. 05. 2026
  Bugfixes:
    - Smart pipette (Q) now also works on the second and subsequent
      presses. The previous implementation was sensitive to the order of
      events between vanilla pipette and our custom-input handler. We
      now just remember the pending pipette request and apply it via
      on_tick one tick later, by which point vanilla pipette has finished
      whatever it was going to do and we can deterministically force the
      robosubstation item onto the cursor. Cursor contents (if any) are
      returned to the player's main inventory first instead of being lost.
  Migrations:
    - Adds a migration that walks every surface and repairs robosubstations
      placed by 0.5.0 / 0.5.1 (which left behind a lonely invisible marker
      with a charger and radar floating on top because the substation
      could never be spawned due to a collision-mask bug). The migration
      spawns the missing vanilla substation, registers it in storage, and
      removes the obsolete marker. If the spot is unbuildable, charger
      and radar are cleaned up too.
Version: 0.5.4
Date: 15. 05. 2026
  Bugfixes:
    - Q (smart pipette) again: 0.5.3 used linked_game_control="pipette",
      which loaded without errors but did not actually link to anything,
      so the custom event never fired. Now bound directly to the Q key
      via key_sequence with consuming="none" so vanilla pipette still
      runs in parallel.
Version: 0.5.3
Date: 15. 05. 2026
  Bugfixes:
    - Fix load error: the linked_game_control in 0.5.2 referenced
      "smart-pipette", which does not exist. The vanilla control is named
      "pipette".
Version: 0.5.2
Date: 15. 05. 2026
  Bugfixes:
    - Smart pipette (Q) now reliably gives you a robosubstation item even
      when you don't have any plain substations in your inventory. The
      previous implementation relied on on_player_pipette, which doesn't
      fire when vanilla pipette can't find anything to transfer. It now
      uses a custom-input linked to smart-pipette plus an
      on_player_cursor_stack_changed safety net to swap the cursor if
      vanilla still managed to put a substation on it.
Version: 0.5.1
Date: 15. 05. 2026
  Bugfixes:
    - Cursor placement preview now actually shows a substation graphic
      instead of being invisible. The marker borrows the vanilla
      substation pictures so you can see where the robosubstation will go.
    - Removed the marker's collision mask. With the marker sharing the
      substation's collision the script-spawned substation could not be
      placed underneath, leaving an invisible placeholder and orphaned
      charger / radar on mining. The marker is now non-colliding and
      control.lua validates the position via can_place_entity, refunding
      the player if the spot cannot host a substation.
    - Marker is destroyed immediately after the substation, charger and
      radar are spawned. This avoids double-rendering and means storage
      is now keyed by the substation's unit_number, so mining or losing
      the substation always cleans the charger and radar up.
    - Smart pipette (Q): pressing Q on a placed robosubstation now puts
      the robosubstation item on the cursor instead of a substation.
  Internal:
    - Author field updated.
Version: 0.5.0
Date: 15. 05. 2026
  Changes:
    - Architectural rework for full Electric Grid compatibility: the robosubstation
      is no longer a custom electric-pole prototype. Instead it is a small marker
      entity that spawns a real vanilla substation at the same position when built,
      plus the roboport charger and radar on top. Electric Grid sees only the
      vanilla substation (which is on its pole_rules whitelist), so wires connect
      normally to other substations, transformators and all other Electric Grid poles.
    - Mining, dying, blueprinting and cloning are handled symmetrically: charger,
      radar and the backing substation are cleaned up together, and the player
      gets refunded the robosubstation item.
    - Robosubstation item now follows the substation's item subgroup, keeping it next
      to the substation in the crafting menu when other mods (e.g. Electric Grid)
      move it.
  Known limitations:
    - The upgrade-planner / fast-replace path from substation -> robosubstation no
      longer works because the robosubstation is not an electric-pole prototype
      anymore. Build robosubstations directly from the recipe.
    - When blueprinting an existing robosubstation, both the marker and the
      backing substation are captured; the substation requirement is harmlessly
      refunded to logistics once the marker arrives.
Version: 0.4.2
Date: 15. 05. 2026
  Changes:
    - Compatibility with Electric Grid: robosubstation now inherits the substation's
      maximum_wire_distance, supply_area_distance and rewire_neighbours_when_destroying,
      so it matches Electric Grid's modified values.
    - Upgrade chain is spliced when Electric Grid is present:
      substation -> robosubstation -> eg-ugp-substation-displayer.
    - Robosubstation item now follows the substation's item subgroup, keeping it next to
      the substation in the crafting menu when other mods move it.
Version: 0.4.1
Date: 26. 05. 2025
  Changes:
    - Sdded quality support
Version: 0.4.0
Date: 09. 11. 2024
  Changes:
    - Factorio 2.0 support (no quality support)
Version: 0.3.0
Date: 05. 12. 2020
  Changes:
    - Factorio 1.1 support
Version: 0.2.0
Date: 23. 01. 2020
  Changes:
    - Factorio 0.18 support
Version: 0.1.7
Date: 11. 01. 2020
  Changes:
    - Mod startup settings for logistic and construction distances
Version: 0.1.6
Date: 22. 04. 2019
  Bugfixes:
    - data-final-fixes workaround for Bobs+Angels fast_replaceable_group compat
Version: 0.1.5
Date: 12. 04. 2019
  Bugfixes:
    - Make roboport entity indescructible. Was possible to destroy it leaving the substation intact
Version: 0.1.4
Date: 08. 04. 2019
  Changes:
    - Try to be smarter setting fast_replaceable_group and next_upgrade in data-updates
Version: 0.1.3
Date: 07. 04. 2019
  Changes:
    - Setting to support Lighted Electric Poles +
Version: 0.1.2
Date: 06. 04. 2019
  Changes:
    - Add red circuits to recipe