[2.0.30] AgriculturalTowerPrototype with output_inventory_size of 0 has 2 output slots
Posted: Sun Jan 12, 2025 7:06 pm
1. What did you do?
I'm creating a mod that defines a Cargo Crane entity using the 'agricultural-tower' type. My intention is to prevent the default automatic behavior of harvesting nearby trees and set the crane position via a control script instead, so the crane's prototype sets an 'output_inventory_size' of 0.
2. What happened?
The resulting entity has an output inventory with 2 slots. Specifically, calling `get_inventory_size(defines.inventory.assembling_machine_output)` on the crane's prototype returns 2. Also, `prototype.get_history` show no changes to the prototype after being created.
3. What did you expect to happen instead? It might be obvious to you, but do it anyway!
I expected the output inventory size to be zero, similar to the behavior of 'input_inventory_size' when set to zero (no input slots). Other positive values work as expected (an entity with the specified number of output slots). The docs also mention that its default value is 0, but attempting to fall back on the default gives the same incorrect result (2 output slots):
https://lua-api.factorio.com/latest/pro ... ntory_size
I'm creating a mod that defines a Cargo Crane entity using the 'agricultural-tower' type. My intention is to prevent the default automatic behavior of harvesting nearby trees and set the crane position via a control script instead, so the crane's prototype sets an 'output_inventory_size' of 0.
2. What happened?
The resulting entity has an output inventory with 2 slots. Specifically, calling `get_inventory_size(defines.inventory.assembling_machine_output)` on the crane's prototype returns 2. Also, `prototype.get_history` show no changes to the prototype after being created.
3. What did you expect to happen instead? It might be obvious to you, but do it anyway!
I expected the output inventory size to be zero, similar to the behavior of 'input_inventory_size' when set to zero (no input slots). Other positive values work as expected (an entity with the specified number of output slots). The docs also mention that its default value is 0, but attempting to fall back on the default gives the same incorrect result (2 output slots):
https://lua-api.factorio.com/latest/pro ... ntory_size