Picker Dollies

by Nexela

Move most placed entities quickly and easily.

Utilities
1 year, 4 months ago
0.17 - 1.1
41.9K

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

1 year, 5 months 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

1 year, 5 months ago
(updated 1 year, 5 months 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
1 year, 5 months ago
(updated 1 year, 5 months ago)

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

1 year, 5 months ago
(updated 1 year, 5 months 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 = {}.

1 year, 5 months 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?

1 year, 5 months 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.

1 year, 5 months ago

Should be fixed.

1 year, 5 months 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