game.take_screenshot additions.

credomane
Filter Inserter
Filter Inserter
Posts: 307
Joined: Tue Apr 12, 2016 6:21 pm
Contact:

game.take_screenshot additions.

Post by credomane »

Current game.take_screenshot options table is

Code: Select all

    player :: LuaPlayer (optional)
    by_player :: LuaPlayer (optional)
    position :: Position (optional)
    resolution :: Position (optional)
    zoom :: double (optional)
    path :: string (optional): Path to save the screenshot in
    show_gui :: boolean (optional): Include game GUI in the screenshot?
    show_entity_info :: boolean (optional): Include entity info (alt-mode)?
My proposed update is to add surface and brightness fields to the options table

Code: Select all

    player :: LuaPlayer (optional)
    by_player :: LuaPlayer (optional)
    position :: Position (optional)
    surface :: LuaSurface (optional)
    resolution :: Position (optional)
    zoom :: double (optional)
    path :: string (optional): Path to save the screenshot in
    show_gui :: boolean (optional): Include game GUI in the screenshot?
    show_entity_info :: boolean (optional): Include entity info (alt-mode)?
    brightness :: double (optional) :: Take screenshot at specified brightness 14% is in-game night and 100% is normal daylight.
Surface is needed to make sure the screenshot is take of the right surface and not the player's current surface. This is especially important for mods that make time-lapses or create a map of your world. Now that mods like factorissimo creating multiple surfaces the chance of the screenshot being of the completely wrong surface than intended increases rapidly.

Brightness is needed to allow for screenshots to always be taken at a specific brightness level regardless of what the surface brightness currently is. Removes the need to perform ugly "hacks" to simulate this. The train cameras already seem to do this so I, naively, assume giving this power to take_screenshot is quick-n-easy.
credomane
Filter Inserter
Filter Inserter
Posts: 307
Joined: Tue Apr 12, 2016 6:21 pm
Contact:

Re: game.take_screenshot additions.

Post by credomane »

I know this is an old post but I figured I would revive it rather than duplicate it.

Would it be possible to add these additions to the screenshot function? The camera GUI element can already specify what surface it wants. I figure adding that to the screenshot function shouldn't be "too much" work and highly convenient for mods than make use of screenshots.

Adding in the ability to say what the brightness is in the screenshot would remove the need for ugly work-arounds.
Bilka
Factorio Staff
Factorio Staff
Posts: 3309
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: game.take_screenshot additions.

Post by Bilka »

Surface and daytime parameters were added to take_screenshot at some point. I will take the liberty to assume that daytime covers your usecase for brightness, since you mention the day and night brightness values.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Post Reply

Return to “Implemented mod requests”