Game Development Community

Jump-Pad Particle Emitters

by Benjamin Stoneking · in Torque Game Engine · 06/25/2008 (2:56 pm) · 2 replies

I've been working on making a more up and down style of game play using all sorts of interiors (in other words my interiors are really tall). I want the players to be able to jump from one platform to the next, hundreds of feet from the ground using p-zones. my question is, that i've been making some dts shapes for my p-zones. Is a there a tutorial or piece of advise that can show me how to script a dts shape with mounted p-zone and particle emitters? I hope this all makes sense.

#1
07/02/2008 (10:39 am)
Anyone out there?
#2
07/10/2008 (10:40 am)
Well, You could try using this bit of code: (You'll have to replace all the names with your actual datablock names ec)

function jumpPadData::onAdd(%this, %obj)
{
     %obj.pZone = new PhysicalZone()
     {
          position = vectorAdd(%obj.getPosition(),"0 0 1");    //< You'll need to change the 0 0 1 values to offset where the physical zone is added
          //your physical zone values in here
     };
     MissionCleanup.add(%obj.pZone);

     %obj.pEmitter = new ParticleEmitterNode()
     {
          position = vectorAdd(%obj.getPosition(),"0 0 1");    //< You'll need to change the 0 0 1 values to offset where the particle emitter is added
          //your particle emitter values in here
     };
     MissionCleanup.add(%obj.pEmitter);
}

function jumpPadData::onRemove(%this,%obj)
{
     if(isObject(%obj.pZone))
          %obj.pZone.delete();
     if(isObject(%obj.pEmitter))
          %obj.pEmitter.delete();
}

Hope that helps you out a bit.