Fixious
Test Lead
Can't even remember if this was ever posted. Just know that it isn't part of the current build, though used to be a long time ago I think. This script allows you to take mega screenshots or save each frame as an image. Mega screenshots are a whopping 12,800 by 7,200 resolution, and are around 265MB in size. Pretty sure you can set it to whatever resolution you want but I haven't been able to figure it out yet. There's a normal screenshot function but I couldn't get it to work. Saving frames as a movie is a very laggy process; to stop it just enter stopMovie() into the console. There are variables for this function as well, but haven't figured it all out yet.
Copy this to Notepad, save it as "screenshot.cs", and place it in mods/autoexec. If the autoexec folder doesn't exist simply create one. This script is pretty cool as it allows you to take screenshots at a resolution higher than the one you play at, though it doesn't look like the HUD scales nicely. For example, I play on a laptop at 1366x768, though using the megaShot function I can take a huge screenshot then scale it down in Photoshop to 4000x2250. Examples:
http://www.fps-z.com/wp-content/uploads/2015/2.png
http://www.fps-z.com/wp-content/uploads/2015/02.png
http://www.fps-z.com/wp-content/uploads/2015/7.png
Code:
//---------------------------------------------------------------------------------------------
// Torque Game Builder
// Copyright (C) GarageGames.com, Inc.
//---------------------------------------------------------------------------------------------
GlobalActionMap.bind(keyboard, "ctrl p", doScreenShot);
GlobalActionMap.bindCmd(keyboard, "ctrl [", "", "doMegaShot();");
function doMegaShot()
{
$MegaShot::do = 1;
}
function setMegaShotSize(%val)
{
$Pref::MegaShot::numSamples = %val;
}
function setMegaShotLODBias(%val)
{
$Pref::MegaShot::lodBias = %val;
}
function setAntialiasLevel(%val)
{
%mode = $Pref::Video::Mode;
Canvas.setVideoMode(getWord(%mode, 0), getWord(%mode, 1), getWord(%mode, 2), getWord(%mode, 3), getWord(%mode, 4), %val);
}
//---------------------------------------------------------------------------------------------
// formatImageNumber
// Preceeds a number with zeros to make it 6 digits long.
//---------------------------------------------------------------------------------------------
function formatImageNumber(%number)
{
if(%number < 10)
%number = "0" @ %number;
if(%number < 100)
%number = "0" @ %number;
if(%number < 1000)
%number = "0" @ %number;
if(%number < 10000)
%number = "0" @ %number;
return %number;
}
//---------------------------------------------------------------------------------------------
// formatSessionNumber
// Preceeds a number with zeros to make it 4 digits long.
//---------------------------------------------------------------------------------------------
function formatSessionNumber(%number)
{
if(%number < 10)
%number = "0" @ %number;
if(%number < 100)
%number = "0" @ %number;
return %number;
}
//---------------------------------------------------------------------------------------------
// recordMovie
// Captures screenshots at a rate of %fps frames per second until stopMovie is called.
//---------------------------------------------------------------------------------------------
function recordMovie(%movieName, %fps)
{
$timeAdvance = 1000 / %fps;
$screenGrabThread = schedule($timeAdvance, 0, movieGrabScreen, %filename, 0);
}
function movieGrabScreen(%movieName, %frameNumber)
{
screenshot(%movieName @ formatImageNumber(%frameNumber) @ ".png", "PNG");
$screenGrabThread = schedule($timeAdvance, 0, movieGrabScreen, %movieName, %frameNumber + 1);
}
function stopMovie()
{
$timeAdvance = 0;
cancel($screenGrabThread);
}
//---------------------------------------------------------------------------------------------
// doScreenShot
// Capture a screenshot.
//---------------------------------------------------------------------------------------------
$screenshotNumber = 0;
function doScreenShot(%val)
{
// Because this can be bound to a hotkey, we make sure that %val is 1 or not specified. That
// way, the screenshot will be taken only on keydown, or when this function is called with
// no parameters.
if ((%val) || (%val $= ""))
{
if ($pref::Video::screenShotSession $= "")
$pref::Video::screenShotSession = 0;
if ($screenshotNumber == 0)
$pref::Video::screenShotSession++;
if ($pref::Video::screenShotSession > 999)
$pref::Video::screenShotSession = 1;
%name = expandFileName( "^game/data/screenshots/" @ formatSessionNumber($pref::Video::screenShotSession) @ "-" @
formatImageNumber($screenshotNumber) );
$screenshotNumber++;
if (($pref::Video::screenShotFormat $= "JPEG") ||
($pref::video::screenShotFormat $= "JPG"))
screenShot(%name @ ".jpg", "JPEG");
else if($pref::Video::screenShotFormat $= "PNG")
screenShot(%name @ ".png", "PNG");
else
screenShot(%name @ ".png", "PNG");
}
}
function toggleHud()
{
HudOverlay.visible = 1 - HudOverlay.visible;
}
Copy this to Notepad, save it as "screenshot.cs", and place it in mods/autoexec. If the autoexec folder doesn't exist simply create one. This script is pretty cool as it allows you to take screenshots at a resolution higher than the one you play at, though it doesn't look like the HUD scales nicely. For example, I play on a laptop at 1366x768, though using the megaShot function I can take a huge screenshot then scale it down in Photoshop to 4000x2250. Examples:
http://www.fps-z.com/wp-content/uploads/2015/2.png
http://www.fps-z.com/wp-content/uploads/2015/02.png
http://www.fps-z.com/wp-content/uploads/2015/7.png
Last edited: