you'll need something like this in your control.lua
:
function register_events()
script.on_event(remote.call("glutenfree-rocket-silo-events", "on_rocket_silo_status_changed"), function()
local text = rocket_silo_status[event.old_status] ..' -> '.. rocket_silo_status[event.rocket_silo.rocket_silo_status]
game.print(event.tick .. ': ' .. text)
event.rocket_silo.surface.create_entity({
name = "flying-text",
position = event.rocket_silo.position,
text = text,
})
end
end
script.on_init(function(event)
-- any other code
register_events()
end)
script.on_load(function(event)
-- any other code
register_events()
end)