Screenshot every other tick

Enhance your gameplay with these tools. This category is also the right place for tools useful for modders.
Mod databases, calculators, cheatsheets, multiplayer, scripts, libs and other useful stuff that is not strictly in-game mods.
Basic
Manual Inserter
Manual Inserter
Posts: 4
Joined: Wed May 02, 2018 11:15 pm
Contact:

Screenshot every other tick

Post by Basic »

I'm trying to generate a video of a factory that's larger than the max render area. I'd like to capture 30-60 seconds.

It occurs to me that if I can trigger a "capture screenshot" every other tick, I could then stitch them back together at 30 FPS. (Or worst case, every tick and then either discard half or generate a 60FPS vid).

I don't care about wall-clock time for the capture so long as I can get a consistently-spaced set of frames to stitch back together. (Although I'd gladly accept a better approach)

Is there a way I can achieve this from the console? Or do I need to get more advanced?
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3714
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Screenshot every other tick

Post by DaveMcW »

Code: Select all

/c script.on_nth_tick(2, function()
  game.take_screenshot{
    position = {0, 0},
    resolution = {1920, 1280},
    zoom = 1,
    daytime = 0,
    show_entity_info = true,
    path = "movie/" .. game.tick .. ".png",
  }
end)
Note that the screenshot compression is quite slow and will drop frames if it can't keep up, so you might have to slow the game down to get a smooth video. If you have a lot of hard drive space, you could save as .bmp which doesn't use compression.
Post Reply

Return to “Tools”