Game Development Community

The concept of datablocks.

by MK · in Torque Game Engine · 07/12/2002 (1:36 pm) · 6 replies

Can somebody please explain to me the concept of datablocks.

What are they used for?
In what circumstances should they be used? rather than member variables in C++ objects or script variables?
And any other info.

Thanx.

#1
07/13/2002 (10:05 am)
I still don't grasp this concept all that well, but it is my understanding that datablocks are just "scripted classes." When you define a datablock, you're defining the attributes of the scripted class. You then use those classes to script how the game runs.
#2
07/13/2002 (6:11 pm)
This might help: scripting language reference; there's a brief section on datablocks.
#3
06/24/2009 (4:12 pm)
I am wondering what all the variables one could ad to a dataBlock catagory are?



mass,
size,
gravity? for some levels I suppose
weapon default
outfitA.





any thoughts? but also, I am i on the right path in thinking in this direction?
#4
06/25/2009 (1:16 am)
MK - Datablocks are invisible objects that hold data about other objects of a specific 'class'. For example, you would have one datablock for all BMW M6s which holds values for their engine torque, BHP, default weight, etc - since these values are the same for all M6 cars. You'd have another datablock for a different type of car, since its torque, BHP and mass are probably different.

Rennie - different types of datablocks let you store different sets of values. Have a look at TDN if you have access, there's lots of resources telling you what values can be put in what datablocks.
#5
06/25/2009 (4:03 am)
This was a good post on it:

http://www.garagegames.com/community/forums/viewthread/92321
#6
06/25/2009 (5:20 am)
DataBlocks, Explained!

Oops, Steve got it posted already.

Tony