Hi guys
This time I'm coming with other workaround, take screenshoot while testing/Playing standalone, for later use; save/load game menu.
Firts of all there is not a way to capture screen via plane LUA standard api, without using external libs/modules.
There are different ways we can capture screen via code, anyway we just can use those being handle/compatible, wih LUA.
1- The well know f10 key. whose take shot and saved it into your "
GameGuru files" folder.
>CONTS<
a-F10 does not gives us the chance to select where you want to store these shots.
b- You need phisycally hit the f10 key to take shots*
There are many other ways using keystrokes combination, in fact I've got all them working fine via LUA script.
SO, WHAT'S THE PROBLEM?
Well, the problem is as follow:
You need to use some sort of sendkey to send the keystrokes to the system, so windows behave like you are pressing these keys.
And all them takes the shoot as expected, the problem is that ugly/black cmd win appearing on the top of the screenshot, that makes the shot useless to be use as Loadgame shot.
There is not way to avoid that cmd win, I'm using os.execute to run the command line, but as I've readed from the net:
Quote: "The problem with os.execute is that it uses C system function under the hood, which in turn is probably implemented by executing the Windows command shell executable cmd.exe, which is a command line application. Thus every time you use os.execute you are indeed executing cmd.exe. That black box is the console window associated with cmd.exe being executed."
GG does not respond to the f10 keypress event (using sendkey command), does not capture the screen, such as when you press the f10 key.
For those than don't know, sendkey is a command than emulate keys being pressed, so: "sendkey ctrl+alt+del" open the
taskmanager, like you has pressed them, phisycally.
But GG does not, when you send key f10. I don't know why, It would be nice if Lee can give me some clue.
Summarizing, all forms that involve sending a combination of keys, also involve the use of comman lines, or what is the same, the cmd window appearing above the screenshot, see pic above.
SO HOW YOU MANAGE TO GET IT WORKING?
i'm using 2 dll files, those files allow me work with command line from GG, via LUA script. And take the screenshot, for later use.
Those 2 dll files should sit on your
C:\Windows folder. See below why is better spot to store them.
Bassically I've modified a bit,
savegame and loadgame.lua files.
I HAS TO DO SOMETHING?
unfortunatelly YES. Till I got the way to hide/minimize cmd win, so does not distort the screenshot, yes, you has to. Below you'll know what.
There is only one way to get clear screenshot, being able to choose folder where you want store them, without using command line. I've think about store these shot into your "
C:\Users\yourProfile\Documents\Game Guru Files\My Games\YourGameName\Files\titlesbank\default" folder, so all is well sorted here.
SO, WHAT SOULD I DO
1- Press
printscreen key.
2- Press
ESC>Menu>Savegame>and choose free slot as usually.
at this point you'll see a bit moment, the cmd popups and dissapears when you move, and/or mouseclick.
AND WHAT IT DOES EXACTLY?
As you can see in the video below, it takes the screenshot and save it into a file, withing your
default folder.
Then once done, you can see these shots in LOADGAME menu, while scrolling thru the visited links, so you can have the idea where this save file is.
ABOUT THOSE 2 DLLS - nircmd
Quote: "This utility is a standalone executable, and it doesn't require any installation process or additional DLLs. just copy the executable to any folder you want, and run it with the desired command-line option, according to your needs.
It's recommended to copy the executable of NirCmd (nircmd.exe) to your windows directory, or to any other folder listed in your PATH environment variable, so you won't need to type the full path of nircmd in each time that you want to use it. "
License
Quote: "This dll is released as freeware. You are allowed to freely distribute this component via floppy disk, CD-ROM, Internet, or in any other way, as long as you don't charge anything for this."
I want to give all credits to the nircmd tool team, they make some great tool, thanks for share it.
Download link
It comes with 3 files: 2 dlls and 1 chm file as help file. I've copy these 2 dlls into my
C:\Windows directory.
I must prefer giving you the link so you can download them if you want to, instead of distribute them with my zip, to avoid issues and bad ideas.
WHAT ZIP FILE CONTAIN?
1- 2 scripts: savegame and loadgame.lua files
2- 1 pic named "
screenshot" - this is the sprite bachground (what you seen, when in free slot/back button). Keep their name, if you change it so you'll need to change in the script as well.
These 2 LUA files coming to replace the originals, in your default folder (standalone)
Place those 3 files into your "
C:\Users\yourProfile\Documents\Game Guru Files\My Games\YourGameName\Files\titlesbank\default" folder.
DON'T FORGET TO PRESS printscreen BEFORE DO NOTTHING!!!
I'll continue to working on get the way to avoid cmd win distorting the screenshot, so you'll just has to press ESC>Menu>Savegame as usually. Meantime please press
printscreen and follow the steps as pointed above, and as in the video.
hth
3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz
OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4