Train Supply Manager (TSM)


Control train scheduling via a publish/subscribe event based system. Easy to use, and stress tested to gigabase level. Includes automated refueling. Distributed priorities for sourcing, and request priorities. Setup via simple to use GUIs and basic combinators.

Content
1 year, 5 days ago
0.17 - 1.1
16.4K
Trains

b [To be researched] Full blueprint mode broken (bugfix in description)

2 years ago
(updated 2 years ago)

The "full blueprint mode" appears to be broken in 1.1.7- it doesn't actually copy the requester lamp details when you create a blueprint. It appears that the current code attempts to get an entity's priority, which doesn't exist (it's actually associated with the publisher). Patch to fix is below (I couldn't find a github for a pull request):

diff --git a/bp.lua b/bp.lua
index 5013605..ff8df50 100644
--- a/bp.lua
+++ b/bp.lua
@@ -22,15 +22,15 @@ script.on_event(defines.events.on_player_configured_blueprint, function(event)
     --    game.print("BP held")
         for idx,bp_entity in pairs(global.player[event.player_index].bp) do
         --     game.print(idx .. " :  " .. bp_entity.unit_number)
-            for i,entity in pairs(global.newpublishers[player.surface.name]) do
-               for j,res_entity in pairs(entity) do
+            for i,publisher in pairs(global.newpublishers[player.surface.name]) do
+               for j,res_entity in pairs(publisher) do
                     if res_entity.entity.unit_number == bp_entity.unit_number then
                     --    game.print("entity =  bp entity")
                         stack.set_blueprint_entity_tags(idx, {
-                            resource = res_entity.priority.resource,
-                            id = res_entity.priority.id,
-                            hide = res_entity.hide,
-                            proc_priority = res_entity.proc_priority
+                            resource = publisher.priority.resource,
+                            id = publisher.priority.id,
+                            hide = publisher.hide,
+                            proc_priority = publisher.proc_priority
                         })
                         break
                    end

New response