I noticed that in the call to on_research_finished event,
the value of player.force.technology[researched_techno].researched was not true yet.
Is it voluntary ?
on_research_finished and techno researched status not true
Re: on_research_finished and techno researched status not true
It's fixed for 0.13.
Also you should be using the event.research that the event passes instead of re-looking up the research. The event only gets fired when research is completed so you can know for sure the research is researched that's being passed from the event.
http://lua-api.factorio.com/0.12.33/eve ... h_finished
Also you should be using the event.research that the event passes instead of re-looking up the research. The event only gets fired when research is completed so you can know for sure the research is researched that's being passed from the event.
http://lua-api.factorio.com/0.12.33/eve ... h_finished
If you want to get ahold of me I'm almost always on Discord.
Re: on_research_finished and techno researched status not true
ok for the fix.Rseding91 wrote:It's fixed for 0.13.
Also you should be using the event.research that the event passes instead of re-looking up the research. The event only gets fired when research is completed so you can know for sure the research is researched that's being passed from the event.
http://lua-api.factorio.com/0.12.33/eve ... h_finished
because for now I use :
Code: Select all
--------------------------------------------------------------------------------------
function on_research_finished(event)
if event.research ~= nil and event.research.name == "camera-drones" then
local player
for _,player in pairs(game.players) do
player.print( player.name .. " drones researched = " .. tostring(player.force.technologies["camera-drones"].researched) )
init_player(player)
end
end
end
script.on_event(defines.events.on_research_finished, on_research_finished )
so the call to my function init_player (that is used in other cases), that tests the techno.researched status, is bad. But I will do a turnaround, waiting for 0.13
My mods on the Factorio Mod Portal
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: on_research_finished and techno researched status not true
Considering this is an event that triggers when the research is completed, you could just use the line:
Code: Select all
player.print( player.name .. " drones researched = true")
Re: on_research_finished and techno researched status not true
hé hé, that's what I wanted to show : for the moment, it does not write "true", but "false" !bobingabout wrote:Considering this is an event that triggers when the research is completed, you could just use the line:Code: Select all
player.print( player.name .. " drones researched = true")
will be corrected in 0.13 as rseding said.
My mods on the Factorio Mod Portal