Picker Dollies

by Nexela

Move most placed entities quickly and easily.

Utilities
1 year, 11 months ago
0.17 - 1.1
52.2K

b __PickerDollies__/control.lue:93 attempt to index local 'pdata' (a nil value)

2 years ago

In the attached save I get the following error when trying to move when using together with Staged Blueprint Planning https://mods.factorio.com/mod/bp100

PickerDollies/control.lue:93 attempt to index local 'pdata' (a nil value)

Savegame: https://drive.google.com/file/d/12LZVWPjDCb3du0vxe0cSMX0pGxByy5nP/view?usp=sharing

2 years ago
(updated 2 years ago)

IMPORTANT UPDATE: see last post instead

Author of bp100 here, I don't think this is related to my mod.

This happens when the mod is enabled on an existing save; peeking at the source, it seems that player data (global.pdata) isn't initialized for existing players during on_init.

Here's a possible fix:
add to on_init (and maybe on_configuration_changed):

for player in game.players do
  if global.pdata[player.index] == nil then global.pdata[player.index]={} end
end
2 years ago
(updated 2 years ago)

Taking a harder look at the source, this actually might be a bug in factorio stdlib?

2 years ago
(updated 2 years ago)

Just did a deep debug session, I think I found the issue:

Don't do global = {} during your on_init (this was added since v1.2.2). This overrides the data that stdlib has already initialized. This also removes the need for global players = global.players = {}.

2 years ago

Trying to get this to fix the problem but want to make sure i'm addin the correct line.

Ingame console do:

if global.pdata[player.index] == nil then global.pdata[player.index]={} end
end

correct?

2 years ago

uups, I started a new game with a few other mods and now I get the same error.
with my old mod pack, this not occurs.

2 years ago

Should be fixed.

2 years ago

Just did a deep debug session, I think I found the issue:

Don't do global = {} during your on_init (this was added since v1.2.2). This overrides the data that stdlib has already initialized. This also removes the need for global players = global.players = {}.

Yeah that was an oopsie on my part. I really should have had stdlib do a obfuscatedish name to avoid these brain farts.

New response