Emitting finite number of particles

Hi there,

I’m trying to create an effect that, just once, produces exactly 6 particles all at the same time. I’m working off of the “sparks” preset. From the documentation it seems like this is possible by setting emissionNum = 1. But, this doesn’t appear to work; 6 particles are being generated every emitDelay. So, I have:

                perEmit=6,

                emissionNum=1,

                emitDelay=100,

I’m using timer.performWithDelay to call destroyMaster() on the vent group after 1000 ms. 

Anyone have an idea about how to do this?

Thanks,

John

If you just want 6 particles once, whenever you need them, (character collects a coin, 6 particles - like an event emission) you could just do perEmit = 6 and use VentGroup:emit(“yourVent”).

  • C

That worked perfectly! Thanks a lot Caleb. CBEffects rocks, I love it!

John

Thanks for the encouragement :slight_smile:

  • C

hi, Caleb, really enjoying using CBEffects so far. I’m trying to do the same, not sure I’ve got the right syntax. Basically I want to emit a brief shower of sparks when the user gets an answer correct in a quiz game. I’ve set up params in the VentGroup using Easter Egg and then call spark.initiate() when the answer is correct. What would be the right syntax for using Emit rather than Initiate? Thanks for your help and for this gift to the community :slight_smile:

If you just want 6 particles once, whenever you need them, (character collects a coin, 6 particles - like an event emission) you could just do perEmit = 6 and use VentGroup:emit(“yourVent”).

  • C

That worked perfectly! Thanks a lot Caleb. CBEffects rocks, I love it!

John

Hm… Not sure what you mean; there is no initiate function for a VentGroup. If you’re talking about the initiate() function in the samples library, that’s just an internal function for the sample reader to use. To use an effect built from one of the samples, you can simply do…

[lua]

local sparks = CBE.VentGroup{

    – Copy and paste the params from the sample VentGroup

}

sparks:emit(“VentName”)

[/lua]

  • C

Thanks for the encouragement :slight_smile:

  • C

Got it!! Thanks, looks really nice. :slight_smile:

hi, Caleb, really enjoying using CBEffects so far. I’m trying to do the same, not sure I’ve got the right syntax. Basically I want to emit a brief shower of sparks when the user gets an answer correct in a quiz game. I’ve set up params in the VentGroup using Easter Egg and then call spark.initiate() when the answer is correct. What would be the right syntax for using Emit rather than Initiate? Thanks for your help and for this gift to the community :slight_smile:

Hm… Not sure what you mean; there is no initiate function for a VentGroup. If you’re talking about the initiate() function in the samples library, that’s just an internal function for the sample reader to use. To use an effect built from one of the samples, you can simply do…

[lua]

local sparks = CBE.VentGroup{

    – Copy and paste the params from the sample VentGroup

}

sparks:emit(“VentName”)

[/lua]

  • C

Got it!! Thanks, looks really nice. :slight_smile: