Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

collision_end problem

Yuriko Nishi
Registered User
Join date: 27 Feb 2007
Posts: 288
07-21-2009 18:25
hi :)

collision_end does not work if the avatar teleports off the prim that uses the detection.

i want a list that shows everyone in my shop.
i use collision_start to add people, and collision_end to remove people.
it works pretty good as long as people walk/fly out of the shop. but as soon as they teleport, the detection fails. (allmost everyone teleports out...)

is there an easy way to fix it, or are there any open source scripts that do it without scanning the sim every second?

i liked the collision approach because it seemed easy and low lag, but after trying the whole day i am stuck now and can“t find anything in the forums, they all only detect arriving people to greet.

any help would be great :)
Soen Eber
Registered User
Join date: 3 Aug 2006
Posts: 428
07-21-2009 18:43
Two options: llGetAgentSize and llGetAgentInfo (I think...). Size returns ZERO_VECTOR if a key is not an avatar, or even if they are an avatar but are not in the sim. llGetAgentInfo returns more info like pos and stuff so you can check that out as well.

integer is_avatar_and_in_sim(key id)
{
// hacky test if key is an avatar. Also returns ZERO_VECTOR if an avatar has left the sim
if (llGetAgentSize(id) == ZERO_VECTOR) return FALSE;
else return TRUE;
}
Yuriko Nishi
Registered User
Join date: 27 Feb 2007
Posts: 288
07-21-2009 21:37
thank you :)

i use a timer now to check for the size every 20 seconds once there is someone in the shop.
not perfect but sometimes we need to be creative to work around the flaws :)