Pushbutton


A Pushbutton that emits the configured signal as a pulse when pressed.

21 days ago
0.14 - 2.0
32.2K

b Recipe for Pushbutton does not unlock if circuit-networks is already researched

5 years ago
(updated 5 years ago)

I noted when trying to add the mod to both existing worlds where circuit-networks was already researched and new worlds that it only correctly unlocked in the new worlds.

After some research I concluded the mod could be fixed by adding a migrations directory and lua file to check that if the tech has been researched and if so unlock the recipe. This allowed the mod to work in existing worlds.

The code I put in the migrations/pushbutton_0.17.0.lua file follows:

for index, force in pairs(game.forces) do
local technologies = force.technologies
local recipes = force.recipes

recipes["pushbutton"].enabled = technologies["circuit-network"].researched
end

Hope this helps, cheers o/

5 years ago

Thx, i did it over the game console

/c for index, force in pairs(game.forces) do local technologies = force.technologies local recipes = force.recipes recipes["pushbutton"].enabled = technologies["circuit-network"].researched end

Worked also

New response