Announcement

Collapse
No announcement yet.

Temporarily stop an emitter from spawning? [solved]

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

    Temporarily stop an emitter from spawning? [solved]

    I made an emitter for an exhaust flame not unlike that of the Raptor. I'd like to be able to make it stop and restart spawning particles without destroying it, for efficiency reasons.

    I've messed around with ParticlesPerSecond, AutomaticInitialSpawning, RespawnDeadParticles, Disabled and whatnot, but I can only turn off the whole emitter. That means that the entire flame instantly vanishes rather than just fading out, and when turning it back on it instantly reappears where it left off rather than starting from scratch.

    Any hints? There's probably some really easy way to do this, but I can't figure it out for the life of me. :bulb:

    #2
    how about making the particles completely transparent?

    Comment


      #3
      Tried that. They'd all vanish. Maybe I didn't do it "right"...

      Comment


        #4
        Hmm, I know the raptor's exhaust you can set the lenght, and trigger them on/off. On the Viper's I had the trail emitters only come on at a certain velo or above.

        I think "Emitter.Disabled = false;" should work for you, of course, use whatever reference you have. This is for an Emitter class, if you are using xEmitter, im not sure if its the same deal.

        Alternativley you could alter the StartSizeRange and StartVelocityRange with a function, but I think the above is more suited to what you need.

        Of couese, make sure you dont forget bNoDelete=true in the defaults of the emitter.

        Comment


          #5
          I have it working!

          .Disabled disables all of the particles, effectively winking the entire flame out of existence.

          Setting StartSizeRange to zero did the trick. That only affects particles being spawned, not particles already out there.

          Not the most efficient method... but probably still more efficient than killing and respawning the whole emitter.

          Comment


            #6
            Well, you could fade it with the StartSizeRange, then Disable it to stop the spawning.

            Comment


              #7
              nvm

              I see now you need to set Emitters[i]

              Comment


                #8
                why not just set the particles per second to 0.0001 ? if your planning to restart the emitter again its much smaller property to change than setting range vectors.
                That's how i do it for my dynamic particle control in script. The effect is smooth.

                Code:
                // functions  PartPause & togPartPause
                // By VitalOverdose (was fataloverdose)
                
                Simulated Function (Emitter Target)
                {
                Local Int I;
                For ( I =0; I <Target.Emitters.Length ; I++ )
                    {
                     Target.Emitters[I].InitialParticlesPerSecond =0000.1;
                     Target.Emitters[I].AutomaticInitialSpawning  = False;
                    }
                }
                Code:
                Function Bool togPartPause(Emitter SpawnedEmitter)
                {
                Local Int I;
                
                For ( I=0; I<SpawnedEmitter.Emitters.Length ;I++ )
                    {
                    If (SpawnedEmitter.Emitters[I].InitialParticlesPerSecond ==0000.1)
                       {
                         Partoverride_Resume(SpawnedEmitter);
                         Return True;
                        }
                     PartPause(SpawnedEmitter);
                     Return False;
                    }
                }
                Code:
                Simulated Function Partoverride_Resume(Emitter Target)
                {
                Local Int I;
                For ( I =0 ; I < Target.Emitters.Length; I++ )
                    {
                     Target.Emitters[I].InitialParticlesPerSecond = Target.Default.Emitters[I].InitialParticlesPerSecond;
                     Target.Emitters[I].AutomaticInitialSpawning  = Target.Default.Emitters[I].AutomaticInitialSpawning;
                    }
                }

                Comment


                  #9
                  Odd... I did mess around with particles per second quite a bit (seemed the best solution), but I couldn't get it to work. I might have another look at that sometime.

                  Do you use RespawnDeadParticles, AutomaticInitialSpawning or ParticlesPerSecond?

                  Comment


                    #10
                    InitialParticlesPerSecond..the code is posted above.Feel free to use it. Its part of a much larger unreleased emitter mod ive been working on

                    Comment

                    Working...
                    X