on_next_tick handler that doesn't need special case in on_load

Things that we aren't going to implement
sparr
Smart Inserter
Smart Inserter
Posts: 1462
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

on_next_tick handler that doesn't need special case in on_load

Post by sparr »

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.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14590
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: on_next_tick handler that doesn't need special case in on_load

Post by Rseding91 »

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.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Won't implement”