Game Development Community

Torque for Teens Confusion

by Charles Bissey · in Torque Game Engine · 05/04/2008 (2:31 pm) · 11 replies

So, i was reading the book and got to chapter four were u finally start making stuff, and i couldnt find the Torque Game Engine SDK Ver. 1.5. I got the interactive demo, but that didn't help much. Please help, i have windows.

About the author

Recent Threads

  • 3D Stick Arena

  • #1
    05/04/2008 (2:40 pm)
    To get the full SDK, you'd have to purchase a license. However, you can probably follow the book using just the demo available from GG. While it's called "demo", it's the full engine with all the editors and scripting capability in it. The only difference is source code availability and, of course, licensing.
    #2
    05/04/2008 (2:54 pm)
    Well i understand that, but what i'm saying is i literally get nothing. I downloaded the trial game engine that was on the CD it took me to something different than wat was supposed to be. So if what your saying is true, i should be able to find a way to make games. It's also saying that i should have FPS and Racing Starter kit from start up, but i dont. I can't find anything that says demo, and the only thing that i can has the interactive demo, and that didnt show me how to make anything.
    #3
    05/04/2008 (2:54 pm)
    Apparently the correct Torque Demo wasn't included with the Torque for Teens CD-ROM. You can download the proper demo from the following link:

    Torque for Teens
    #4
    05/04/2008 (2:59 pm)
    Ok, i feel like a complete idoit. I downloaded the file through the link that you gave me, but im still confused. It said that it should open up to FPS Starter Kit, Racing Starter Kit, Torque Game Engine Demo, Getting Started Tutorial, and the Tutorial Base. But it opens me up with the Tutorial Base. Did i do something wrong?
    #5
    05/04/2008 (3:47 pm)
    It could have been made a bit more obvious for beginners. Instead of using the default Torque for Teens Demo desktop shortcut just use Windows Explorer to open the Demo's example directory. On my computer it is "C:\Torque\TorqueForTeens_1.5.2_Demo\example". There you will find batch files to open Starter.FPS, Starter.FPS Dedicated, Starter.Racing, Tutorial.Base, Demo, etc.
    #6
    05/04/2008 (4:15 pm)
    Well thx, and again if i have any more questions ill be sure to post them
    #7
    05/04/2008 (4:17 pm)
    If you cannot find your install, just start the uninstall process using the link in your start menu to find it.
    Mine is in: C:\TorqueTmep\SDK\example\
    If you look in that example folder, find a file called "main.cs" and open it in a text editor.
    At the very top of that file is the following:
    //-----------------------------------------------------------------------------
    // Torque Game Engine 
    // Copyright (C) GarageGames.com, Inc.
    //-----------------------------------------------------------------------------
    
    $defaultGame = "tutorial.base";
    $displayHelp = false;
    
    
    //-----------------------------------------------------------------------------
    // Support functions used to manage the mod string

    Change $defaultGame ="tutorial.base"; to read $defaultGame = "starter.fps"; then save.
    Now when you click on your shortcut, it will open the starter.fps game.
    #8
    05/04/2008 (4:51 pm)
    This is what it opened up to,
    //-----------------------------------------------------------------------------
    // Torque Game Engine 
    // Copyright (C) GarageGames.com, Inc.
    //-----------------------------------------------------------------------------
    
    // Load up common script base
    loadDir("common");
    
    //-----------------------------------------------------------------------------
    // Load up defaults console values.
    
    // Defaults console values
    exec("./client/defaults.cs");
    exec("./server/defaults.cs");
    
    // Preferences (overide defaults)
    exec("./client/prefs.cs");
    exec("./server/prefs.cs");
    
    
    //-----------------------------------------------------------------------------
    // Package overrides to initialize the mod.
    package demo {
    
    function displayHelp() {
       Parent::displayHelp();
       error(
          "Demo options:\n"@
          "  -dedicated             Start as dedicated server\n"@
          "  -connect <address>     For non-dedicated: Connect to a game at <address>\n" @
          "  -mission <filename>    For dedicated: Load the mission\n"
       );
    }
    
    function parseArgs()
    {
       Parent::parseArgs();
    
       // Arguments, which override everything else.
       for (%i = 1; %i < $Game::argc ; %i++)
       {
          %arg = $Game::argv[%i];
          %nextArg = $Game::argv[%i+1];
          %hasNextArg = $Game::argc - %i > 1;
       
          switch$ (%arg)
          {
             //--------------------
             case "-dedicated":
                $Server::Dedicated = true;
                enableWinConsole(true);
                $argUsed[%i]++;
    
             //--------------------
             case "-mission":
                $argUsed[%i]++;
                if (%hasNextArg) {
                   $missionArg = %nextArg;
                   $argUsed[%i+1]++;
                   %i++;
                }
                else
                   error("Error: Missing Command Line argument. Usage: -mission <filename>");
    
             //--------------------
             case "-connect":
                $argUsed[%i]++;
                if (%hasNextArg) {
                   $JoinGameAddress = %nextArg;
                   $argUsed[%i+1]++;
                   %i++;
                }
                else
                   error("Error: Missing Command Line argument. Usage: -connect <ip_address>");
          }
       }
    }
    
    function onStart()
    {
       Parent::onStart();
       echo("\n--------- Initializing MOD: Torque Demo ---------");
    
       // Load the scripts that start it all...
       exec("./client/init.cs");
       exec("./server/init.cs");
       exec("./data/init.cs");
    
       // Server gets loaded for all sessions, since clients
       // can host in-game servers.
       initServer();
    
       // Start up in either client, or dedicated server mode
       if ($Server::Dedicated)
          initDedicated();
       else
          initClient();
    }
    
    function onExit()
    {
       echo("Exporting client prefs");
       export("$pref::*", "./client/prefs.cs", False);
    
       echo("Exporting client config");
       if (isObject(moveMap))
          moveMap.save("./client/config.cs", false);
    
       echo("Exporting server prefs");
       export("$Pref::Server::*", "./server/prefs.cs", False);
       BanList::Export("./server/banlist.cs");
    
       Parent::onExit();
    }
    
    }; // Client package
    activatePackage(demo);
    
    $testscript::log = "";
    $testscript::scenecount = 0;
    $testscript::grabcount = 0;
    $testscript::grabcounttotal = 0;
    $testscript::fpsavg = 0;
    $testscript::scenefps = 0;
    $testscript::numscenes = 22;
    $testscript::numgrabs = 50;
    
    function testScript(%note) {
    	$testscript::log = new FileObject();
    	$testscript::log.openForAppend("demo/framecount.txt");
    	$testscript::log.writeLine("=== " @ %note @ " ===");
    
    	loadFeatureMission();
    	schedule(10000,0,testThread);
    }
    
    function testThread() {
    	// grab & average.
    	%fps = $fps::real;
    	%fps = (( $testscript::fpsavg * $testscript::grabcounttotal) + %fps ) / ( $testscript::grabcounttotal + 1);
    	$testscript::fpsavg = %fps;
       
       %sceneFps = $fps::real;
       %sceneFps = (( $testscript::scenefps * $testscript::grabcount) + %sceneFps ) / ( $testscript::grabcount + 1);
       $testscript::scenefps = %sceneFps;
       
    	$testscript::grabcounttotal++;
    	$testscript::grabcount++;
    	// if grabcount > numgrabs, next scene & reset
    	if( $testscript::grabcount >= $testscript::numgrabs ) {
          $testscript::log.writeLine(" " @ SceneGui.getSceneName() @ " : " @ $testscript::sceneFps @ " fps");
    		SceneGui.nextScene();
    		$testscript::grabcount = 0;
          $testscript::sceneFps  = 0;
    		$testscript::scenecount++;
    	}
    	// inc scenecount, if over numscenes, write file, close file, quit
    	if( $testscript::scenecount > $testscript::numscenes ) {
    		$testscript::log.writeLine(" avg fps:" SPC $testscript::fpsavg );
    		$testscript::log.writeLine(" samples:" SPC $testscript::grabcounttotal );
    		$testscript::log.close();
    		quit();
    	}
    	// schedule self.
    	schedule(500,0,testThread);
    }

    Sorry couldnt figure out how to make it small. BTW, there was no "example" folder, just common, creator, demo, show, starte.fps, starte.racing, and tutorial.base, i assumed they were all supposed to be in the examples folder but they werent. I right-clicked the shortcut and clicked on Open File Location, should i not of done that?
    #9
    05/04/2008 (7:06 pm)
    That's odd. When I right-click the shortcut I have an Open but no Open File selection. Open File is just confusing us at the moment. :p

    Right-click the shortcut and select Properties. Go to the Shortcut tab and look for the Target entry. It should look something like "C:\Torque\TorqueForTeens_1.5.2_Demo\example\demo.exe". Delete "\demo.exe" from the end of the Target entry and click on Apply at the bottom of the Properties page. Click on OK to exit the Properties page.

    Now when you click on the Torque for Teens Demo shortcut it should open the correct folder directly without needing to use Windows Explorer.
    #10
    05/04/2008 (7:43 pm)
    That's the wrong main.cs file. You need the one in the same folder as the exe. Not inside the game folder.
    There are main.cs files in several folders. The one with the exe is the one you are looking for.
    #11
    05/09/2009 (10:36 pm)
    The link in #3 id inactive?