Page 2 of 2

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

Posted: Wed Dec 09, 2015 7:45 pm
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?

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

Posted: Sat Dec 12, 2015 11:15 am
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.

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

Posted: Mon Dec 14, 2015 7:54 pm
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.

Re: [MOD 0.12.22] {SSU} ScreenShot Utility

Posted: Tue Feb 16, 2016 8:10 pm
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?

Re: [MOD 0.12.22] {SSU} ScreenShot Utility

Posted: Thu Feb 18, 2016 6:31 pm
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*)

Re: [MOD 0.12.22] {SSU} ScreenShot Utility

Posted: Fri Feb 19, 2016 1:18 pm
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).

Re: [MOD 0.12.22] {SSU} ScreenShot Utility

Posted: Sun Feb 21, 2016 3:18 pm
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.

Re: [MOD 0.12.22] {SSU} ScreenShot Utility

Posted: Sun Feb 21, 2016 6:54 pm
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)

Re: [MOD 0.12.22] {SSU} ScreenShot Utility

Posted: Mon Feb 22, 2016 9:38 am
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.

Re: [MOD 0.12.22] {SSU} ScreenShot Utility

Posted: Mon Feb 22, 2016 9:42 am
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 :)

Re: [MOD 0.12.22] {SSU} ScreenShot Utility

Posted: Mon Feb 22, 2016 11:38 am
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 -_-

Re: [MOD 0.12.27] {SSU} ScreenShot Utility

Posted: Sun May 29, 2016 10:14 pm
by binbinhfr
The "show gui" does not work for me in v0.12.34
Am I the only one to have this problem ?

Re: [MOD 0.12.27] {SSU} ScreenShot Utility

Posted: Wed Jun 01, 2016 5:15 pm
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.

Re: [MOD 0.12.27] {SSU} ScreenShot Utility

Posted: Wed Jun 01, 2016 5:47 pm
by binbinhfr
I made a report here, because it seems that game.take_screenshot changed...
viewtopic.php?f=29&t=25878

Re: [MOD 0.12.27] {SSU} ScreenShot Utility

Posted: Wed Jun 01, 2016 7:44 pm
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.

Re: [MOD 0.12.27] {SSU} ScreenShot Utility

Posted: Fri Jun 10, 2016 11:32 pm
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