Screenshot
im not sure if its a bug or something deliberate, but this worked no problem in 0.12.0-0.12.10[0.12.15] Cannot index game.force on script.on_load
Re: [0.12.15] Cannot index game.force on script.on_load
Well, remember the release notes
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.
It'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.
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
I also update mods, some of them even work.
Recently I did a mod tutorial.
Re: [0.12.15] Cannot index game.force on script.on_load
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.
Re: [0.12.15] Cannot index game.force on script.on_load
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.
on_init is for starting the game, on_configuration_changed is for updating when your mod is added, or some mod version changed (including your mod).