Game Development Community

Field??? in datablock, question from noob

by Marty Keese · in Torque Game Engine · 03/26/2007 (7:00 am) · 8 replies

I am new to TGE and have finished the first hello world tutorial, and have some questions. I have search all documentation and must said TGE is the poorest documented application I have used.


datablock StaticShapeData(TorqueLogoItem)
{
category = "Items";
shapeFile = "~/data/shapes/3dtorquelogo/torque_logo.dts";
};

First, we define TorqueLogoItem as StaticShapeData datablock type... I could understand it, but where the "field" below come from


category = "Items";
shapeFile = "~/data/shapes/3dtorquelogo/torque_logo.dts";



I really can not find any references, document about it... and wonder how many field that StaticShapeData datablock have

I totally get loss now because I can not find list of function,object,etc we could use in Torque Scripts. The best doc I found here
http://tdn.garagegames.com/wiki/Torque_Console_Objects_TOC
But It still can not answer my question

#1
03/26/2007 (7:01 am)
The same question come with other datablock, for example camera.cs

datablock CameraData(Observer)
{
mode = "Observer";
};


how many mode we are having here, what each mode could do?
#2
03/26/2007 (7:09 am)
Hmm, not sure if I understand your question. The two properties category and shapeFile are used to desribe the static shape data block. Category is (if I remember right off-head) under which category to find it in the mission editor and shapeFile is, guess what, which DTS file to load. Maybe a

TorqueLogoItem.dump();

would help you understanding it? It dumps all available methods and stuff out to the console. Another thing that might help you is to look into the engine source of StaticShapeData and look inside and trying to understand what's going on there. There is also in some method I can't remember off-head a list of all fields that get read.
#3
03/26/2007 (8:11 am)
He's asking where the fields come from.

They are created in the engine, not the script. Open engine\game\staticShape.cc and engine\game\StaticShape.h. You'll find your answers where StaticShapeData is declared and filled out in those files.

Making a blanket statement such as. . .
Quote:
I have search all documentation and must said TGE is the poorest documented application I have used.

...is a good way to get flamed. Your frustration is understandable, but as you said, you are new to TGE. This means not only a lack of knowledge for the engine, but a lack of knowledge for what to search for in the online docs and forums.

I'm currently in the process of creating a massive FAQ for TDN, which covers this and a lot of other information. While I'm using some of my own knowledge from personal TGE usage, the majority of it is being gathered from existing documentation and materials. I'm just consolidating into one big article.

Keep at it, and don't let your frustrations get the best of you. We're here to help when stuff like this happens.
#5
03/26/2007 (11:47 am)
Thanks for all of your helps
I wonder where I could get all the information about each datablock and which filed in each datablock does. I have search all the site but fail.
About open the source and read it... Sorry but I am just used to scripting language and do not have any experience in C++. Moreover, I just want to learn to make something fun and small with Torque Scripting language..

So, I will re-ask
Except category and shapeFile, how many field that staticshapedata have?
The field
category = "Items";
What does it mean. And If Items is a pre-define class, so how many choice we have when declaring category = ""
#6
03/26/2007 (11:56 am)
There are a lot of fields. Some are not used by StaticShape, but are inherited because it derives off of shapeBase, which is derived from gameBase, etc. etc.

Items is not a pre-defined class. That is an arbitrary name you give a set of similar objects so that they show up in the same grouping in the WorldEditor.

If you aren't willing to dig into the engine, then chances are you won't need all those extra fields that you don't see right now.

However, opening up the engine code and reading it is no difficult task. That's just reading code, not modifying it.

Quote:
Read. Read code. Code
#7
03/26/2007 (11:59 am)
Thanks for all of your helps
I wonder where I could get all the information about each datablock and which filed in each datablock does. I have search all the site but fail.
About open the source and read it... Sorry but I am just used to scripting language and do not have any experience in C++. Moreover, I just want to learn to make something fun and small with Torque Scripting language..

So, I will re-ask
Except category and shapeFile, how many field that staticshapedata have?
The field
category = "Items";
What does it mean. And If Items is a pre-define class, so how many choice we have when declaring category = ""
#8
03/27/2007 (7:02 am)
Marty -

I suggest you look here

http://www.garagegames.com/docs/tge/general/index.php

Towards the bottom of that page you will in the appendix a list of all the datablocks in the game and a description of fields each one has.