Game Development Community

Splashdata emitter(s) and explosion

by Michael Hall · in Torque Game Engine · 09/11/2008 (2:20 pm) · 0 replies

I noticed that the associated particles and explosion effects for splashdata were not being shown with the splash ring effect.

In splash.cc at line 334 there is a isClientObject() check that when removed allows the emitters and the splash explosion to work. Remove the if statement only, not the contents between the braces.
//if( isClientObject() )
   //{
      for( U32 i=0; i<SplashData::NUM_EMITTERS; i++ )
      {
         if( mDataBlock->emitterList[i] != NULL )
         {
            ParticleEmitter * pEmitter = new ParticleEmitter;
            pEmitter->onNewDataBlock( mDataBlock->emitterList[i] );
            if( !pEmitter->registerObject() )
            {
               Con::warnf( ConsoleLogEntry::General, "Could not register emitter for particle of class: %s", mDataBlock->getName() );
               delete pEmitter;
               pEmitter = NULL;
            }
            mEmitterList[i] = pEmitter;
         }
      }

      spawnExplosion();
  //}

So far it appears to work fine on dedicated/non-dedicated servers, but I haven't tested it thoroughly. Not really sure why the check was there.

About the author

Been dabbling with game-programming since the age of 10 when I got my first computer, a Commodore. Got serious about game-development after modding Tribes for several years. Doesn't sleep much. Drinks rum. Teaches guitar. Plays cello.