How does technology_to_unlock work for Prototype/Shortcut?
Posted: Sun May 01, 2022 11:57 pm
I've defined this prototype:
I expected that the shortcut would not be visible until "automobilism" was researched. But when I started a new game without cheats, the shortcut was visible right from the beginning.
In control.lua, there is this:
The log file shows that the shortcut is not only visible, but also active. So, where is my mistake?
Code: Select all
{
type = "shortcut",
name = "GCKI_car-key",
action = "lua",
icon = {
filename = GCKI.modRoot.."/graphics/"..icon,
size = 64,
mipmap_count = 1,
},
technology_to_unlock = "automobilism",
},
In control.lua, there is this:
Code: Select all
script.on_event(defines.events.on_lua_shortcut, function(event)
log("on_lua_shortcut("..serpent.line(event)..")")
end)