Game Development Community

Torque 101: Intro to Torque

by Infinitum3D · in Torque Game Engine · 10/05/2006 (10:12 am) · 155 replies

I have just purchased and downloaded the TorqueGameEngineSDK_1.4

I will be documenting my experiences with it here. I am new to Torque and C++, so I hope others here will be able to learn from my mistakes.

UPDATE: Since I make several mistakes, you should always read through the entire thread of posts before trying anything. There are times that I ruin everything and have to start over entirely. Also, I have upgraded to Torque 1.5 since this post.

Thanks!


1. Download and run the TorqueGameEngineSDK-1-4.exe

This will install the Torque SDK on your computer. It will also place a link on the desktop called Torque Game Engine SDK.

This link is to twelve shortcuts;

FPS Starter Kit
Getting Started Tutorial
readMe.html
Racing Starter Kit
Torque Developer network (online)
Torque Game Engine Demo
Torque Game Engine Home Page
Tutorial Base
Torque Show Tool Pro
Torque Documentation (online)
Torque SDK forums (online)
Uninstall Torque Game Engine

I will read up on these and post more soon. I am starting with the ReadMe.html and the getting Started Tutorial.

UPDATE 10/07/06:
The ReadMe.html is just a one page note about where to find help. Look it over or skip straight to the Getting Starting .pdf tutorial.

2. The Getting Started tutorial is excellent. Follow it through, word by word, step by step, from start to finish, even if a section looks like common sense. !!!Be sure to place the TorqueScript in the EXACT location, exactly as the tutorial says!!! This was my first mistake.

All we have left to do is make sure that our 'clientGame.cs' file gets loaded. Open up GameOne/main.cs and find the 'Client scripts' section of the function called initClient. At the bottom of that list, add the following line, which will load our file:

I added the line at the bottom of the page, not at the bottom of the initClient function.


Update 10/11/06:

Next try to make some changes. For example: tdn.garagegames.com/wiki/Beginner
a. Make a new Torque Logo model that is blue instead of red.
b. Make it give 2 points instead of just 1.
c. Make a yellow one that gives 5 points.

Once I have done this, I'll explain how to do it.


Tony
Page«First 2 3 4 5 6 7 8 Next»
#141
11/05/2008 (9:19 am)
I said it a few years back, but once again: Great work with this thread Tony! =)

I mentioned you in my latest blog about documentation, as one of the MVP community members who help contribute. Keep up the good work!
#142
11/07/2008 (5:58 am)
Thanks Michael! Way to Guilt me into doing more :)

How about an easily readable default.bind. this is from a fresh install of TGE1.5.2

F1 contextHelp
F2 showPlayerList
F3 startRecordingDemo
F4 stopRecordingDemo
F5 toggleParticleEditor
F7 dropPlayerAtCamera
F8 dropCameraAtPlayer
F9 cycleDebugRenderMode

1 use Crossbow

a moveleft
d moveright
e toggleZoom
h use HealthKit
n toggleNetGraph
p resizeMessageHud
r setZoomFOV
s movebackward
u toggleMessageHud
w moveforward
//y teamMessageHud
z toggleFreeLook

pageUp pageMessageHudUp
pageDown pageMessageHudDown
tilde~ toggleConsole
escape escapeFromGame
spacebar jump
tab toggleFirstPerson

mouse, xaxis, yaw
mouse, yaxis, pitch
mouse, button0, mouseFire

"ctrl o" bringUpOptions
"ctrl k" suicide
"ctrl s" salute
"ctrl w" wave

"alt c" toggleCamera
"alt k" clearscreen
"alt enter" toggleFullScreen
#143
11/07/2008 (5:59 am)
Here's the original default.bind without the code

//-----------------------------------------------------------------------------
// Torque Game Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------

moveMap.bindCmd(keyboard, "escape", "", "escapeFromGame();");
moveMap.bind( keyboard, F2, showPlayerList );
moveMap.bind( keyboard, F6, toggleParticleEditor);
moveMap.bind( keyboard, a, moveleft );
moveMap.bind( keyboard, d, moveright );
moveMap.bind( keyboard, w, moveforward );
moveMap.bind( keyboard, s, movebackward );
moveMap.bind( keyboard, space, jump );
moveMap.bind( mouse, xaxis, yaw );
moveMap.bind( mouse, yaxis, pitch );

moveMap.bind( mouse, button0, mouseFire );

moveMap.bind(keyboard, r, setZoomFOV);
moveMap.bind(keyboard, e, toggleZoom);


moveMap.bind( keyboard, z, toggleFreeLook );
moveMap.bind(keyboard, tab, toggleFirstPerson );
moveMap.bind(keyboard, "alt c", toggleCamera);


moveMap.bindCmd(keyboard, "ctrl w", "commandToServer('playCel',\"wave\");", "");
moveMap.bindCmd(keyboard, "ctrl s", "commandToServer('playCel',\"salute\");", "");
moveMap.bindCmd(keyboard, "ctrl k", "commandToServer('suicide');", "");

moveMap.bindCmd(keyboard, "h", "commandToServer('use',\"HealthKit\");", "");
moveMap.bindCmd(keyboard, "1", "commandToServer('use',\"Crossbow\");", "");

moveMap.bind(keyboard, u, toggleMessageHud );
//moveMap.bind(keyboard, y, teamMessageHud );
moveMap.bind(keyboard, "pageUp", pageMessageHudUp );
moveMap.bind(keyboard, "pageDown", pageMessageHudDown );
moveMap.bind(keyboard, "p", resizeMessageHud );

moveMap.bind( keyboard, F3, startRecordingDemo );
moveMap.bind( keyboard, F4, stopRecordingDemo );


moveMap.bind(keyboard, "F8", dropCameraAtPlayer);
moveMap.bind(keyboard, "F7", dropPlayerAtCamera);

moveMap.bind(keyboard, "ctrl o", bringUpOptions);

GlobalActionMap.bind(keyboard, "F9", cycleDebugRenderMode);


GlobalActionMap.bind(keyboard, "tilde", toggleConsole);
GlobalActionMap.bindCmd(keyboard, "alt k", "cls();","");
GlobalActionMap.bindCmd(keyboard, "alt enter", "", "toggleFullScreen();");
GlobalActionMap.bindCmd(keyboard, "F1", "", "contextHelp();");
moveMap.bindCmd(keyboard, "n", "NetGraph::toggleNetGraph();", "");
#144
11/07/2008 (6:01 am)
And here's a slightly easier to read alphabetical version, again without the code

//--

GlobalActionMap.bindCmd(keyboard, "F1", "", "contextHelp();");
moveMap.bind( keyboard, F2, showPlayerList );
moveMap.bind( keyboard, F3, startRecordingDemo );
moveMap.bind( keyboard, F4, stopRecordingDemo );
moveMap.bind( keyboard, F5, toggleParticleEditor);
moveMap.bind(keyboard, "F7", dropPlayerAtCamera);
moveMap.bind(keyboard, "F8", dropCameraAtPlayer);
GlobalActionMap.bind(keyboard, "F9", cycleDebugRenderMode);

moveMap.bindCmd(keyboard, "1", "commandToServer('use',\"Crossbow\");", "");

moveMap.bind( keyboard, a, moveleft );
moveMap.bind( keyboard, d, moveright );
moveMap.bind(keyboard, e, toggleZoom);
moveMap.bindCmd(keyboard, "h", "commandToServer('use',\"HealthKit\");", "");
moveMap.bindCmd(keyboard, "n", "NetGraph::toggleNetGraph();", "");
moveMap.bind(keyboard, "p", resizeMessageHud );
moveMap.bind(keyboard, r, setZoomFOV);
moveMap.bind( keyboard, s, movebackward );
moveMap.bind(keyboard, u, toggleMessageHud );
moveMap.bind( keyboard, w, moveforward );
//moveMap.bind(keyboard, y, teamMessageHud );
moveMap.bind( keyboard, z, toggleFreeLook );

moveMap.bind(keyboard, "pageUp", pageMessageHudUp );
moveMap.bind(keyboard, "pageDown", pageMessageHudDown );
GlobalActionMap.bind(keyboard, "tilde", toggleConsole);
moveMap.bindCmd(keyboard, "escape", "", "escapeFromGame();");
moveMap.bind( keyboard, space, jump );
moveMap.bind(keyboard, tab, toggleFirstPerson );

moveMap.bind( mouse, xaxis, yaw );
moveMap.bind( mouse, yaxis, pitch );
moveMap.bind( mouse, button0, mouseFire );

moveMap.bind(keyboard, "ctrl o", bringUpOptions);
moveMap.bindCmd(keyboard, "ctrl k", "commandToServer('suicide');", "");
moveMap.bindCmd(keyboard, "ctrl s", "commandToServer('playCel',\"salute\");", "");
moveMap.bindCmd(keyboard, "ctrl w", "commandToServer('playCel',\"wave\");", "");

moveMap.bind(keyboard, "alt c", toggleCamera);
GlobalActionMap.bindCmd(keyboard, "alt k", "cls();","");
GlobalActionMap.bindCmd(keyboard, "alt enter", "", "toggleFullScreen();");
#145
01/30/2009 (6:00 pm)
Just a note as to where I've been, and why the thread hasn't been updated lately...

I'm currently working with the team at www.ZDayGame.com as a 3D modeller. I hope to eventually do more on my own project, but ZDAY is waaayyyy further along in development than I could ever be by myself, and they have a great team, so I have high hopes that the project could be released in just a couple years, whereas my own project would take... let's see, 25 years at the rate I was progressing.

I do plan to keep working on scripting, messing up the engine :) and causing general havok with my own project, but ZDay gets my full attention for now.

Thanks, to everyone who helped me, and to everyone who has followed this thread and been so encouraging to me. I hope you get something out of it.

I'll be back eventually.

Tony
#146
02/26/2009 (2:58 pm)
Doesn't Tribes 2 Hunters/Team Hunters have red flag that gives 1 point, blue that give 2 and yellow that gives 5?
#147
02/27/2009 (7:48 am)
Thomas, Thanks for writing. I don't know much about Tribes2, but I do know that giving different color flags different points is pretty easy. I scripted flags for my son for a racing game based on the starter.racing kit.

I'll try to dig it out and post it, but from what I can remember, its something to the effect of:

function redFlagItem::onCollision(%this,%obj,%col)
{
if(%col.getClassName() $="Player")
{
%client = %col.client;
%client.score == %client.score + 10;
commandToClient(%client, 'SetScoreCounter',%client.score);

Then for blueFlagItem use score + 20;
and for yellowFlagItem use score + 100;

You can also add the script to delete the flag, as they do in the gettingStarted.pdf for the TorqueLogoItem

Thanks again for posting,
Tony
#148
03/10/2009 (3:46 pm)
Some Particle Emitter scripts: Green Flames and Red Smoke emitters.

//-----------------------------------------------------------------------------
// Torque Game Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------
// ----------------------------------------
//--This creates lots of Red Smoke. Very Demonic, or Volcanic--//

datablock ParticleData(RedSmokeParticle)
{
textureName = "~/data/shapes/particles/smoke";
dragCoefficient = 0.0;
windCoefficient = 0.0;
gravityCoefficient = -0.05; // rises slowly
inheritedVelFactor = 0.00;
lifetimeMS = 5000;
lifetimeVarianceMS = 1000;
useInvAlpha = false;
spinRandomMin = -90.0;
spinRandomMax = 90.0;
spinSpeed = 1.0;

colors[0] = "0.6 0.2 0.0 0.2";
colors[1] = "0.8 0.2 0.0 0.2";
colors[2] = "0.2 0.0 0.0 0.1";
colors[3] = "0.2 0.04 0.0 0.3";

sizes[0] = 0.5;
sizes[1] = 1.0;
sizes[2] = 2.0;
sizes[3] = 3.0;

times[0] = 0.0;
times[1] = 0.1;
times[2] = 0.2;
times[3] = 0.3;
};

datablock ParticleEmitterData(RedSmokeEmitter)
{
ejectionPeriodMS = 50;
periodVarianceMS = 0;

ejectionVelocity = 0.55;
velocityVariance = 0.00;
ejectionOffset = 1.0;


thetaMin = 1.0;
thetaMax = 100.0;

particles = "RedSmokeParticle";
};

datablock ParticleEmitterNodeData(RedSmokeNode)
{
timeMultiple = 1;
};


// ----------------------------------------
//--Still trying for Green Flames--//
//--Color codes go "Red Green Blue Alpha";--//
//--0 = no color, 1 = full color--//
//--0 = invisible (no alpha), 1 = full opaque (all alpha)--//

//--This gives little green "spark puffs"--//
datablock ParticleData(GreenPuffsParticle)
{
textureName = "~/data/shapes/particles/flare1a";
dragCoefficient = 0.0;
windCoefficient = 0.0;
gravityCoefficient = -0.05; // rises slowly
inheritedVelFactor = 0.00;
lifetimeMS = 500;
lifetimeVarianceMS = 100;
useInvAlpha = false;
spinRandomMin = -90.0;
spinRandomMax = 90.0;
spinSpeed = 1.0;

colors[0] = "0.1 0.9 0.1 0.7";
colors[1] = "0.1 0.8 0.1 0.5";
colors[2] = "0.1 0.7 0.1 0.3";
colors[3] = "0.1 0.6 0.2 0.15";

sizes[0] = 0.5;
sizes[1] = 0.4;
sizes[2] = 0.3;
sizes[3] = 0.2;

times[0] = 0.0;
times[1] = 0.1;
times[2] = 0.2;
times[3] = 0.3;
};

datablock ParticleEmitterData(GreenPuffsEmitter)
{
ejectionPeriodMS = 40;
periodVarianceMS = 0;

ejectionVelocity = 0.35;
velocityVariance = 0.00;
ejectionOffset = 0.4;


thetaMin = 1.0;
thetaMax = 100.0;

particles = "GreenPuffsParticle";
};

datablock ParticleEmitterNodeData(GreenPuffsNode)
{
timeMultiple = 1;
};


// ----------------------------------------
//--Still trying for Green Flames--//
//--Color codes go "Red Green Blue Alpha";--//
//--0 = no color, 1 = full color--//
//--0 = invisible (no alpha), 1 = full opaque (all alpha)--//


datablock ParticleData(GreenFlamesParticle)
{
textureName = "~/data/shapes/particles/smoke";
dragCoefficient = 0.0;
windCoefficient = 0.0;
gravityCoefficient = -0.05; // rises slowly
inheritedVelFactor = 0.00;
lifetimeMS = 5000;
lifetimeVarianceMS = 1000;
useInvAlpha = false;
spinRandomMin = -90.0;
spinRandomMax = 90.0;
spinSpeed = 1.0;

colors[0] = "0.1 0.9 0.1 0.7";
colors[1] = "0.1 0.8 0.1 0.5";
colors[2] = "0.1 0.7 0.1 0.3";
colors[3] = "0.1 0.6 0.2 0.15";

sizes[0] = 0.2;
sizes[1] = 1.2;
sizes[2] = 2.2;
sizes[3] = 3.0;

times[0] = 0.0;
times[1] = 0.1;
times[2] = 0.2;
times[3] = 0.3;
};

datablock ParticleEmitterData(GreenFlamesEmitter)
{
ejectionPeriodMS = 50;
periodVarianceMS = 0;

ejectionVelocity = 0.55;
velocityVariance = 0.00;
ejectionOffset = 1.0;


thetaMin = 1.0;
thetaMax = 100.0;

particles = "GreenFlamesParticle";
};

datablock ParticleEmitterNodeData(GreenFlamesNode)
{
timeMultiple = 1;
};
#149
03/18/2009 (7:04 pm)
Whops, curse unto firefox tabs, I wrote in the wrong one.

Anyway, I've been reading a lot of your things and you've been making a lot of people happy with this series =)
#150
04/11/2009 (10:16 pm)
so does everyone use the sdk if not how do i get rid of it
#151
04/12/2009 (2:42 am)
What do you mean?

You need the SDK if you want to modify the engine, which you're more then likely to have to / want to if you plan to make a real game-release.

If you just want to script things that's all up to you though and then you're fine just using the /example folder.
#152
04/12/2009 (12:42 pm)
@Marcus - Thanks!

The SDK is the Software Developer Kit, which is basically everything.

Which part do you want to get rid of and why? There are parts that can be removed, like the Starter Kits.

@Chris - I think you may be confusing the tutorial.base with the SDK.

If you want Kork, you have to go into example/main.cs

look for $defaultGame = "tutorial.base";

Change it from "tutorial.base" to "starter.fps"

The SDK is the entire package, the "Software Development Kit". The SDK has three folders, known as Starter Kits. There is Starter.FPS, Starter.Racing, and Tutorial.Base

Tutorial.Base is needed for the gettingStarted.PDF tutorial.
Starter.FPS is the basic first person shooter demo.
Starter.Racing is the basic racing game demo.

These are very limited and basic setups that allow you to modify them to actually make a game. You do not need to use them, but they make learning alot easier, as many of the tutorials reference the Stronghold mission in Starter.FPS.


If you need more help, post again. We'll help all we can.

Tony


Tony
#153
06/04/2009 (4:56 am)
Just a quick update. My laptop power supply died, so I haven't been doing any torque'ing for a few weeks. The replacement ps I ordered had the wrong size adaptor tip, (3mm instead of 2.5mm), so I tried to cut/splice the old tip onto the new adaptor, but it still doesn't power my laptop, so that was a waste of 30 bucks. Ordered a new ps from a different company (60 bucks this time), and still waiting to get it.

I do plan on continuing this thread, once I get the computer running again. I'll be moving across the country in about a month, so I should be settled and back to Torque by August 1st.

Wish me luck :)

Tony
#154
06/12/2009 (10:15 am)
Someone was asking for links to Realm Wars. I found a few on Google:

Try a google search for RW_WWDCpc or GRWCII (German Version, coded/scripted in mostly english).


translate.google.com/translate?hl=en&sl=de&u=http://www.teutonic-barons....

home.arcor.de/tbclan/RW_WWDCpc.zip

There is no source code in these, just mods/scripts.

Tony
#155
08/25/2013 (9:21 pm)
I want the GRWCII.zip, does it include their GRWCII mods .cs files?
All those sites have dead links to the mod...
Page«First 2 3 4 5 6 7 8 Next»