GPGT Chapters 1 & 2 - Issues and Questions
by Edward F. Maurina III · in Torque Game Engine · 05/16/2006 (10:41 pm) · 12 replies
Hello All. This thread is dedicated to any questions or issues that you may find in this chapter.
If you have issues and questions for other chapters, please post them in the appropriate thread:
Chapters 1 & 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Chapter 9
Chapter 10
Chapter 11
Chapter 12
Chapter 13
Chapter 14
GPGT Support Page
Appendix E. Maze Runner Lessons (Steps Only) - Covers Mac and Windows
OSX Executable - Use for GPGT Lesson Kit and MazeRunner
If you have issues and questions for other chapters, please post them in the appropriate thread:
Chapters 1 & 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Chapter 9
Chapter 10
Chapter 11
Chapter 12
Chapter 13
Chapter 14
GPGT Support Page
Appendix E. Maze Runner Lessons (Steps Only) - Covers Mac and Windows
OSX Executable - Use for GPGT Lesson Kit and MazeRunner
About the author
Recent Threads
#2
I'm referring to the TGE 1.4 Demo (which comes on the disk). We use this as a base for the demo game we make as you progress through the book.
I hope this clarifies
Hall Of Worlds - For Gamers
EdM|GPGT
06/08/2006 (8:17 am)
Merrie,I'm referring to the TGE 1.4 Demo (which comes on the disk). We use this as a base for the demo game we make as you progress through the book.
I hope this clarifies
Hall Of Worlds - For GamersEdM|GPGT
#3
Thanks for helping,
Ben
06/24/2006 (4:16 pm)
In 2.2.2 you say "Please refer to the "Lesson Kit Assets" electronic appendix for a complete listing"... I've been looking and haven't found this appendix anywhere, where is it? Does it exist?Thanks for helping,
Ben
#4
Hi. I didn't end up providing the kind of list that I wanted to when writing that section. The only list I did provide is the ReadMe.pdf which should be in the root directory of the CD.
I did, however, separate content out into its own directory so you can use it for your projects and pick and choose among the parts. Take a look in the "\Base" directory and you'll find art assets as well as script assets.
I hope this helps.
Hall Of Worlds - For Gamers
EdM|GPGT
06/25/2006 (11:39 am)
Ben,Hi. I didn't end up providing the kind of list that I wanted to when writing that section. The only list I did provide is the ReadMe.pdf which should be in the root directory of the CD.
I did, however, separate content out into its own directory so you can use it for your projects and pick and choose among the parts. Take a look in the "\Base" directory and you'll find art assets as well as script assets.
I hope this helps.
Hall Of Worlds - For GamersEdM|GPGT
#5
echo("Torque Script");
echo( 1 + 1 );
THen its says I can input bt99(); to desplay the text in the console screen. I can not see the bottom of the console screen where I am suppose to enter text in. What do I do to correct this cituation? Great Book by the way Edward!!! I am loving it so far!
08/21/2006 (11:48 pm)
Page 100 to 101 it says you can input this script:echo("Torque Script");
echo( 1 + 1 );
THen its says I can input bt99(); to desplay the text in the console screen. I can not see the bottom of the console screen where I am suppose to enter text in. What do I do to correct this cituation? Great Book by the way Edward!!! I am loving it so far!
#6
1. Regarding the 'large' console - When you first use the 'GPGT Lesson Kit' App, and when you open the console it may take up the whole screen. To fix this:
a. Run the 'GPGT Lesson Kit' application
b. Open the console (~)
c. Move your mouse to the lower right corner and grab the corner of the console window.
d. Drag/re-size the console window till it is smaller.
e. Close the console (~)
f. Exit the kit.
Now, when you restart the kit later, the console should be at the size you left it.
2. Regarding lessons part 1. - All of the bt**() and ts**() lessons require that you run the '3D Lessons' mission. This is because some of the lessons use 'datablocks' and other features that require the networking side of Torque to be operational. So, to run these samples, do the following:
a. Run the 'GPGT Lesson Kit' application
b. Click 'Start Mission...'
c. Select '3D Lessons' mission (selected by default)
d. Click 'Launch Mission!' button
e. When the mission is done loading, open the console (~)
f. Clear the console by typing: cls();
Now, you are ready to rock. Run the sample you're on by typing (for example) bt99();
3. Regarding the lessons part 2 - All of the lessons/samples show scripts that you can 'type' in. What this really means is that, if you were editing a .cs file, you would type these values. Now, some of these can in fact be typed into the console, line-by-line. However, I have provided all of these samples in an encapsulated form. That is, I have written functions bt01(), bt02(), etc. which contain the sample code. This way, you can just look at the code in the book and then run it directly by typing the function name that goes with it (bt99(); for example.)
You can find all of the pre-written sample scripts here: ~/GPGT LessonKit/gpgt/SampleScripts/*.cs.
I hope this clarifies things. Please feel free to post again if you have more questions.
Hall Of Worlds - For Gamers
EdM|GPGT
08/24/2006 (11:18 am)
@Dwayne - Hi. This is a multi-part answer:1. Regarding the 'large' console - When you first use the 'GPGT Lesson Kit' App, and when you open the console it may take up the whole screen. To fix this:
a. Run the 'GPGT Lesson Kit' application
b. Open the console (~)
c. Move your mouse to the lower right corner and grab the corner of the console window.
d. Drag/re-size the console window till it is smaller.
e. Close the console (~)
f. Exit the kit.
Now, when you restart the kit later, the console should be at the size you left it.
2. Regarding lessons part 1. - All of the bt**() and ts**() lessons require that you run the '3D Lessons' mission. This is because some of the lessons use 'datablocks' and other features that require the networking side of Torque to be operational. So, to run these samples, do the following:
a. Run the 'GPGT Lesson Kit' application
b. Click 'Start Mission...'
c. Select '3D Lessons' mission (selected by default)
d. Click 'Launch Mission!' button
e. When the mission is done loading, open the console (~)
f. Clear the console by typing: cls();
Now, you are ready to rock. Run the sample you're on by typing (for example) bt99();
3. Regarding the lessons part 2 - All of the lessons/samples show scripts that you can 'type' in. What this really means is that, if you were editing a .cs file, you would type these values. Now, some of these can in fact be typed into the console, line-by-line. However, I have provided all of these samples in an encapsulated form. That is, I have written functions bt01(), bt02(), etc. which contain the sample code. This way, you can just look at the code in the book and then run it directly by typing the function name that goes with it (bt99(); for example.)
You can find all of the pre-written sample scripts here: ~/GPGT LessonKit/gpgt/SampleScripts/*.cs.
I hope this clarifies things. Please feel free to post again if you have more questions.
Hall Of Worlds - For GamersEdM|GPGT
#7
The only one that can can resize is the Sample Script Console window. The (~) console window I am unable to manipulate.
08/24/2006 (3:42 pm)
Okay I tried for the last hour to get it to resize but the window will not with in the console. What am I doing wrong? I went to the bottom right hand corner, the side, and all over with no result. Is there another way to resize or is there something wrong with my copy?The only one that can can resize is the Sample Script Console window. The (~) console window I am unable to manipulate.
#8
Hi. Since that didn't work, you can manually change the console extent as follows:
1. Be sure that you are not running the 'GPGT Lesson Kit' App.
2. Open the file: GPGT LessonKit\gpgt\client\prefs.cs
3. Find the line with this global variable: $pref::Console::extent
4. Making something small like this: $pref::Console::extent = "300 300";
5. Save prefs.cs
6. Restart your 'GPGT Lesson Kit' and open the console.
Now, you should be able to grab the lower right corner of the console and re-size it to your heart's content.
Sorry for the frustration.
Hall Of Worlds - For Gamers
EdM|GPGT
08/25/2006 (7:17 pm)
@Dwayne,Hi. Since that didn't work, you can manually change the console extent as follows:
1. Be sure that you are not running the 'GPGT Lesson Kit' App.
2. Open the file: GPGT LessonKit\gpgt\client\prefs.cs
3. Find the line with this global variable: $pref::Console::extent
4. Making something small like this: $pref::Console::extent = "300 300";
5. Save prefs.cs
6. Restart your 'GPGT Lesson Kit' and open the console.
Now, you should be able to grab the lower right corner of the console and re-size it to your heart's content.
Sorry for the frustration.
Hall Of Worlds - For GamersEdM|GPGT
#9
08/25/2006 (8:35 pm)
Yes that worked!!!
#10
My problem was that the default 1024x768 was too big for my laptop to handle efficiently. A windowed size of 640x480 was much more efficient for my measly computer.
-ner
08/28/2006 (8:57 am)
I had a similar problem with resizing the console on my laptop. I resized my taskbar so it was just a line (though moving it to another side would have worked as well. To resize, you must go to the bottom right corner below the textbox (the resize handles are drawn above the textbox which is NOT where you need to grab to resize).My problem was that the default 1024x768 was too big for my laptop to handle efficiently. A windowed size of 640x480 was much more efficient for my measly computer.
-ner
#11
In both books its the same definition that's on TDN and the Public Doc's.
Not really helpful if you didn't understand it the first time lol. Exampiles would be the best thing.
10/10/2006 (10:02 am)
Yeah, can you expand more on Arrays, and Multi-dimensional arrays....In both books its the same definition that's on TDN and the Public Doc's.
Not really helpful if you didn't understand it the first time lol. Exampiles would be the best thing.
#12
- Thanks
@Allyn - The primary thing to remember about arrays in Torque is that you always use a single set of brackets. Multi-dimensional arrrays use commas to separate the dimensions.
Using and declaring a single-dimensional array in C/C++
Using a single-dimensional array in TorqueScript
Note: You don't need to declare variables in TorqueScript.
Using and declaring a multi-dimensional array in C/C++
Using a multi-dimensional array in TorqueScript
Key Learnings
1. You don't need to declare TorqueScript variables (including arrays).
2. Multi-dimensional arrays seperate dimension indicies using a comma.
%fourDimensions[10,5,16,32] = "One big array";
3. You can exclude the brackets in single-dimension arrays and just use the index after the variable name.
// %simpleArray[5] == %simpleArray5
4. You can also exclude the brackets in multi-dimensional arrays and you can replace the commas with underbars '_'.
// %biggerArray[1,2,3] == %biggerArray1_2_3
Given this information you should be able to experiment in TorqueScript and fully Grok multi-dimensional arrays.
Hall Of Worlds - For Gamers
EdM|GPGT
10/27/2006 (11:05 am)
@All - I'm starting to answer ALL of my oustanding GPGT questions. It will take me a few days, so please bear with me over the weekend.- Thanks
@Allyn - The primary thing to remember about arrays in Torque is that you always use a single set of brackets. Multi-dimensional arrrays use commas to separate the dimensions.
Using and declaring a single-dimensional array in C/C++
//Declaring int smallBucks[10]; // 10 entries //Using smallBucks[5] = 100;
Using a single-dimensional array in TorqueScript
Note: You don't need to declare variables in TorqueScript.
//Using single-dim array %smallBucks[5] = 100; //Alternate method of using single-dim array %smallBucks5 = 100;
Using and declaring a multi-dimensional array in C/C++
//Declaring int bigBucks[10][10]; // 10x10 entries == 100 entries //Using bigBucks[5][2] = 100000;
Using a multi-dimensional array in TorqueScript
//Using multi-dim array %bigBucks[5,2] = 100000; //Alternate method of using multi-dim array %bigBucks5_2 = 100000;
Key Learnings
1. You don't need to declare TorqueScript variables (including arrays).
2. Multi-dimensional arrays seperate dimension indicies using a comma.
%fourDimensions[10,5,16,32] = "One big array";
3. You can exclude the brackets in single-dimension arrays and just use the index after the variable name.
// %simpleArray[5] == %simpleArray5
4. You can also exclude the brackets in multi-dimensional arrays and you can replace the commas with underbars '_'.
// %biggerArray[1,2,3] == %biggerArray1_2_3
Given this information you should be able to experiment in TorqueScript and fully Grok multi-dimensional arrays.
Hall Of Worlds - For GamersEdM|GPGT
Torque Owner Merrie Schonbach