Looping through Datablock values
by Kevin Ostrowski · in Torque Game Engine · 04/27/2003 (4:22 pm) · 4 replies
Maybe I'm just thinking about it all wrong, or maybe it's not possible, but how can I loop through all the values of a datablock in script?
So for example how could I see everything in the wheeledVehicle datablock.
%Db.mass,
%Db.shapeName
and so on...
I have a good idea of how to do it in the engine, but I need to be able to do this script side.
So for example how could I see everything in the wheeledVehicle datablock.
%Db.mass,
%Db.shapeName
and so on...
I have a good idea of how to do it in the engine, but I need to be able to do this script side.
#2
04/28/2003 (12:04 pm)
You can dump a datablock using dump() in the scripts, but I don't know if you can iterate through every variable it contains.
#3
That one loops through all the datablock fields and prints the values and usage etc.
04/28/2003 (12:35 pm)
Yeah, you could look at simobject.cc, ConsoleMethod(SimObject,dump, void, 2, 2, "obj.dump()") and write a similar function doing exactly what you need in script...That one loops through all the datablock fields and prints the values and usage etc.
#4
04/28/2003 (1:34 pm)
Ahh, I knew there was something... I won't have a chance to dig in to it until later, but a quick look at dump() and I'm pretty sure I can do something with that. Thanks a lot.
Torque Owner Kevin Ostrowski