超级工厂 Super factory


Pack solved Factory Planner production lines into single buildings with per-factory scaling, plan versioning, and global management. | 将 Factory Planner 产线装进单座厂房,支持单厂扩产、方案版本管理与全局调度。

Utilities
57 minutes ago
2.1
28
Manufacturing Cheats

b on_built_entity (ID 6)

5 hours ago

Hi, I was actually looking for a mod similar to Magic Huts, which currently has an error and is unusable.
I created the project for the laser turret in Factory Plan, imported it into Super Factory, selected it, and clicked “Pick recommended factory.” When I add the ghost to the map, I get the following error:

Error while running event super-factory::on_built_entity (ID 6)
Index out of inventory bounds.
Stack traceback:
[C]: in function ‘set_inventory_filter’
super-factory/scripts/buildings.lua:909: in function ‘set_filters’
super-factory/scripts/buildings.lua:771: in function 'apply_layout'
super-factory/scripts/buildings.lua:457: in function ‘set_factory_index’
super-factory/scripts/buildings.lua:270: in function ‘on_created_entity’
super-factory/control.lua:333: in function <super-factory/control.lua:330>

4 hours ago

However, if I add it to the map and then configure it manually, I don't get the error and it seems to work.
I say “seems” because it started working, but then suddenly—I don't know why—it stops because it says the battery is low, even though it's actually there.
See the screenshot:
https://postimg.cc/7JVXQHtW

2 hours ago

Hi momift, thanks for the detailed report and the screenshot!

Your laser turret plan needs about 378 input slots. A built large factory can expand from its default 120 slots to fit the plan. When you place a ghost, Super Factory requests the same expansion and immediately tries to set filters for all 378 slots. I suspect Factorio still limits the ghost to 120 slots, which would explain why setting a filter on the 121st slot crashes. As you found, building the factory first and assigning the plan manually gets around the crash.

The battery warning looks like a separate rounding issue. The tooltip shows 12,000 batteries needed and 12,000 available, along with a tiny negative “already paid” balance. A rounding error left over from the first batch could make the next batch report a shortage even after the battery slots refill.

I’ve traced both issues in the code. The next step is to reproduce them in a fresh game and work on a fix. I'll keep you updated!

55 minutes ago

Hi momift,

Both issues have now been fixed in v1.0.1.

  • Ghost placement crash: Placing a large factory ghost for a plan that needs more than 120 input slots no longer crashes. Once built, the factory keeps its selected plan and automatically expands its input inventory to fit.
  • Battery production stall: Solid ingredient requirements are now rounded up to whole items per batch after applying the output multiplier, which prevents tiny fractional rounding errors from leaving a negative balance and stalling the next batch. (Note: because of this, actual consumption may be slightly higher than what Factory Planner shows if a batch requirement has a fraction—for example, 12,000.25 becomes 12,001—so existing factories might need a little extra supply.)

Also, I noticed from your screenshot that your UI had a mix of Italian and English. To make things more consistent and comfortable to use, v1.0.1 also adds full Italian localization. Feel free to let me know if any phrasing looks off or if you run into any other issues. Thanks again for the report!

New response