Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Distance to chatting avatar

Abraxes Binder
Registered User
Join date: 23 May 2008
Posts: 205
08-09-2008 05:55
Hi all, is it posible to access the distance to an avatar that are chatting with a known (key?) prim. I would like to relase some effects when the chatting avi is less than 2 'meters'(?) away form an avi wearing the effect-creating attachment.
tyia
Ab
_____________________
BR ab
Sheltered Ambassador
Registered User
Join date: 29 Jun 2005
Posts: 9
08-09-2008 07:13
This should do what you want I'm guessing. Not in world to see if I missed any syntax things so it might not compile as written.

CODE

listen(integer channel, string name, key id, string message)
{
list temp = llGetObjectDetails(id,[OBJECT_POS]);
vector pos = llList2Vector(temp,0);
if (llVecDist(llGetPos(),pos) < 2)
{
//Do particle stuff here
}
}
Abraxes Binder
Registered User
Join date: 23 May 2008
Posts: 205
Thanks!
08-09-2008 23:54
Thank you! I will try that -That llGetObjectDetails is a nifty function. I will have to study that to see what other aspects this could be used for.
BR Ab
_____________________
BR ab