[0.12.15] Cannot index game.force on script.on_load
Posted: Wed Oct 28, 2015 10:01 pm
As title
Screenshot
im not sure if its a bug or something deliberate, but this worked no problem in 0.12.0-0.12.10www.factorio.com
https://forums.factorio.com/
It's that.FactorioBot wrote: The callback registered in on_load function doesn't have access to the game API.
Ahh right, I must've glossed over that one, thanks for pointing it outAdil wrote:Well, remember the release notesIt's that.FactorioBot wrote: The callback registered in on_load function doesn't have access to the game API.
You can only now work with your mod data during the event. Event if there are references to game objects in that your data, I believe you cannot use their api anyway.
By using the on_init and on_configuration_changed (https://forums.factorio.com/wiki/inde ... on_changed), you should be able to do all you need.Klonan wrote:Ahh right, I must've glossed over that one, thanks for pointing it outAdil wrote:Well, remember the release notesIt's that.FactorioBot wrote: The callback registered in on_load function doesn't have access to the game API.
You can only now work with your mod data during the event. Event if there are references to game objects in that your data, I believe you cannot use their api anyway.