Spawning explosions.
by Thomas -elfprince13- Dickerson · in Game Design and Creative Issues · 06/08/2009 (11:19 pm) · 2 replies
I'm trying to use the following code to spawn explosions inside a function.
I get all the lovely output in the console, and no explosion. Attempting to create an explosion by hand in the console leads to an error that the object does not exist, when I try and add it to MissionCleanup.
echo("bang");
%expdata = %this.explosion;
echo(%expdata);
%pos = %obj.getPosition();
echo(%pos);
%exp = new Explosion()
{
datablock = %expdata;
initialPosition = %pos;
};
echo(%exp);
MissionCleanup.add(%exp);
//radius damage perhaps?
%obj.delete();I get all the lovely output in the console, and no explosion. Attempting to create an explosion by hand in the console leads to an error that the object does not exist, when I try and add it to MissionCleanup.
About the author
C.S. PhD student at Brown University. Project lead for FreeBuild. Administrator, Cemetech tech community. Webmaster for the Village2Village Projects and the Vermont Sustainable Heating Initiative.
Torque 3D Owner Aun Taraseina
%exp = new Explosion() { datablock = %expdata; client = ClientGroup.getObject(0); initialPosition = %pos; };