[MOD 0.12.27] {SSU} ScreenShot Utility

Topics and discussion about specific mods
User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 582
Joined: Tue May 19, 2015 1:56 am
Contact:

Re: [MOD 0.12.11+] {SSU} ScreenShot Utility

Post by Reika »

matjojo wrote:Although I cannot retain settings between sessions of playing, I sadly do not have a lot of time on my hands so I don't think I can update before the next week or so, still. I'll go as fast a possible.

matjojo
Is that not what the "global" dataspace is for?

Alternatively, what could I edit in the mod scripts to make having both checked the default?
Image

matjojo
Filter Inserter
Filter Inserter
Posts: 337
Joined: Wed Jun 17, 2015 6:08 pm
Contact:

Re: [MOD 0.12.11+] {SSU} ScreenShot Utility

Post by matjojo »

Reika wrote:
matjojo wrote:Although I cannot retain settings between sessions of playing, I sadly do not have a lot of time on my hands so I don't think I can update before the next week or so, still. I'll go as fast a possible.

matjojo
Is that not what the "global" dataspace is for?

Alternatively, what could I edit in the mod scripts to make having both checked the default?

If you would want to you could just add the enabled tag to the tables that have the information for the checkboxes in them. for the mod to remember it you need to add two variables to save the states.

matjojo
Filter Inserter
Filter Inserter
Posts: 337
Joined: Wed Jun 17, 2015 6:08 pm
Contact:

Re: [MOD 0.12.11+] {SSU} ScreenShot Utility

Post by matjojo »

Just added a new release,

Version 1.0.4 (14/12/2015): Added in session saving of "show gui" and "show alt overlay" buttons
Download is on the original post.
If anyone wants to see an addition to SSU please feel free to post.

MrDrummer
Fast Inserter
Fast Inserter
Posts: 131
Joined: Sat Nov 22, 2014 2:51 pm
Contact:

Re: [MOD 0.12.22] {SSU} ScreenShot Utility

Post by MrDrummer »

Is it possible to add an item that acts like the planners to make the area selected the area that is screenshoted? I am working on an application that manages blueprints, and this would be a great feature instead of relying on external programs like Greenshot to capture an area. This item would automatically place in the coordinates into the position helper sort of like "from top left corner to bottom right corner" instead of the way it works currently (which by looking at the code I assume works by looking at the height and width of the game screen).

I would modify this mod to implement the idea above, but I would be lieing if I said I know Lua.



Sudden thought: Is the feature mentioned above not possible to implement? Does the Factorio API only take screenshots in the view-port as opposed to a variable size?

matjojo
Filter Inserter
Filter Inserter
Posts: 337
Joined: Wed Jun 17, 2015 6:08 pm
Contact:

Re: [MOD 0.12.22] {SSU} ScreenShot Utility

Post by matjojo »

MrDrummer wrote:Is it possible to add an item that acts like the planners to make the area selected the area that is screenshoted? I am working on an application that manages blueprints, and this would be a great feature instead of relying on external programs like Greenshot to capture an area. This item would automatically place in the coordinates into the position helper sort of like "from top left corner to bottom right corner" instead of the way it works currently (which by looking at the code I assume works by looking at the height and width of the game screen).

I would modify this mod to implement the idea above, but I would be lieing if I said I know Lua.



Sudden thought: Is the feature mentioned above not possible to implement? Does the Factorio API only take screenshots in the view-port as opposed to a variable size?

your last thought is correct, the API only takes these attributes:
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)?

and all of these you can currently use in SSU, if there would be more options, I would certainly implement more options, but it currently is not possible.

EDIT: I'm sorry if you looked much into the code, it is badly written and spaghetti-code (*blushes*)

MrDrummer
Fast Inserter
Fast Inserter
Posts: 131
Joined: Sat Nov 22, 2014 2:51 pm
Contact:

Re: [MOD 0.12.22] {SSU} ScreenShot Utility

Post by MrDrummer »

Okay fair enough. In which case i have an idea as a workaround (may take a lot of logic to get right).

So solution is that the zoom and position of player auto fit to the selected area. Obviously if the monitor is square and you select a (landscape) rectangular area, there is going to be an area at the top/bottom that is redundant, but the zoom would be just right to match the width of the selected area.

I know this is possible for the player to do manually by tinkering with the various settings already implemented, but with the use of my Blueprint Manager (which works a treat btw), they will be taking screenshots of every single blueprint they have/use between saves/versions of Factorio (which for me is a lot).

I don't know what info you can get from the region with a planner tool, but it should be possible for as long as you can get the width/height (either in tiles or px).

matjojo
Filter Inserter
Filter Inserter
Posts: 337
Joined: Wed Jun 17, 2015 6:08 pm
Contact:

Re: [MOD 0.12.22] {SSU} ScreenShot Utility

Post by matjojo »

MrDrummer wrote:Okay fair enough. In which case i have an idea as a workaround (may take a lot of logic to get right).

So solution is that the zoom and position of player auto fit to the selected area. Obviously if the monitor is square and you select a (landscape) rectangular area, there is going to be an area at the top/bottom that is redundant, but the zoom would be just right to match the width of the selected area.

I know this is possible for the player to do manually by tinkering with the various settings already implemented, but with the use of my Blueprint Manager (which works a treat btw), they will be taking screenshots of every single blueprint they have/use between saves/versions of Factorio (which for me is a lot).

I don't know what info you can get from the region with a planner tool, but it should be possible for as long as you can get the width/height (either in tiles or px).

well, you cannot get the with and height of a planner tool, the things you can get:
set and get the entities: allows you to look through the entities, and could be used to get the width and height in tiles though with use of some valuable logic-time.
set and get blueprint tiles: allows you to look through the tiles of this entity, don't exactly know what this is, but this might just be the thing we need.
blueprint icon and cost to build, these wont tell us what we need.

Just do I get what you are going with, you wish to use the screenshot abilities of SSU to add screenshots to the blueprints in the manager?

I'll do some testing on the tiles thing, I'll tell you whatever I find.

MrDrummer
Fast Inserter
Fast Inserter
Posts: 131
Joined: Sat Nov 22, 2014 2:51 pm
Contact:

Re: [MOD 0.12.22] {SSU} ScreenShot Utility

Post by MrDrummer »

Ah, not as straight forward as i hoped.

And yes, I need the users of my program to be able to take a screenshot of the blueprint they are saving. The use of this mod would allow no external programs to be used, but rather two mods - this mod to take screenshots of the blueprint, and the blueprint string mod.

The idea is for this utility to be able to be used throughout iterations of Factorio - I use the portable version of Factorio to use between computers, and have each version of Factorio too, so i want to be able to use this utility without having to redirect the path every time I upgrade versions. All this does it move/copy all screenshots/blueprint string files into one, shared folder, where the screenshots and text files are matched up so you can view the blueprint and copy the string - useful for when starting a brand new factory.

The logic for the blueprint string mod is far beyond my understanding to try and puzzle together a preview pic (like when you hover over the blueprint in question), so i thought a screenshot would be fine.

I guess for now, the user will just have to play with the settings currently implemented within Screenshot utility to get the correct zoom to take a decent screenshot.

Thanks for the help, like i say, I know next to nothing in terms of Lua, so this is a big help :)

P.S. I have to work out a few bugs with the utility before i shall release it (or put it on github)

matjojo
Filter Inserter
Filter Inserter
Posts: 337
Joined: Wed Jun 17, 2015 6:08 pm
Contact:

Re: [MOD 0.12.22] {SSU} ScreenShot Utility

Post by matjojo »

MrDrummer wrote:Ah, not as straight forward as i hoped.

And yes, I need the users of my program to be able to take a screenshot of the blueprint they are saving. The use of this mod would allow no external programs to be used, but rather two mods - this mod to take screenshots of the blueprint, and the blueprint string mod.

The idea is for this utility to be able to be used throughout iterations of Factorio - I use the portable version of Factorio to use between computers, and have each version of Factorio too, so i want to be able to use this utility without having to redirect the path every time I upgrade versions. All this does it move/copy all screenshots/blueprint string files into one, shared folder, where the screenshots and text files are matched up so you can view the blueprint and copy the string - useful for when starting a brand new factory.

The logic for the blueprint string mod is far beyond my understanding to try and puzzle together a preview pic (like when you hover over the blueprint in question), so i thought a screenshot would be fine.

I guess for now, the user will just have to play with the settings currently implemented within Screenshot utility to get the correct zoom to take a decent screenshot.

Thanks for the help, like i say, I know next to nothing in terms of Lua, so this is a big help :)

P.S. I have to work out a few bugs with the utility before i shall release it (or put it on github)


have you read the newest FFF? link I have a feeling we might just get the possibility to use those previews as a way to get screenshots. I'll ask the devs in the thread.

MrDrummer
Fast Inserter
Fast Inserter
Posts: 131
Joined: Sat Nov 22, 2014 2:51 pm
Contact:

Re: [MOD 0.12.22] {SSU} ScreenShot Utility

Post by MrDrummer »

Sweet. Thanks for looking into it.

I shall (Hopefully) release the utility on GitHub and possibly on the forum too, depends if I can work out a few bugs :)

matjojo
Filter Inserter
Filter Inserter
Posts: 337
Joined: Wed Jun 17, 2015 6:08 pm
Contact:

Re: [MOD 0.12.22] {SSU} ScreenShot Utility

Post by matjojo »

MrDrummer wrote:Sweet. Thanks for looking into it.

I shall (Hopefully) release the utility on GitHub and possibly on the forum too, depends if I can work out a few bugs :)
working out bugs is the best -_-

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: [MOD 0.12.27] {SSU} ScreenShot Utility

Post by binbinhfr »

The "show gui" does not work for me in v0.12.34
Am I the only one to have this problem ?
My mods on the Factorio Mod Portal :geek:

matjojo
Filter Inserter
Filter Inserter
Posts: 337
Joined: Wed Jun 17, 2015 6:08 pm
Contact:

Re: [MOD 0.12.27] {SSU} ScreenShot Utility

Post by matjojo »

binbinhfr wrote:The "show gui" does not work for me in v0.12.34
Am I the only one to have this problem ?

That's weird I'll look into it.

I can confirm, something is wrong, I'll take a look at the changelogs.

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: [MOD 0.12.27] {SSU} ScreenShot Utility

Post by binbinhfr »

I made a report here, because it seems that game.take_screenshot changed...
viewtopic.php?f=29&t=25878
My mods on the Factorio Mod Portal :geek:

matjojo
Filter Inserter
Filter Inserter
Posts: 337
Joined: Wed Jun 17, 2015 6:08 pm
Contact:

Re: [MOD 0.12.27] {SSU} ScreenShot Utility

Post by matjojo »

binbinhfr wrote:I made a report here, because it seems that game.take_screenshot changed...
viewtopic.php?f=29&t=25878

Thanks, I'll mix into the conversation as I already have some hours into how screenshots work with this being my mod and all.

Tankh
Long Handed Inserter
Long Handed Inserter
Posts: 61
Joined: Tue Aug 12, 2014 1:35 pm
Contact:

Re: [MOD 0.12.27] {SSU} ScreenShot Utility

Post by Tankh »

This mod might be better than my impromptu screenshot command

Code: Select all

/c game.take_screenshot{zoom=1, resolution={3200, 2000}, path="Screenshot_" .. game.player.name .. "_" .. math.floor(game.tick/60/3600) .. "h" .. math.floor(game.tick/60/60%60) .. "m" .. math.floor(game.tick/60%60) .. "s" .. ".png"}
:D

Post Reply

Return to “Mods”