Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Any way to clear the collision queue of a collision event?

Synergy Belvedere
Prim Reaper
Join date: 7 Jul 2004
Posts: 253
04-25-2005 10:38
Hi all,

I have a attached object that detects for collisions .... yes I know "Attachments cannot use volume detect" , well it does :P , at least, the event fires even though I'm wearing it.

Problem is I want it to catch that first collission & respond but then forget about the rest of the collisions that might've stacked up right after the first one. In other words, I want to respond to the collision and move on with life, but the queue'd up collisions make the object repeat what it did on the first one, which is unacceptable.

Any way to clear these out? I tried putting "llVolumeDetect(FALSE);" in the collision event after it handled the first one properly but the queue doesn't go away :(

Thanx :)
-Syn :cool:
Talila Liu
Micro Builder
Join date: 29 Jan 2004
Posts: 132
04-25-2005 11:44
Try a state change after your collision event? I havent tried this personally, so Id like to hear how it works out :)

But other then that, I bellieve an llResetScript() call should clear your queue, that is, if you dont have any important data you need to hold on to
Zeno Concord
To infinity, and beyond!
Join date: 28 Mar 2005
Posts: 51
Maybe do you own "ignore collisions"
04-25-2005 11:46
From: Synergy Belvedere
Problem is I want it to catch that first collission & respond but then forget about the rest of the collisions that might've stacked up right after the first one.


I dont know about clearing the collision queue, but maybe this idea will help. After the first collision, set a flag that indicates you have processed the collision, and check this flag first thing when you get another collision event, thus skipping any further processing. That ought to be faster. Then you have to arrange to clear this flag at some time, maybe after a time delay.
Synergy Belvedere
Prim Reaper
Join date: 7 Jul 2004
Posts: 253
04-25-2005 12:41
Sorry Talila, reset wont work as I do have important info in there. The flag idea is good, so as was said I'll need to figure out how to go about resetting the flag after say 4-5 seconds.
Catherine Omega
Geometry Ninja
Join date: 10 Jan 2003
Posts: 2,053
04-25-2005 13:25
From: Synergy Belvedere
Sorry Talila, reset wont work as I do have important info in there. The flag idea is good, so as was said I'll need to figure out how to go about resetting the flag after say 4-5 seconds.
Would it be possible to use two scripts, one that had a collision event and one that handled all the important data? You could use llResetScript then.
_____________________
Need scripting help? Visit the LSL Wiki!
Omega Point - Catherine Omega's Blog
Synergy Belvedere
Prim Reaper
Join date: 7 Jul 2004
Posts: 253
04-25-2005 13:33
Catherine, I bow to your wisdom (really i do!) but wouldnt a simple flag be easier?
Eggy Lippmann
Wiktator
Join date: 1 May 2003
Posts: 7,939
04-25-2005 14:40
Changing states clears the queue. It's the best and most standard way to do it.
That's what states are for, really. To differentiate between different activities... listening/not listening for text or collisions is a prime example of where a state change comes in handy.
You shouldn't need llVolumeDetect. Collisions with your av are passed to its attachments.
Also, look up llCollisionFilter.
Talila Liu
Micro Builder
Join date: 29 Jan 2004
Posts: 132
04-25-2005 14:42
From: Eggy Lippmann
Changing states clears the queue. It's the best and most standard way to do it.
...


What I said first, but I guess no one read that.
Catherine Omega
Geometry Ninja
Join date: 10 Jan 2003
Posts: 2,053
04-25-2005 14:57
From: Synergy Belvedere
Catherine, I bow to your wisdom (really i do!) but wouldnt a simple flag be easier?
Nah, I'm just suggesting for the sake of suggesting, really. :) Personally, I'd use states, but I'm making some assumptions about how the script works. It might be more convenient for you to choose a different approach.
_____________________
Need scripting help? Visit the LSL Wiki!
Omega Point - Catherine Omega's Blog
Eggy Lippmann
Wiktator
Join date: 1 May 2003
Posts: 7,939
04-25-2005 15:26
From: Talila Liu
What I said first, but I guess no one read that.

I'm sorry, Talila, I don't mean to steal your glory ;)
Your post didn't outright state that changing states did in fact clear the queue, so I thought I would make that clearer. Also, I have tried that personally and recently, so it makes sense to confirm your hypothesis, restating it as fact :)
Talila Liu
Micro Builder
Join date: 29 Jan 2004
Posts: 132
04-25-2005 15:43
Yes thanks for stateing it did work, I couldnt test it seeing as im at work. But I was just saying from earlier it seemed like my only suggestion was resetting the script.
Synergy Belvedere
Prim Reaper
Join date: 7 Jul 2004
Posts: 253
04-26-2005 08:37
From: Eggy Lippmann

You shouldn't need llVolumeDetect. Collisions with your av are passed to its attachments.


I dont need llVolumeDetect? I thought that's how the collision event gets 'turned on' ?

If this is not the case, and collisions raise an event without volumedetect turned on, what's the point of volume detect?
Talila Liu
Micro Builder
Join date: 29 Jan 2004
Posts: 132
04-26-2005 17:45
Volume Detection is Used to detect the presence of an item inside another. Thus dection of an item in a given volume.