Any changes to game.forces etc?

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
User avatar
oLaudix
Filter Inserter
Filter Inserter
Posts: 285
Joined: Sun Jun 14, 2015 3:24 pm
Contact:

Any changes to game.forces etc?

Post 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 :/
Image
daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Any changes to game.forces etc?

Post 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 :oops:
quick links: log file | graphical issues | wiki
Post Reply

Return to “Technical Help”