Construction Drones deprecated

by Klonan

Adds ground based personal construction robots.

Content
3 years ago
0.17 - 1.0
352
Logistic network

b crash

4 years ago

The mod Construction Drones caused a non-recoverable error.
Please report this error to the mod author.

Error while running event Construction_Drones::on_tick (ID 0)
Construction_Drones/script/construction_drone.lua:140: bad argument #1 of 2 to 'pairs' (table expected, got nil)
stack traceback:
[C]: in function 'pairs'
Construction_Drones/script/construction_drone.lua:140: in function 'get_characters'
Construction_Drones/script/construction_drone.lua:155: in function 'get_characters_in_distance'
Construction_Drones/script/construction_drone.lua:1088: in function 'check_function'
Construction_Drones/script/construction_drone.lua:554: in function 'check_priority_list'
Construction_Drones/script/construction_drone.lua:1120: in function 'check_repair_lists'
Construction_Drones/script/construction_drone.lua:1189: in function 'handler'
Construction_Drones/control.lua:37: in function <Construction_Drones/control.lua:35>

4 years ago
(updated 4 years ago)

.

4 years ago

trying to place a blueprint inside mk1 factory (factorissimo2 mod)

4 years ago
(updated 4 years ago)

ok, fast temporary hotfix in construction_drone.lua:
1) replace function for following:
local get_characters = function(surface, force)
local characters = data.characters[surface.index] and data.characters[surface.index][force.index]

setup_characters ()
characters = data.characters[surface.index] and data.characters[surface.index][force.index]

if characters == nil then
characters = {}
end
for k, character in pairs (characters) do
if not character.valid then
characters[k] = nil
end
end
return characters
end

2) move function before the function from 1)
local setup_characters = function()

FYI put all file in gist - https://gist.github.com/saaadel/4033909774a269811328daec1f84ac45
for Construction_Drones_0.2.2

4 years ago

works like a charm

4 years ago

but it is not optimized version.
what i see - two problems
1) possible nil in characters
2) not refreshed characters list on user enter/leaves another surface (factorissimo2 factories)

4 years ago

I have fixed it for the next version, unreleased yet

Thanks for the report

New response