Hi,
it seems that in on_research_finished event, when you try to read recipe.enabled on the recipes that have just been found, it gives false
example : research automation and in on_research_finished event, print :
game.forces.player.recipes["assembling-machine-1"].enabled and game.forces.player.recipes["long-handed-inserter"].enabled )
it will give false false
if you do it afterwards, outside the event, it will give true true.
on_research_finished and LuaRecipe.enabled
on_research_finished and LuaRecipe.enabled
My mods on the Factorio Mod Portal ![Geek :geek:](./images/smilies/icon_e_geek.gif)
![Geek :geek:](./images/smilies/icon_e_geek.gif)
Re: on_research_finished and LuaRecipe.enabled
Don't reference technologies directly like that - it's wrong in 3 ways:
1. The research being completed doesn't have to be on the player force so using game.forces.player is incorrect
3. The research being completed is passed in the event parameters: event.research
2. The research being completed doesn't have to contain "assembling-machine-1" even if it is the automation research - use event.research.effects to see what the technology will actually do
As for it not applying effects before calling the event, fixed for 0.13.10.
1. The research being completed doesn't have to be on the player force so using game.forces.player is incorrect
3. The research being completed is passed in the event parameters: event.research
2. The research being completed doesn't have to contain "assembling-machine-1" even if it is the automation research - use event.research.effects to see what the technology will actually do
As for it not applying effects before calling the event, fixed for 0.13.10.
If you want to get ahold of me I'm almost always on Discord.
Re: on_research_finished and LuaRecipe.enabled
Of course rsedingRseding91 wrote:Don't reference technologies directly like that
![Smile :-)](./images/smilies/icon_e_smile.gif)
My mods on the Factorio Mod Portal ![Geek :geek:](./images/smilies/icon_e_geek.gif)
![Geek :geek:](./images/smilies/icon_e_geek.gif)