events.on_tick not working
Posted: Sun Jan 15, 2017 10:24 am
I'm modifying an Oarc scenario to add PvP and diplomacy between teams, however the on_tick event isn't being processed.
This is the code in question:
I have tested the CheckPlayerColors function. If I call the function somewhere else, it works exactly as intended, but inside the on_tick event nothing is being called.
The code is located inside the control.lua file along with all of the other event code.
Does anyone know what might be preventing the on_tick code from running?
This is the code in question:
Code: Select all
script.on_event(defines.events.on_tick, function(event)
-- Runs every 5 seconds
if (game.tick % 300 == 0) then
CheckDiplomacy()
CheckPlayerColors()
end
-- Runs every 30 seconds
if (game.tick % 1800 == 0) then
end
end)
The code is located inside the control.lua file along with all of the other event code.
Does anyone know what might be preventing the on_tick code from running?