Announcement

Collapse
No announcement yet.

Emitter issues

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Emitter issues

    How would I have a Emitter based class, only spawn emitters when I trigger it?

    (ie what settings would I have to modify?)

    I'm using an Emitter for a muzzle flash as opposed to xEmitter

    #2
    Take a look at MinigunAttachment.uc, it uses an emitter muzflash now.

    Comment


      #3
      I see a few obvious solutions that I'd very much doubt someone of your experience would not have considered already... but here goes.

      Set InitialParticlesPerSecond and ParticlesPerSecond to 0 (zero), and add methods for starting and stopping the emission. The Start method sets the PPS values to whatever you need, the Stop method resets them to 0.

      Alternatively...

      Completely de-spawn the emitter when you don't need it. This is the way wheel dust and Manta hover dust is handled, so I doubt it is that performance intensive.

      Comment


        #4
        Why make things more complicated than they need to be?

        Code:
        var class<Emitter>      mMuzFlashClass;
        var Emitter             mMuzFlash3rd;
        
        function Destroyed()
        {
            if (mMuzFlash3rd != None)
                mMuzFlash3rd.Destroy();
        
        	Super.Destroyed();
        }
        
        simulated event ThirdPersonEffects()
        {
            if ( FlashCount > 0 )
             {
                if (mMuzFlash3rd == None)
                {
                    mMuzFlash3rd = Spawn(mMuzFlashClass);
                    AttachToBone(mMuzFlash3rd, 'tip');
                }
                if (mMuzFlash3rd != None)
                {
                    mMuzFlash3rd.SpawnParticle(1); // if the emitter needs to spawn more particles
                                                                         //increase this number; for example a muzflash
                                                                         //that spawns a load of sparks. SpawnParticle(20) would work fine
                }
            }
        }
        
        defaultproperties
        {
            mMuzFlashClass=class'XEffects.NewMinigunMFlash'
        }
        Simple as that

        Comment

        Working...
        X