Tarantulator


Is Spidertron too weak for your taste? Meet the Tarantulator – nuclear-powered, massive, and armed with a devastating railgun!

Content
4 months ago
1.0 - 2.0
27.7K
Transportation Combat

g Equipment grid power

29 days ago

Hey, I read that this spidertron burns fuel and that it automatically provides power to its equipment grid.
Could you outline how you've done this, as I'd like to incorporate it into my personal spidertron mods.

I think I could try to reverse-engineer the code but I'd like to ask you first, maybe you have some insights for me.

a day ago
(updated a day ago)

Sorry for the late reply. I just noticed your message. Unfortunately, I never receive any notifications from the Factorio mod forum, so I didn’t realize there was an update. My apologies for the delay.

short version:

  • Implementation live in control.lua — main work happens in script.on_nth_tick(240).
  • Every 240 ticks the mod iterates each spider’s grid.equipment and checks equipment with max_energy/energy. 🔧
  • If equipment is missing energy and the spider has fuel (spider.burner.remaining_burning_fuel > 0), it transfers energy from that fuel into the equipment. The transfer uses a configurable storage.transfer_efficiency (initialized from a startup setting).
  • Fuel is consumed proportionally: equipment gains up to missing energy, and spider.burner.remaining_burning_fuel is reduced by missing / transfer_efficiency (or set to 0 if not enough fuel).
  • The reactor item (tarantulator-reactor) is auto-placed into the grid in tarantulator_built and protected from removal in on_player_removed_equipment so the grid always has the reactor available.

New response