Bulk Rail Loader

by therax

Bulk train loader/unloader with buffer.

Content
2 years ago
0.16 - 1.1
58.6K
Logistics

b Method on_blueprint messing with other mods

1 year, 11 months ago

You do the set_blueprint_entities blindly, and it causes the event.mapping to be cleared, messing with any mods that try to use the event mapping or tags feature.

1 year, 10 months ago

Specific example is Display Plates (re: https://mods.factorio.com/mod/DisplayPlates/discussion/6362b1beefa22e0ddae585ea ). ctrl C / V and blueprints do not save the display plate settings so they are all blank. Disabling Bulk Rail Loader fixes the issue.

1 year, 10 months ago

For a temporary kludge I moved line #367 bp.set_blueprint_entities(entities) to the parent loop [line 342] so that copy/paste and blueprints that don't include bulk rail loaders works with scripts that use tags.

re:
...
bp_entity.name = (bp_entity.name == "railloader-chest")
and "railloader-placement-proxy"
or "railunloader-placement-proxy"
-- base direction on direction of rail
bp_entity.direction = rail.direction
-- preserve chest limit
-- Fix tag overwrite attempt
bp_entity.tags = { bar = chest_entity.get_inventory(defines.inventory.chest).get_bar() }

    -- sample from displayplates attemp: bp_entity.set_blueprint_entity_tag(index, "bar", chest_entity.get_inventory(defines.inventory.chest).get_bar())

  -- What happens if we just don't do this? = rail loaders don't show up in blueprint
  -- If moved here then DisplayPlates (any mod using tags) works unless there is a loader in the entity
  bp.set_blueprint_entities(entities)

end
::continue::

end
-- Moved to parent loop so blueprints and copy/paste that doesn't include railloader entities still work correctly
-- bp.set_blueprint_entities(entities)
end

New response