Game Development Community

TSShapeConstructor

by Jedive · in Torque Game Engine · 04/04/2005 (1:32 pm) · 4 replies

I am using tutorial.base to learn Torque, seeing how it all works, and I think it is a very good starting point. The problem is that in the folder "data/shapes/player" I have seen a file player.cs, which does not seem to be included by any of the scripts. This file creates a datablock of type TSShapeConstructor, named PlayerDts. It defines the filename for the player shape, and a list of animations with different names (root, run, back, side, fall...). This PlayerDts datablock does not seem to be used on any of the scripts, but if I remove, for example, the "run" animation, it is not played when I move the player around the world.

When is this datablock used? How does the engine know which animation it has to play in each moment?

I would really appreciate any info on how this TSShapeConstructor stuff works. Thanks.

#1
04/04/2005 (8:22 pm)
The file is executed. Try grepping for player.cs.

All extant TSShapeConstructors are transmitted like datablocks when a client connects, defining important animation information for the models they describe. The name is unimportant, just the file they reference.

Have you tried reading the source for the Constructors?
#2
04/04/2005 (8:26 pm)
Hmm I wonder if this might possibly be the one reason when I added a new model I made, the engine segfaulted (no TSSchapeConstructor)
#3
04/05/2005 (12:53 am)
Yes I looked at the source, but I couldn't find answer to my questions on the C++ source for TSShapeConstructor.

So, once I have executed the script which defines the PlayerDts datablock... when I load the .dts referenced by that datablock, wil the animations be automatically merged into it?

I couldn't find any part on the scripts that tell which animation to play each moment... how you tell it to the engine? Are animations played automatically by the engine on each situation?
#4
04/06/2005 (11:39 am)
Yes.

The C++ code is responsible for most animation playing. Read through player.cc for some good examples.