Hey everyone,
My attempts to get cube2 to spit out a text file to record player stats hasn't been going as planned, though I thought of a potential workaround. Does anyone know of a script that could make a screenshot with a timestamp under certain conditions? Basically, when a player dies or completes a level could Cube make a new screenshot that doesn't overwrite an old one, in some sort of a series (like screenshot1, 2, 3, etc.). Or maybe place these screenshots in a folder with the players name? Any help is appreciated.
-B
Hi! Welcome to the forum for Platinum Arts Sandbox Free 3D Game Maker. I currently have the forums locked as I am attempting to properly update them.
In the meantime please join the new Discord Server!
If you have any questions please e-mail me through the Platinum Arts website.
In the meantime please join the new Discord Server!
If you have any questions please e-mail me through the Platinum Arts website.
Forced Screenshots?
Re: Forced Screenshots?
you could take one every few seconds or so; but this is far from optimal really
do to the setup you described, you'd have to create scripts to save screenshots in the appropriate places with the appropriate names; by default the name is totalmillis.png, totalmillis being the amount of milliseconds the program has been running (which is usually changes fast enough to avoid problems)
do to the setup you described, you'd have to create scripts to save screenshots in the appropriate places with the appropriate names; by default the name is totalmillis.png, totalmillis being the amount of milliseconds the program has been running (which is usually changes fast enough to avoid problems)
This is not a url, clicking it is pointless
Re: Forced Screenshots?
I don't know how you'd make it not overwrite a new screenshot, I've seen it done in various image capturing programs, maybe you could find some inspiration from an open source image capture program.
For taking a screenshot at the end of the game I think you'd be able to do something like this - trigger end of the game, (endsp), sleep, screenshot sleep mapchange whatever the new map is. I'm not sure on the exact syntax of what that code would be checking out my mapchange.cfg and map in packages/base would be a good start. Just screenshot in there actually might even work. Take care!
-mike
For taking a screenshot at the end of the game I think you'd be able to do something like this - trigger end of the game, (endsp), sleep, screenshot sleep mapchange whatever the new map is. I'm not sure on the exact syntax of what that code would be checking out my mapchange.cfg and map in packages/base would be a good start. Just screenshot in there actually might even work. Take care!
-mike
Sign up for our Newsletter to keep up to date with the Sandbox news!
We also have a facebook page, facebook group, myspace page and a twitter page[/b][/color]!
We also have a facebook page, facebook group, myspace page and a twitter page[/b][/color]!
Re: Forced Screenshots?
Making it not overwrite a previous screenshot would make me think that the best way to write it is to choose a unique name. Now, you can do it based off of the current UNIX timestamp, or you could use something like a hash for the contents of the image itself (md5, sha1, and so on). I would think having it UNIX timestamp based though would be much more efficient, as I know from experience how long it can take to get an md5 checksum of a large file.
うるさいうるさいうるさい!
github: https://github.com/damianb/
github: https://github.com/damianb/
Re: Forced Screenshots?
Right I never even thought about how each map would have a different map.cfg so you could just make the screenshot a different name in each one. I would imagine that /screenshot nameofscreen would produce a unique name though I haven't tested it. Here is some interesting code thanks for the Cube 2 documents:
You probably don't need the hudgun stuff
So it looks like in general that the screenshots will be different each time though it will have a number depending on how long you were in game. I don't think they'd overwrite themselves in general. In any case here is some neat stuff to think about. I think for your purposes just having "screenshot" in there would be fine. You could also search the source code and customize the output of the screenshot command as well. Take care!
-mike
Code: Select all
screenshot
Writes out "screenshotN.bmp", where N is the number of milliseconds since cube was launched (default key = F12).
A little modified example :
// do a pretty screenshot (hiding HUD and all)
MPscreenshot = [
phh = $hidehud
phs = $hidestats
phg = $hudgun
hudgun 0
hidestats 1
hidehud 1
sleep 2 screenshot
sleep 3 [hudgun $phg; hidestats $phs; hidehud $phh;echo SCREENSHOT made]
]

-mike
Sign up for our Newsletter to keep up to date with the Sandbox news!
We also have a facebook page, facebook group, myspace page and a twitter page[/b][/color]!
We also have a facebook page, facebook group, myspace page and a twitter page[/b][/color]!
Re: Forced Screenshots?
Wow guys, thanks for all the help on this. It seems like this could be useful for a lot of things.