Page 1 of 1

[0.17.33] game.take_screenshot not store file it self from control.lua

Posted: Fri Apr 26, 2019 11:52 am
by Dontblameme
Hello, i am trying do timelapse video from my replay and iam using that method to add script.on_nth_tick and then game.take_screenshot. But only what is created is my folder what i defined in script in "script-output" folder but no pictures at all.

But when i run same command from console it wokred.

Here is my code what iam putting into control.lua of my replay.

Code: Select all

script.on_nth_tick(3600, function(event)
  game.take_screenshot{
    surface = game.surfaces[1],
    position = {50,0},
    resolution = {2000,1500},
    zoom = 0.25,
    path = "timelapse/" .. string.format("%06d" , event.tick/event.nth_tick) .. ".png",
    show_entitiy_info = false
  }
end)

Re: [0.17.33] game.take_screenshot not store file it self from control.lua

Posted: Fri Apr 26, 2019 11:58 am
by Klonan
The ability to take screenshots while in a replay was removed due to this bug report: 65901

Re: [0.17.33] game.take_screenshot not store file it self from control.lua

Posted: Fri Apr 26, 2019 12:30 pm
by Dontblameme
Hi Klonan, thanks, i saw that report, and i already stared have feeling that this may be an issue ... any tips how to do it now? With mods only during playing the game, or some vanilla aproach? thanks btw.

Re: [0.17.33] game.take_screenshot not store file it self from control.lua

Posted: Wed Sep 04, 2019 2:57 am
by murgo
It would be great if this would be taken into further consideration. I was hoping to make a timelapse of our multiplayer replay, panning the camera outwards as time went on but it doesn't work because of this.

Replays are pretty nifty feature and one big use case for them are timelapses, so I hope this can be reallowed at some point. Built-in timelapse support would be pretty cool in itself but I can handle doing the camerawork via scripting, if only the take_screenshot would work in replays. It could even be a different function for all I care (take_screenshot_from_replay or something).

It's so close to being perfect and easy with the great replay system and the great scripting system.