Game Development Community

dynamic addfield()

by Robert Larmore · in Torque Game Builder · 09/10/2009 (1:53 pm) · 1 replies

I am trying to output a vector through the initPersistFields function based on its current size. I have not been able to find a way do this other then specifing a constant amount.


The example I started with is the line of code below.
addField("splashEmitter", TypeParticleEmitterDataPtr, Offset(splashEmitterList, PlayerData), NUM_SPLASH_EMITTERS);

What I would like to do is make NUM_SPLASH_EMITTERS be the current size of the of the array or vector I am loading or saving. Note this is not always the same and I dont want to have to put a large number and not use all the space.

Thanks
Robert

#1
09/10/2009 (5:39 pm)
You cannot set a variable amount, it must be constant.