I am trying to create a timelapse from replay. For this I have edited the control.lua, so there we go already
I don't know if this is considered a bug (or just me being stupid.) but I thought I'd report it anyway, and let you be the judge of that.
The only change I made is adding below code to the control.lua.
Load replay. Put in on, say, 4x speed. Wait a few seconds. Error. (I say minutes in the title because it is fast forwarded )
Added to control.lua:
Code: Select all
script.on_event(defines.events.on_tick, function(event)
if event.tick % 3600 == 0 then --every 60 seconds
local counter = event.tick / 3600
local x_size = 1024
local y_size = 1024
local x_center = 0
local y_center = 0
local x_radius = 4
local y_radius = 4
local zoom = 0.5
local anti_alias = false
local ent_info = true
game.surfaces[1].daytime = 0
for j=-y_radius,y_radius do
for i=-x_radius,x_radius do
game.take_screenshot{resolution = {x = x_size, y = y_size},
zoom = zoom,
surface = game.surfaces[1],
allow_in_replay = true,
position = {i*x_size/32/zoom + x_center, j*y_size/32/zoom + y_center},
show_entity_info = ent_info,
anti_alias = anti_alias,
path = counter.."_image_"..j+y_radius.."_"..i+x_radius..".png"}
end
end
end
end)
Kind regards,
Niels