Planet Picker


Pick your individual starting planet.

Tweaks
19 days ago
2.0
1.34K
Environment

g Crash

7 days ago
(updated 7 days ago)

Sorry for the incomplete log. It happened when I adjusted the planet parallax and planet final scale setting in the Visilble Planet mod. From the log it looks like there are some compatibility issues between the Visible Planet and Planet Picker.

I also made a post on that forum
https://mods.factorio.com/mod/visible-planets/discussion/675ed20d04868c48bdd7d7ec


planet-picker/control.lua:21: bad argument #3 of 3 to 'index' (string expected, got nil)
stack traceback:
[C]: in function '__index'
__planet-picker
/control.lua:21: in function <planet-picker/control.lua:20>
stack traceback:
[C]: in function 'newindex'
__visible-planets
/control_stuff/render_planets.lua:50: in function <visible-planets/control_stuff/render_planets.lua:21>
2449.752 Error ServerMultiplayerManager.cpp:84: MultiplayerManager failed: "The mod Visible Planets in Space (1.2.6) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event visible-planets::on_runtime_mod_setting_changed (ID 64)
The mod Planet picker (0.4.3) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event planet-picker::on_runtime_mod_setting_changed (ID 64)
planet-picker/control.lua:21: bad argument #3 of 3 to 'index' (string expected, got nil)
stack traceback:
[C]: in function '__index'
__planet-picker
/control.lua:21: in function <planet-picker/control.lua:20>
stack traceback:
[C]: in function 'newindex'
__visible-planets
/control_stuff/render_planets.lua:50: in function <visible-planets/control_stuff/render_planets.lua:21>"
2449.752 Info ServerMultiplayerManager.cpp:806: updateTick(6769268) changing state from(InGame) to(Failed)
2449.752 Quitting: multiplayer error.
2449.752 Info GlobalContext.cpp:760: Deleting active scenario.
2450.270 Info ServerMultiplayerManager.cpp:146: Quitting multiplayer connection.
2450.270 Info ServerMultiplayerManager.cpp:806: updateTick(18446744073709551615) changing state from(Failed) to(Closed)
2450.270 Info ServerMultiplayerManager.cpp:166: Deleting active scenario (global = true).
2450.271 Info HttpSharedState.cpp:55: Downloading https://multiplayer.factorio.com/remove-game/19946859
2451.193 Info UDPSocket.cpp:233: Closing socket
2451.193 Info UDPSocket.cpp:263: Socket closed

7 days ago
(updated 7 days ago)

Copying here what I put on my end; I'm pretty sure I know what is causing the crash.

My mod's (Visible Planets) visible-planets-regen-renders setting triggers a reset of all it's planet renders when enabled, and turns the setting back off when it's done.
Planet picker has a function (planet-picker/control.lua:20) that runs whenever a setting is changed, and it makes a bad assumption that a setting is always changed by a player. When it tries to get the player that changed the setting, it gets nil because my mod changed it's own setting, not a player. You can't get the nil-th player in a game, so it crashes.

You should be able to fix this by just checking if e.player_index is nil, and doing nothing (or something else) if it's nil.

(Edit: I should mention this is just my guess as to the problem)

New response