Arrays in Datablocks?
by Matt "Mr. Pig" Razza · in Torque Game Engine · 06/04/2007 (12:47 pm) · 4 replies
Is it possible to expose an array to a datablock?
I.E. addField();
then in script
datablock foo(bar)
{
foo[1] = bar;
foo[2] = bar;
};
I.E. addField(
then in script
datablock foo(bar)
{
foo[1] = bar;
foo[2] = bar;
};
About the author
#3
Matt is asking about exposing arrays from code. Matt, you can indeed do this, for example:
(from Player.cc)
Where NUM_SPLASH_EMITTERS is the size of the array.
Ian
06/05/2007 (8:47 am)
Wow, what an example of people not reading the question properly.Matt is asking about exposing arrays from code. Matt, you can indeed do this, for example:
addField("splashEmitter", TypeParticleEmitterDataPtr, Offset(splashEmitterList, PlayerData), NUM_SPLASH_EMITTERS);(from Player.cc)
Where NUM_SPLASH_EMITTERS is the size of the array.
Ian
#4
06/05/2007 (12:20 pm)
@Ian, thank you very much!
Torque Owner Bryce "Cogburn" Weiner
Yes... because saying is equal to saying