Creating SimObjects on the C++ side
by Andrew Haydn Grant · in Torque Game Engine · 03/15/2005 (11:52 am) · 2 replies
I would like to create a variety of SimObjects dynamically on the C++ side of things, rather than in script. A lot of hidden mojo happens when I create an object from script. Could anyone out there tell me how to do the following in C++? I can create objects that *mostly* work, but cause asserts much later in the program. I'm sure I am missing other basics, so I am hoping that there is some stock answer already known to the gurus. :-)
%player = new Player()
{
scale = "10 10 10";
dataBlock = handymanBlock;
shapeFile = "~/data/shapes/player/player.dts";
};About the author
#2
PlayerData* ppd = dynamic_cast( Sim::findObject("foo") );
pObject->setDataBlock(ppd);
to save me from problems in pack() and unpack().
It's good to know that there is a lot less mojo than I expected. Thanks, Melv!
03/15/2005 (1:38 pm)
For some objects, I also need something like:PlayerData* ppd = dynamic_cast
pObject->setDataBlock(ppd);
to save me from problems in pack() and unpack().
It's good to know that there is a lot less mojo than I expected. Thanks, Melv!
Associate Melv May
- Melv.