Kal Quar
-
Posts
2 -
Joined
-
Last visited
Content Type
Forums
Blogs
Knowledge Base
Posts posted by Kal Quar
-
-
Hello there,
I started working on a little script that displays a static particle for a fixed duration. For that, I use a function to which I pass the name of an image in the inventory of the prim:
play_particle(string Filename) { llParticleSystem([ PSYS_PART_FLAGS, PSYS_PART_EMISSIVE_MASK, PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_DROP, PSYS_PART_START_ALPHA, 1, PSYS_PART_END_ALPHA, 1, PSYS_PART_START_COLOR, <1,1,1>, PSYS_PART_END_COLOR, <1,1,1>, PSYS_PART_START_SCALE, <0.2,0.2,0.0>, PSYS_PART_END_SCALE, <0.2,0.2,0.0>, PSYS_PART_MAX_AGE, 20, PSYS_SRC_MAX_AGE, 20, PSYS_SRC_ACCEL, <0,0,0>, PSYS_SRC_ANGLE_BEGIN, 0, PSYS_SRC_ANGLE_END, 0, PSYS_SRC_BURST_PART_COUNT, 1, PSYS_SRC_BURST_RADIUS, 0, PSYS_SRC_BURST_RATE, 14, PSYS_SRC_BURST_SPEED_MIN, 0, PSYS_SRC_BURST_SPEED_MAX, 0, PSYS_SRC_OMEGA, <0,0,0>, PSYS_SRC_TEXTURE, Filename ]); }
It all works as expected, but then there's this weird effect when I detach the object and reattach it, it displays the last displayed particle again for the programmed duration.
My state_entry and on_rez events don't call that function in any way, so I figured there must be some SL gotcha I'm not aware of at play here. Since I'm rather new to scripting, I thought maybe someone here could explain to me what causes this behaviour and if there's a way to work around it. I considered having the function call a transparent particle on detach, seems a little odd to me but if that's the way to go...
Anyway, any ideas?
Particle displays on attach
in LSL Scripting
Posted
Hmm, I must have been confused then, because the way I understood it, when a particle is displayed, it can only be removed if max age is reached or if the object that initiated it is derezzed. So I didn't implement a clearing of it indeed, thinking detaching it would be enough, I didn't register that it was an actual object property, and it does make sense now. Thanks!