[2.0.63] Modding events on_research_x does not contain player_index
Posted: Wed Aug 06, 2025 7:05 am
What did you do?
Running Factorio with only one single mod with only following script
Open the technology screen, then add/move/remove technology in the queue
What happened?
Output = "On_research_ by player: nil"
What did you expect to happen instead?
The output should be "On_research_ by player: <player index who adjusted the queue>" as per the API docs
Does it happen always, once, or sometimes?
Happens always, tested in 2.0.60 stable and 2.0.63 experimental, both single player and multiplayer
Running Factorio with only one single mod with only following script
Code: Select all
-- control.lua
script.on_event(defines.events.on_research_queued, function(e) -- Also tested with on_research_moved, on_research_cancelled
game.print("On_research_ by player: " .. serpent.line(e.player_index))
end)
What happened?
Output = "On_research_ by player: nil"
What did you expect to happen instead?
The output should be "On_research_ by player: <player index who adjusted the queue>" as per the API docs
Does it happen always, once, or sometimes?
Happens always, tested in 2.0.60 stable and 2.0.63 experimental, both single player and multiplayer