[2.0.63] Modding events on_research_x does not contain player_index

Bugs which we just recently fixed in our development version and will reach you in the next release.
Subject314159
Burner Inserter
Burner Inserter
Posts: 10
Joined: Thu Oct 12, 2023 8:53 pm
Contact:

[2.0.63] Modding events on_research_x does not contain player_index

Post 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
Rseding91
Factorio Staff
Factorio Staff
Posts: 15962
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post 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.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Resolved for the next release”