Game Development Community

Shapes>Items vs. Static Shapes

by Infinitum3D · in Torque Game Engine · 11/18/2006 (3:38 am) · 6 replies

In the gettingStarted.pdf, the collision detection section has you use the TorqueLogoItem from the SHAPES>ITEMS directory. But there is no folder called ITEMS in the SHAPES folder.

Objects in the SHAPES>ITEMS section are different than STATIC SHAPES, and so they behave differently.

How do we get our .DTS objects to be listed in theSHAPES > ITEMS area of the World Editor Creator tree-view?

Thanks!

Tony

#1
11/18/2006 (5:24 am)
Hello,

Static shapes are just plain old .DTS objects that have been found by the engine and can be added in to a world without any baggage. They have no special properties of their own, except whatever was built into the mesh hierachy. They can include collision meshes and multiple levels of detail. While the .DTS file itself may include embedded animations, those would not be available to you as a static shape. For that, and so much more you would need another kind of object . . .

Non-static shapes are created in data block sections of various script files (sumthin.cs for example). Those data blocks dictate the mesh associated with each shape and the behavior of the shape within the game world. The existance of non-static shapes is so closely tied to .CS files that if the scripted datablock of a shape is invalid, then the shape won't even show up in the world-editor creation tree. As a scripted object, such shapes can be given a handle/name and be manipulated easily by scripted functions, triggered events, keybinds, and console commands.

I hope that helps.
#2
11/19/2006 (7:40 am)
Also by adding category in your datablock puts the item into a simset

datablock StaticShapeData( TeamOneFlag )
{
	[b]category = "Flags";[/b]
	shapeFile = "~/data/shapes/flag/flag1.dts";
};

This would put TeamOneFlag in a category called Flags in the world editor.


Be sure the path to your gold nugget is correct.
"~/data/shapes/gold/goldNugget.dts";
#3
11/20/2006 (4:12 pm)
So SHAPES>ITEMS need Datablocks with categories in .cs files.

THANK YOU to both Aaron and mb! This has been very helpful!!!

Tony
#4
11/20/2006 (4:13 pm)
All GameBase derived classes need datablocks. That's Item, Vehicle, Player, AIPlayer, StaticShape, Projectile, Camera - to name a few.

Good luck.
#6
11/21/2006 (3:07 pm)
Thanks all!

I created a new file called goldNugget.cs

and using this datablock

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

datablock StaticShapeData(goldNugget)
{
category = "Items";
shapeFile = "~/data/shapes/goldNugget/goldNugget.dts";
};


It works!

Thanks again!!!

Tony