Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.86 KB | None | 0 0
  1. float gfParticleTimer = 10; // Seconds.
  2. integer gbParticleFlag;
  3.  
  4.  
  5.  
  6. ParticlesOn()
  7. {
  8. integer i;
  9. string sTexName;
  10. vector vTexSize;
  11. vector vColor;
  12. vColor.x = llFrand(1);
  13. vColor.y = llFrand(1);
  14. vColor.z = llFrand(1);
  15. i = llFloor(llFrand(5));
  16. if (i == 0)
  17. {
  18. sTexName = "Ribbon2";
  19. vTexSize = <0.10, 0.35, 0>;
  20. }
  21. else if (i == 1)
  22. {
  23. sTexName = "Diamond4";
  24. vTexSize = <0.20, 0.20, 0>;
  25. }
  26. else if (i == 2)
  27. {
  28. sTexName = "Dot6";
  29. vTexSize = <0.08, 0.08, 0>;
  30. }
  31. else if (i == 3)
  32. {
  33. sTexName = "Star7";
  34. vTexSize = <0.13, 0.13, 0>;
  35. }
  36. else
  37. {
  38. vTexSize = <0.15, 0.15, 0>;
  39. i = llFloor(llFrand(3));
  40. if (i == 0) sTexName = "Twirl5a";
  41. else if (i == 1) sTexName = "Twirl5b";
  42. else sTexName = "Twirl5c";
  43. }
  44. //
  45. llParticleSystem
  46. ([
  47. PSYS_SRC_TEXTURE, llGetInventoryKey(sTexName)
  48. , PSYS_PART_FLAGS, 0 // Specify any combination of the following:
  49. // | PSYS_PART_BOUNCE_MASK // Particles bounce.
  50. | PSYS_PART_EMISSIVE_MASK // Full-bright and unaffected by sunlight.
  51. // | PSYS_PART_FOLLOW_SRC_MASK // Move with emitter. Nothing to do with spin.
  52. | PSYS_PART_FOLLOW_VELOCITY_MASK // Rotate "top" towards direction of movement or emission.
  53. // | PSYS_PART_INTERP_COLOR_MASK // Color and alpha transition from START to END.
  54. // | PSYS_PART_INTERP_SCALE_MASK // Size/scale transitions from START to END.
  55. // | PSYS_PART_RIBBON_MASK // Joined together into one continuous triangle strip.
  56. // | PSYS_PART_TARGET_LINEAR_MASK // Move in straight line towards PSYS_SRC_TARGET_KEY.
  57. // | PSYS_PART_TARGET_POS_MASK // Change direction.
  58. // | PSYS_PART_WIND_MASK // Wind affects movement.
  59. //
  60. , PSYS_SRC_PATTERN, // Only ONE is specified (velocity directions):
  61. // PSYS_SRC_PATTERN_EXPLODE // Sphere.
  62. PSYS_SRC_PATTERN_ANGLE_CONE // Sphere, sub-sphere, cone or ring.
  63. // PSYS_SRC_PATTERN_ANGLE // Flat circle, semi-circle, arc or ray. Flattens PSYS_SRC_PATTERN_ANGLE_CONE.
  64. // PSYS_SRC_PATTERN_DROP // No initial velocity.
  65. , PSYS_SRC_BURST_RADIUS, 0.0 // Distance from emitter where particles are created. Max 50.
  66. , PSYS_PART_MAX_AGE, 5.0 // Particle lifetime, in seconds. Max 30.
  67. // , PSYS_SRC_TARGET_KEY, llGetKey() // A target's key toward which the particle goes (POS_MASK or LINEAR_MASK).
  68. , PSYS_SRC_ANGLE_END, (DEG_TO_RAD * -90) // Ending arc angle (radians between 0 and PI).
  69. , PSYS_SRC_ANGLE_BEGIN, (DEG_TO_RAD * 45) // Above is more important. Half angle of a circular or spherical "dimple".
  70. , PSYS_SRC_ACCEL, <0.0, 0.0, -0.4> // Magnet on particles to make arcs. -z makes gravity.
  71. , PSYS_SRC_OMEGA, <0.0, 0.0, 0.0> // Rotation between bursts of the emitter in radians per second along each axis.
  72. , PSYS_SRC_BURST_RATE, 0.02 // Interval between particle emission bursts. 0=fast as possible. 0.05
  73. , PSYS_SRC_BURST_PART_COUNT, 5 // Particles emitted in each burst.
  74. , PSYS_SRC_BURST_SPEED_MIN, 0.6 // Minimum speed upon emission (meters per second). (random between min and max per burst)
  75. , PSYS_SRC_BURST_SPEED_MAX, 2.0 // See PSYS_SRC_BURST_SPEED_MIN.
  76. , PSYS_SRC_MAX_AGE, 4.0 // Time that the emitter will operate upon coming into view. 0=infinite.
  77. , PSYS_PART_START_COLOR, vColor // Color of particles upon emission.
  78. , PSYS_PART_END_COLOR, vColor // PSYS_PART_INTERP_COLOR_MASK must be set (see FLAGS).
  79. , PSYS_PART_START_ALPHA, 1.0 // 0 to 1 level of translucency (alpha). 1=opaque.
  80. , PSYS_PART_END_ALPHA, 1.0 // PSYS_PSYS_PART_INTERP_COLOR_MASK must be set (see FLAGS).
  81. , PSYS_PART_START_SCALE, vTexSize // Scale (size) of particles upon emission.
  82. , PSYS_PART_END_SCALE, vTexSize // PSYS_PART_INTERP_SCALE_MASK must be set (see FLAGS). <0.10, 0.35, 0.0>
  83. , PSYS_PART_START_GLOW, 0.1 // 0 to 1 level of "glow". 1=full glow.
  84. , PSYS_PART_END_GLOW, 0.1 // PSYS_PART_INTERP_SCALE_MASK must be set (see FLAGS).
  85. ]);
  86. }
  87.  
  88. ParticlesOff()
  89. {
  90. llParticleSystem([]);
  91. }
  92.  
  93.  
  94.  
  95.  
  96.  
  97. default
  98. {
  99.  
  100. touch_start(integer total_number)
  101. {
  102. ParticlesOn();
  103. gbParticleFlag = TRUE;
  104. llResetTime();
  105. llSetTimerEvent(0.25);
  106. }
  107. timer()
  108. {
  109. // Turn particles off if necessary, and put timer back.
  110. if (gbParticleFlag)
  111. {
  112. if (llGetTime() > gfParticleTimer)
  113. {
  114. ParticlesOff();
  115. gbParticleFlag = FALSE;
  116. llSetTimerEvent(0);
  117. }
  118. else ParticlesOn();
  119. }
  120. }
  121. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement