Game Development Community

Datablock tutorial/manual

by vanni bisella · in Torque 3D Beginner · 01/21/2015 (8:38 am) · 2 replies

Hello everyone
I'm new here. I'm learning to use torque3d. Can you tell me where i can find manual or tutorial step by step on how to create data block and apply them to 3D objects that I created?
thank you

#1
01/21/2015 (10:41 pm)
Each type of game object has its own type of datablock, and it is assigned at object creation.

For instance - create a project from the Full template. Then look in game/art/datablocks/player.cs. This file contains all of the datablocks for a player.

A Player and an AIPlayer share the same datablock, so to create an AIPlayer, you'd do something like this:
%player = new AiPlayer()
    {
        dataBlock = DemoPlayer; // DemoPlayer is the default AI Player datablock
    };
The same basic pattern applies to all other objects - you assign the datablock at creation. Creating each datablock is different based on the type of datablock you need - find examples throughout the Full Template.
#2
01/22/2015 (10:32 am)
very well
Thank you very much