Script.on_event Error support
Posted: Sun Sep 04, 2016 5:47 pm
Code: Select all
script.on_event(defines.events.on_tick, ticker)
function ticker() -- run once per tickRate number of gameticks.
if (game.tick % RanaMods.ModularArmor.config.tickRate) == 0 then
tick()
else
end
--[[if (game.tick % 60) == 0 then
refresh_equipment()
end]]--
end
I request that if you do this, it should throw an error claiming the function can't be found, instead of silently doing nothing.
Wasted several days until I figured the problem out.
It works fine if it is registered in a function itself, presumably since the whole file was read before the function was called, but it doesn't work if its outside of a function. That is why I didn't realize the issue.