on_next_tick handler that doesn't need special case in on_load
Posted: Wed Sep 09, 2020 4:16 pm
I want to do something next tick. Currently, as best I can discern through discussing with folks on Discord, the most way to do this without just leaving an on_tick handler always running is to register a handler for on_nth_tick(game.tick+1) and record that in global.something, then in on_load read from global.something to register those handlers for someone who joins in between the two ticks in question, then in the handler do the desired thing and also do on_nth_tick(game.tick,nil) to unregister itself.
It would be nice if some or all of this was streamlined to be more straightforward.
It would be nice if some or all of this was streamlined to be more straightforward.