Bluebuild

by Mylon

Allows blueprints to be used much earlier. Once a blueprint is placed, nearby entities will be auto-placed at 5/second so long as you have the objects in inventory and are standing still. Once items are marked for deconstruction, they will be auto-removed and put into inventory so long as you are standing still. Press b to toggle building, press n to toggle demolishing.

Utilities
4 years ago
0.14 - 1.1
6.17K
Blueprints

b __Bluebuild__/control.lua:186: attempt to perform arithmetic on field '?' (a nil value)

7 years ago

Factorio ver: 0.15.18
Mod ver: 1.1.4

I've used the Bluebuild rewritten ( https://mods.factorio.com/mods/gheift/ght-bluebuild ) for a while, but I decied to use the Bluebuild mod. I am playing a single-player game and I disabled Bluebuild rewuitten and enable Beluebuild.

Construction works as expected, however, when I try to demolish things using Deconstruction planner, I get a error like this:

Error while running event Bluebuild::on_tick (ID 0)
Bluebuild/control.lua:186: attempt to perform arithmetic on field '?' (a nil value)


After debugging your software, I found that 'global.blueLastDemo[builder.index]' has null(nil?) value. I believe that 'on_player_joined_game' event is not emitted in case of my usage (change mod settings when loading game) and 'initPlayer' function is not been called.

7 years ago
(updated 7 years ago)

I'm getting exact same error, just came here to post it only to find someone else already did.

What's the solution other than starting whole new game? Is there a way to force initPlayer with hotkey or something?
[edit]
I fixed it with temporary work-around:

Immediately after "script.on_event(defines.events.on_player_joined_game, function(event)
initPlayer(event)
end)" near line 273 (don't know line number before I changed)

I added this:
script.on_event(defines.events.on_player_deconstructed_area, function(event)
if not global.initializedPlayer then
global.initializedPlayer = true
initPlayer(event)
end
end)

so that the first time a player uses a deconstruction planner they're initialized once and never-more

New response