Game Development Community

Different way to spawn explosions?

by Sabrecyd · in Torque Game Engine · 08/16/2002 (9:25 am) · 7 replies

Anyone know a different method of creating an explosion other then the new explosion function or using a projectile. I only ask because creating a new explosion does not work well in networked games. Being able to spawn an explosion based on timers or many other things is very useful.

Any ideas would be greatly appreciated,
-Sabrecyd

#1
08/16/2002 (10:14 am)
I submitted a 'fix' to GG awhile ago regarding this issue. It is only a temporary fix to stop the crashing however. A more perminant solution needs to be developed yet. I havn't really found the time to do so, but if it's that big of a problem I guess I could find time.
#2
08/16/2002 (10:56 am)
Thanks for the update Robert.
No, it's not that critical at the moment for me at least. I'm sure a lot of people would like that fix in fairly soon. I didn't realize anyone was working on it which is great. I've commented out quite a few things in script for now because of that crash issue. Maybe when you submit a fix you could post about it?

Edit: I should say if you submit a new solution maybe you could post about it.

Thanks again,
-Sabrecyd
#3
08/19/2002 (9:30 am)
Robert, quick question.
Has the temp fix you submitted been added to the download code? I haven't updated to the 1.1.2 engine yet but am planning on doing that very soon. Even if this is a temp fix it would be better then crashing the engine. Do you think you could post the fix here if it hasn't been added to the code already?

Thanks,
-Sabrecyd
#4
08/19/2002 (10:44 am)
Have you tried subexplosions? They can be timed.
#5
08/19/2002 (10:54 am)
Only as part of a normal explosion. Is there a seperate function for that like the new explosion()? new subexplosion() or maybe new subExplosion()

I can certainly give this a try. Thanks.
#6
08/19/2002 (2:57 pm)
A mini sub-explosion tut:

// this defines the first (of three) sub explosions
datablock ExplosionData(MySubExplosion1)
{
   // explosionShape = "explosion.dts";  //animated file of an explosion
   faceViewer           = true;  // probably only needed if explosionShape is used
   explosionScale = "0.5 0.5 0.5";// probably only needed if explosionShape is used

   lifetimeMS = 1000;  // lifetime of explosion emitter
   delayMS = 0;   // delay in MS after routine called

   emitter[0] = MyExplosionEmitter;  //normal Particle emitter
   emitter[1] = SparkEmitter;   //a second particle emitter 

   offset = 0.0;  // offset from explosion epicenter

   playSpeed = 1.5; //probably only used with explosionShape

   sizes[0] = "1.5 1.5 1.5";
   sizes[1] = "3.0 3.0 3.0";
   times[0] = 0.0;
   times[1] = 1.0;
};

// this defines the explosion as a whole--including the subs
datablock ExplosionData(MyMainExplosion)
{
  // soundProfile = MyExplosionSound;

   subExplosion[0] = MySubExplosion1;
   subExplosion[1] = MySubExplosion2;
   subExplosion[2] = MySubExplosion3;
};
That should give you the basics to use subexplosions. Remember that any functions used in a normal explosion most likely can be used in a sub or the main explosion. The key to answer your question on timing goes to "delayMS" in the different subexplosions.

I hope this helps. :-)

Eric
#7
08/20/2002 (4:58 am)
Hey thanks a lot Eric. This could be useful for quite a few things.

-Sabrecyd