[T1 Request] A Unique film.cs

Hilikus
03-15-2003, 12:31 AM
Could someone make a film.cs that outputs eat ss recording session to a new folder similar to jsut's Tribes 2 script? i.e., you record a leet mortar ma, and it goes to a folder the script calls, "shot0001". All your ss's go here, and each time you do a recording, it makes a new folder.

Hilikus
03-16-2003, 09:36 AM
bump

g0ds gReeN
03-16-2003, 11:08 AM
:ftard:

-kllr2001-
03-16-2003, 02:14 PM
this is a pretty good idea :)

SarcaStick
03-16-2003, 02:48 PM
It's a good idea. Maybe linking the name of the folder based on the name of the .rec file would be a good idea to. If it exists, just make it increment.

Brain^Virus
03-16-2003, 06:13 PM
screenShot(MainWindow, "filename.bmp"); where "filename.bmp" is is a path relative to the main Tribes directory, ie: "temp\\ownage.bmp".

Aquiring the recording name would require a change to a specific function in GUI.cs(RecordingsGui::Pla yDemo()). It would also require two versions: one for NewInterface and one for everyone else.

With that knowledge at hand, anyone who wants to do it is fully free to use my film2.cs as a basis for expansion.

lumoon
03-17-2003, 10:11 AM
...so let the scripting commence.


Anyone?

Hilikus
03-18-2003, 04:25 PM
bump

Brain^Virus
03-19-2003, 12:00 AM
You people make me depressed.

Save as cfilm.cs:

// Canonical Film Script
// screenshot dumping script
// produced by Eric Paulson, sometimes known as Brain^Virus

include("writer\\version.cs");
version("cfilm.cs", "1.0", "Brain^Virus", "March 18, 2003");


if(!$pref::CFilmPrefsLoad ed){
$pref::CFilm::FPS = 24; // desired frames per second of the captured 'video'
// these two would probably make more sense as a single variable, but hey, I'm a freak. I'll do it however my multiple personalities want to!
$pref::CFilm::scapTime = 1.0; // time it takes your Tribes to capture a screenshot, in seconds... on high-end systems, this should be lowered
$pref::CFilm::waitTime = 0.1; // time in seconds between taking screenshots. this is a safegaurd of sorts so that the end result isn't choppy
EditActionMap("playMap.sae");
bindcommand(keyboard0, make, "f9", TO, "CFilm::rolltape();"); // the on/off toggle
}
$pref::CFilmPrefsLoaded = true;

//---------------------------------- BORING NERD STUFF BELOW THIS LINE! ----------------------------------
$CFilm::DemoName = "";
$CFilm::filming = false;
$CFilm::waitTime = $pref::CFilm::waitTime;
$CFilm::scapTime = $pref::CFilm::scapTime;

function CFilm::rolltape(){
CFilm::init();
CFilm::makeVideo();
}
function CFilm::makeVideo(){
if($CFilm::filming && $playingDemo){
$CFilm::SPF = 1.0/$pref::CFilm::FPS; // seconds/frame. this is only here so i don't have to calculate it for each frame
$CFilm::filmTimeScale = 1.0/($pref::CFilm::FPS * ($CFilm::waitTime + $CFilm::scapTime));
$CFilm::lastSSTime = getSimTime();
$SimGame::TimeScale = $CFilm::filmTimeScale;
function Game::EndFrame(){
%time = getSimTime();
if((%time - $CFilm::lastSSTime) >= $CFilm::SPF){
$CFilm::lastSSTime = %time;
CFilm::screenShot();
}
}
}
else{
function Game::EndFrame(){}
$SimGame::TimeScale = 1.0;
}
}

function CFilm::init(){
$CFilm::filming = !$CFilm::filming;
$CFilm::scenenumber = 0;
$CFilm::shotnumber = 0;
while(isFile("temp\\" @ $CFilm::DemoName @ "-"@ $CFilm::scenenumber @ "-" @ $CFilm::shotnumber @ ".bmp")){
$CFilm::scenenumber = $CFilm::scenenumber + 1;
}
$CFilm::filenamebase = "temp\\" @ $CFilm::DemoName @ "-"@ $CFilm::scenenumber @ "-";
}

function CFilm::screenShot(){
screenShot(MainWindow, $CFilm::filenamebase @ $CFilm::shotnumber @ ".bmp");
$CFilm::shotnumber = $CFilm::shotnumber + 1;
}

if($NewInterface::install ed){
function RecordingsGui::PlayDemo() {
%fileName = "recordings\\" @ $LastRecRoot @ Control::getValue(Recordi ngsTextList);
%recname = Control::getValue(Recordi ngsTextList);
$CFilm::DemoName = String::getSubStr(%recnam e,0, String::len(%recname) - 4);
if (isFile(%fileName)){
$PlayingDemo = TRUE;

if ($timeDemo == true)
timeDemo(%fileName);
else
playDemo(%fileName);

cursorOn(MainWindow);
GuiLoadContentCtrl(MainWi ndow, "gui\\Loading.gui");
renderCanvas(MainWindow);
}
else{
RecordingsGui::onOpen();
}
}
}
else{
function RecordingsGui::PlayDemo() {
%fileName = "recordings\\" @ Control::getValue(Recordi ngsTextList) @ ".rec";
$CFilm::DemoName = Control::getValue(Recordi ngsTextList);
if (isFile(%fileName)){
$PlayingDemo = TRUE;
if ($timeDemo == true) {
timeDemo("recordings\\" @ Control::getValue(Recordi ngsTextList) @ ".rec");
}
else {
playDemo("recordings\\" @ Control::getValue(Recordi ngsTextList) @ ".rec");
}
cursorOn(MainWindow);
GuiLoadContentCtrl(MainWi ndow, "gui\\Loading.gui");
renderCanvas(MainWindow);
}
else{
RecordingsGui::onOpen();
}
}
}

lumoon
03-19-2003, 12:09 PM
*Stadium cheer*

Thank you.

Wufei
03-19-2003, 01:17 PM
Good work Brain Virus :)