Game Development Community

Mounting particle effects to shapes?

by mm · in Torque Game Engine · 04/16/2004 (10:26 am) · 9 replies

Hello I just have a quick question. How do I mount a particle effect to a static shape? I am guessing that the shape will need to have a node to mount the particle effect. Any help will be greatly appreciated. :)

Matt

#1
04/19/2004 (12:41 pm)
Okay I am still tinkering around with this but haven't had any luck. What I want to do is use the shape replicator to spread certain particle effects around the map. I have a few special effects in mind and this might be more expedient to use. If someone knows how to mount a particle effect to a static shape I would really appreciate a push in the right direction. :)

Matt
#2
04/19/2004 (2:18 pm)
If your going to be putting it on a static shape, there is no reason to mount it since static shapes don't move.
#3
04/19/2004 (10:41 pm)
If all you want to do is spawn particle effects you really dont want/need ANY shapes for that... just write a little script that creates particle emitters at random locations on your map (you can restrict the area, make sure they are above the terrain etc. pretty easily)...
and if you do need static shapes, Josh is right, no need for mounting then, just create them at the shape's transform/position...
#4
04/20/2004 (9:19 am)
Thanks for the replies, guys. :)
Stefan, spawning particle effects through a script would be coming very close to what I had in mind. Thanks again for the input!

Matt
#5
04/20/2004 (11:56 am)
If you don't know how to spawn emitters through script already, heres an example for ya.

I use this for a vehicle creation effect.
function vehicleCreationFX(%pos)
{
   %obj = new ParticleEmitterNode() {
      position = %pos;
      rotation = "0 0 1 100";
      scale = "1 1 1";
      dataBlock = "DefaultEmitterNode";
      emitter = "VehicleSpawnEmitter";
      velocity = "1";
   };
   %obj.schedule(2900, "delete");
}
#6
04/20/2004 (11:59 am)
Thanks Josh! No I didn't know yet how to spawn particle effects via script. :)

Matt
#7
10/23/2006 (10:48 am)
I'm trying to use your example of spawning an emitter with script but it isn't working. Any help is greatly appreciated.
#8
10/23/2006 (1:11 pm)
Did you define a particle datablock called VehicleSpawnEmitter ?
#9
10/23/2006 (1:17 pm)
Actually I did and I got it to work finally... Woo Hoo ! Now I just need to spawn my fireplace bricks which is a static object so I've got to look through the ::create stuff.