Page 1 of 1

[2.0.63] Modding events on_research_x does not contain player_index

Posted: Wed Aug 06, 2025 7:05 am
by Subject314159
What did you do?
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)
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

Re: [2.0.63] Modding events on_research_x does not contain player_index

Posted: Wed Aug 06, 2025 12:39 pm
by Rseding91
Thanks for the report. It looks like the names were simply wrong - it was including the player_index under the name "player" when it should have been "player_index". It's now fixed for the next release.