Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Strange behaviour of llVolumeDetect

Aaron Greenberg
Registered User
Join date: 28 Dec 2006
Posts: 48
02-12-2007 08:54
Hi.

We noticed a strange beahviour of volumedetect which i don't understand.

What we used was this simple script on a box:

default
{
state_entry()
{
llVolumeDetect(TRUE);
}

touch_start(integer total_number)
{
llSay(0, "Touched.";);
}

collision_start(integer collide)
{
llSay(0, llDetectedName(0) + " stepped on me.";);
}
collision_end(integer collide)
{
llSay(0, llDetectedName(0) + " left me.";);
}
}

What now happens is the following: When ever an avatar is on the box (which is more a plate actually), the collision_start is rised as it should and when the avatar left the box, the collision_end appears. But now, when the avatar who collides with the box touches the box while staying on it and don't move at all, the script rises a collision_end and then a collision_start again. Some time the collision_start comes first when touching and then the collision_end also. The events are rised on entering/leaving the box AND when touching it.
We even noticed, what makes the whole thing even more strange, that when one rez' another box with a touch_start event in the near of the box with the llVolumeDetect (both prims don't collide and aint linked together they're just some cm away from each other), and the new box is touched while staying on the llVolumeDetect box, the collision_end and the collision_start is rised also.
That makes it difficult for us as we wanted to have the volumedetect interact with a door which is triggered by touching. The volumedetect does some functions and sets some flags while it detects a collision_start. The flags are dropped on collision_end. When we touch the door now, while staying on the "detection pad", it rises the events and messes the whole flagsetting up.
That happens not, when an avatar touches which doesn't collide with the pad, only the touching of the avatar staying on the pad will rise the events.

Is there anyone who has an idea why this happens and how it is possible to prevent this behaviour?

Thankyou for any hints or tips
Learjeff Innis
musician & coder
Join date: 27 Nov 2006
Posts: 817
02-12-2007 12:30
Aaron, in the future please use PHP tags around code, so it looks like this:

CODE

default
{
state_entry()
{
llVolumeDetect(TRUE);
}

touch_start(integer total_number)
{
llSay(0, "Touched.");
}

collision_start(integer collide)
{
llSay(0, llDetectedName(0) + " stepped on me.");
}

collision_end(integer collide)
{
llSay(0, llDetectedName(0) + " left me.");
}
}


Sounds like a bug to me, btw.

Good luck,
Jeff
Aaron Greenberg
Registered User
Join date: 28 Dec 2006
Posts: 48
02-12-2007 13:29
Sorry I will use that next time.

We have noticed btw that this only happens, when the avatar who rezzed the boxes touches them... somehow strange...

Aaron

Edit: It seems that it makes a difference, where the second touchable box is. We also checked with a linkset which the volumedetect-box is not part of but inside (surrounded) of the linkset. When ever a prim of this linkset is touched, the behaviour appears but not always - I am unsure but somehow it seems that the distance of the avatar to the second box or the linkset does matter also...
Seifert Surface
Mathematician
Join date: 14 Jun 2005
Posts: 912
02-12-2007 16:00
Similar kind of thing: If you have a solid prim, not using llVolumeDetect, but just collision_start (or maybe just collision, I don't recall). If someone walks onto it the event of course triggers. If they stop and stand still, it stops triggering. If they then say anything in chat, it triggers.

Moral of the story: collision events are weird.
_____________________
-Seifert Surface
2G!tGLf 2nLt9cG