CODE
default
{
state_entry()
{
llParticleSystem([]);
}
link_message(integer sender, integer num, string message, key id)
{
if(message =="Steam")
{
llSetTimerEvent(3.0);
updateParticles();
}
}
timer()
{
llParticleSystem([]);
llSetTimerEvent(0.0);
}
}
These forums are CLOSED. Please visit the new forums HERE
Timer/particle confusion |
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
11-12-2005 09:02
Can anyone think of why this script won't turn off after the 3 seconds, or rather will do so sometimes but not always? I've chopped out the updateParticles() function - not relevant and it works nicely. It's the turning off that's intermittent.
CODE
|
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
|
11-12-2005 09:55
What does the script look like that's sending the link-message to that grouping of code?
_____________________
--AeonVox--
Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music. |
Senuka Harbinger
A-Life, one bit at a time
![]() Join date: 24 Oct 2005
Posts: 491
|
11-12-2005 12:45
here's something that should work
***the transmitter*** CODE
***This is the particle "Switch" that goes with the particle engine*** CODE default if it's a prim starting the effect, you can have it transmit a string on some channel (in a different script) other than 0 and have the transmitter effect thingy listen for that string rather than the owner saying a command. |
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
11-13-2005 06:05
Kenn, the link message is one of several (there are options for other effects). Basically it's a touch script that pops up a dialog box with the options and passes them around the object overall so the right bits respond to the right messages. No timer, no repeat sending of the message etc.
That part works fine, and timers attached to other things than particle systems seem to work fine too. The thing that confuses me is that the failure is intermittent. I have two steam producing prims using identical scripts. They both turn on perfectly well. Sometimes both will turn off, sometimes one, sometimes none. It strikes me it's an intermittent failure in updating the particle system to the new settings, but I've never heard of that before, which is why I was asking if anyone can see anything else that might be going wrong. Since posting yesterday I've also noticed that recomiling the script doesn't always stop the particles if they're being incorrectly produced - more evidence to my mind that turning the particles off isn't working quite right. |
Senuka Harbinger
A-Life, one bit at a time
![]() Join date: 24 Oct 2005
Posts: 491
|
11-13-2005 07:35
Kenn, the link message is one of several (there are options for other effects). Basically it's a touch script that pops up a dialog box with the options and passes them around the object overall so the right bits respond to the right messages. No timer, no repeat sending of the message etc. That part works fine, and timers attached to other things than particle systems seem to work fine too. The thing that confuses me is that the failure is intermittent. I have two steam producing prims using identical scripts. They both turn on perfectly well. Sometimes both will turn off, sometimes one, sometimes none. It strikes me it's an intermittent failure in updating the particle system to the new settings, but I've never heard of that before, which is why I was asking if anyone can see anything else that might be going wrong. Since posting yesterday I've also noticed that recomiling the script doesn't always stop the particles if they're being incorrectly produced - more evidence to my mind that turning the particles off isn't working quite right. I encountered that exact same problem when adding a particle effect to one of my hovercrafts: even though the on/off command was being sent properly (verified through some debugging code), every now and then 1 or 2 of the 4 hoverjets wouldn't turn on or off (always random which one and wether the on or the off was bjorked). strangely enough the problem went away on it's own. Look at posts 4 and 5 here. |
Ben Bacon
Registered User
Join date: 14 Jul 2005
Posts: 809
|
11-13-2005 07:56
Eloise, your code looks great, and the fact that the default start_entry isn't always working either seems strange - just to confirm, try dropping an llOwnerSay into the timer event. If you see that and the particles continue, I would have to say either a bug or you're having some network related issues. How's you packet loss?
EDIT: or what Senuka said ![]() |
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
11-13-2005 09:24
It's the particle system not updating, tested again, with the llOwnerSay() in place. All of the prims receive the link message and fire as expected. All enter the timer event as expected, about 30% of the time the particle systems don't turn off (that's 3/10 that I tried today, yesterday it was closer to 50%, but you can't tell for sure, the numbers of tests are so small).
I've bug reported it, along with the script. |
Seagel Neville
Far East User
![]() Join date: 2 Jan 2005
Posts: 1,476
|
11-13-2005 18:38
aww... I'm afraid I'm misreading you but.. Why don't you use "PSYS_SRC_MAX_AGE, 3.0"?
I don't think it is efficient to stop llParticleSystem itself like llSetText. _____________________
![]() ![]() |
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
11-13-2005 23:59
I'll give it a go, but it becomes a balance, is it more efficient to turn a source on and off entirely (if it works) or turn it off that way and then reset the script. I tend to the former by intuition rather than any hard data.
|
Jesrad Seraph
Nonsense
Join date: 11 Dec 2004
Posts: 1,463
|
11-14-2005 01:55
I second Seagel's proposition
![]() I think the original problem may be caused by race conditions / unexpected delays between the two particle updates sent to your client. You might get different results on two different computers, maybe re-test the thing with another person watching and see if (s)he sees anythign different ? _____________________
Either Man can enjoy universal freedom, or Man cannot. If it is possible then everyone can act freely if they don't stop anyone else from doing same. If it is not possible, then conflict will arise anyway so punch those that try to stop you. In conclusion the only strategy that wins in all cases is that of doing what you want against all adversity, as long as you respect that right in others.
|
Alexis Ingersoll
Registered User
Join date: 26 Jan 2005
Posts: 14
|
11-14-2005 02:15
I second Seagel's proposition ![]() I think the original problem may be caused by race conditions / unexpected delays between the two particle updates sent to your client. You might get different results on two different computers, maybe re-test the thing with another person watching and see if (s)he sees anythign different ? The race condition thing is an excellent suggestion. You can test for that problem easily by keeping a global shared counter and printing and incrementing it in each of your event handlers (along with a message to tell which handler you are in). If you find the counter incrementing out of the order you expect, it's because of race conditions. |
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
11-14-2005 09:43
I went in earlier today my time (last night SL time) and amended some of the scripts as per Seagel's suggestion. To my surprise and intense annoyance those scripts and the ones with the llParticleSystem([]); line worked reliably and well over 50 times on the trot.
However I've taken the precaution of changing them all to the max life approach, one to remember for the future. So, my next question is, does anyone know how much of a hit it puts on the sim's resources to reset a script? |
Jesrad Seraph
Nonsense
Join date: 11 Dec 2004
Posts: 1,463
|
11-14-2005 20:36
A particle update is, AFAIR, a full object update, so it's like loading the object again from the asset server / sim asset cache (or just the prim which has the particlels, hopefully).
_____________________
Either Man can enjoy universal freedom, or Man cannot. If it is possible then everyone can act freely if they don't stop anyone else from doing same. If it is not possible, then conflict will arise anyway so punch those that try to stop you. In conclusion the only strategy that wins in all cases is that of doing what you want against all adversity, as long as you respect that right in others.
|