So…
You’ve got local bullets. That’s fine.
You’ve got a collision function for the bullets. That’s fine.
You’ve got an emitter getting created when you’re firing a bullet. That’s fine.
You’ve got a name for an emitter. That’s fine.
You need a way to get the name of the emitter from the local object (bullet), and the object is created inside a function. That’s your question.
That’s what I’m gathering from your post. Correct?
If so, you probably already know that you can access the local object in it’s collision function. It’s under event.target (or maybe self, if it’s not there). So that’s how you get the bullet itself. As for the emitter, you can make the name of the emitter an element of the bullet (As a side note, unless you’re not taking anything out of the BEmitters table, I’d use a separate counter for the name number):
[lua]
– Earlier:
local emitterCount = 0
– In bullet fire function
emitterCount = emitterCount + 1 – Increment emitterCount, which you’ll use for titling the emitters
local emitterName = “E” … emitterCount
bullet.emitterRef = emitterName
Particles.CreateEmitter(emitterName, doodad, thingy, somethingElse) – I have no idea how ParticleCandy works
[/lua]
Then, when you want to stop the emitter (in the collision function?), do this:
[lua]
– I’m assuming ParticleCandy has a delete command…?
Particles.DeleteEmitter(event.target.emitterRef)
– (or stop and remove, if there is no delete equivalent)
[/lua]
Hope this helps!