Page 1 of 1
Any changes to game.forces etc?
Posted: Fri Oct 16, 2015 1:04 pm
by oLaudix
game.forces.player stopped working. I didnt notice any changes to in changelog but game.forces.player throws error "attempt to index global 'game' (a nil value)" :/
game.players throws the same error :/
Re: Any changes to game.forces etc?
Posted: Fri Oct 16, 2015 3:24 pm
by daniel34
Re: Version 0.12.11 -
https://forums.factorio.com/forum/vie ... 87#p113069
kovarex wrote:oLaudix wrote:Any idea why stuff like
Code: Select all
for i,p in ipairs(game.players) do
suddenly throws error that 'game' is nil value after the update? Its the only thing that breaks my mods now and I don't really know why.
This is probably in the on_load method. And yes, this was exactly the goal, to disable the access to the game object in this event. There is no good reason for it, and it brings only possible toruble.
If you want to do some migration, you can use the event on_configuration_changed
EDIT: oops, didn't see it was actually you who posted in that thread