Kal Quar Posted April 20, 2019 Share Posted April 20, 2019 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? Link to comment Share on other sites More sharing options...
Qie Niangao Posted April 20, 2019 Share Posted April 20, 2019 Does the script clear the particle system -- llParticleSystem([]); -- after the desired interval? and/or on detach? Because otherwise you've defined a prim property consisting of that particle system that will appear when the object next rezzes into view. (This can actually be a cool and useful effect when it's what you want, but it's easy to forget to clear the particle system when you don't want it.) Link to comment Share on other sites More sharing options...
Kal Quar Posted April 20, 2019 Author Share Posted April 20, 2019 2 hours ago, Qie Niangao said: Does the script clear the particle system -- llParticleSystem([]); -- after the desired interval? and/or on detach? Because otherwise you've defined a prim property consisting of that particle system that will appear when the object next rezzes into view. (This can actually be a cool and useful effect when it's what you want, but it's easy to forget to clear the particle system when you don't want it.) 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! Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now