×

Langue

Fermer
Atelier 801
  • Forums
  • Dev Tracker
  • Connexion
    • English Français
      Português do Brasil Español
      Türkçe Polski
      Magyar Română
      العربية Skandinavisk
      Nederlands Deutsch
      Bahasa Indonesia Русский
      中文 Filipino
      Lietuvių kalba 日本語
      Suomi עברית
      Italiano Česky
      Hrvatski Slovensky
      Български Latviešu
      Estonian
  • Langue
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • [Function] eventParticle()
[Function] eventParticle()
Itchyboy
« Citoyen »
1413917100000
    • Itchyboy#0000
    • Profil
    • Derniers messages
    • Tribu
#1
  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
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#2
  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
    • Itchyboy#0000
    • Profil
    • Derniers messages
    • Tribu
#3
  0
lol, I knew that I could just do dP, but I liked the tfm.exec.dP() :P
Safwanrockz
« Censeur »
1413919320000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#4
  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
    • Itchyboy#0000
    • Profil
    • Derniers messages
    • Tribu
#5
  0
No, I understood, I just didn't want to admit I was wrong :P
Shamousey
« Consul »
1413927720000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#6
  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
    • Itchyboy#0000
    • Profil
    • Derniers messages
    • Tribu
#7
  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().
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • [Function] eventParticle()
© Atelier801 2018

Equipe Conditions Générales d'Utilisation Politique de Confidentialité Contact

Version 1.27