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.
on_next_tick handler that doesn't need special case in on_load
Re: on_next_tick handler that doesn't need special case in on_load
I don't consider this worth the time, effort, potential bugs, and confusion around mod developers to do anything with.
Just subscribe to on_tick and put an if at the top to return if there's no work to do.
Just subscribe to on_tick and put an if at the top to return if there's no work to do.
If you want to get ahold of me I'm almost always on Discord.