RITEG


Radioisotope thermoelectric generator, as known as RITEG or RTG. The starting power output is 600 kW, the half life about 12 hours.

Content
a month ago
0.16 - 2.0
3.90K
Power

b Doesn't appear in crafting menus though nuclear power is researched

6 years ago
(updated 6 years ago)

The subject says it all. I added it to an existing game where nuclear power is researched and nothing appeared in the crafting menus. I even checked out what I could build with a centrifuge or a level 3 assembler just to make sure.

I do have a few other mods active. I can give a full accounting if need be, but the only mod I could think was interfering was this one: https://mods.factorio.com/mod/RTG

6 years ago

Making this function in control.lua look like this fixes the issue:

script.on_configuration_changed(function(data)
try_init ()
add_all_rtgs_to_table ()
for i, force in pairs(game.forces) do
if force.technologies["nuclear-power"].researched then
force.recipes["RITEG-1"].enabled = true
else
force.recipes["RITEG-1"].enabled = false
end
end
end)

Basically, this causes the items to be enabled or disabled on startup based on what technologies have been researched.

6 years ago
(updated 6 years ago)

It's much easier:
https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.reset_technology_effects

function update_recipes ()
  for i, force in pairs (game.forces) do
    force.reset_technology_effects()
  end
end

New response