[Function] eventParticle() |
Itchyboy « Citoyen » 1413917100000
| 0 | ||
To make a very primitive eventParticle() all you have to do is this: function eventParticle(id,x,y,vx,vy,ax,ay,name) --STUFF end function tfm.exec.dP(id,x,y,vx,vy,ax,ay,name) tfm.exec.displayParticle(id,x,y,vx,vy,ax,ay,name) eventParticle(id,x,y,vx,vy,ax,ay,name) end This will only work for particles spawned with the Module API, sadly. You also have to replace tfm.exec.displayParticle() with tfm.exec.dP(). I don't really know what eventParticle() is useful for, but I bet you could find something. |
Safwanrockz « Censeur » 1413917820000
| 0 | ||
Alternatively you can do: dP = tfm.exec.displayParticle function tfm.exec.displayParticle(id,x,y,vx,vy,ax,ay,name) eventParticle(id,x,y,vx,vy,ax,ay,name) dP(id,x,y,vx,vy,ax,ay,name) end function eventParticle(id,x,y,vx,vy,ax,ay,name) print "Particle event!" end Which will give the same results if used with the default tfm.exec.displayParticle() Dernière modification le 1413917880000 |
Itchyboy « Citoyen » 1413918840000
| 0 | ||
lol, I knew that I could just do dP, but I liked the tfm.exec.dP() :P |
Safwanrockz « Censeur » 1413919320000
| 0 | ||
You seemed to have misunderstood me. xD I meant with the script I posted, eventParticle() triggers even if you use the default tfm.exec.displayParticle(). |
Itchyboy « Citoyen » 1413919560000
| 0 | ||
No, I understood, I just didn't want to admit I was wrong :P |
Shamousey « Consul » 1413927720000
| 0 | ||
Is there any practical use for this? objectList and playerList are lists that make sense since they're things that update and can be removed. Particles on the other hand can't be modified or removed as they're spawned and disappear within a second. |
Itchyboy « Citoyen » 1414019880000
| 0 | ||
Well, I just thought it was cool. But I bet if someone wanted to have a special place for stuff when they play certain particles instead of just having it within the loop with tfm.exec.displayParticle(). |