Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Lowest cost proximity detector

Mojito Sorbet
Registered User
Join date: 12 Jun 2008
Posts: 13
07-24-2008 10:20
I have an action I want to trigger when a specific person gets within a certain area. I have two possible solutions:

1. A timer-driven sensor scan that starts with a large range (10m) and a slow rate (20sec) gradually shrinking and speeding up until the trigger range is reached (about 2m). Timeouts move the scan range back out and slow down if no hits at the smaller range. Once triggered it stops scanning until the next day by setting a long timer value.

2. A transparent prim covering the 2m radius target area, with llVolumeDetect on and a collision_start action. Comparing llGetUnixTime to a saved timestamp inhibits the response to once a day.

#2 should have the least lag effect, because I only expect a trigger to actually happen every few days. But I can't get the prim (a half cylinder) to be fully transparent. It only wants to go to 90%, leaving a ghostly outline.

Does this mean #1 is the only way to do it?
Cheree Bury
ChereeMotion Owner
Join date: 6 Jun 2007
Posts: 666
07-24-2008 10:35
From: Mojito Sorbet


#2 should have the least lag effect, because I only expect a trigger to actually happen every few days. But I can't get the prim (a half cylinder) to be fully transparent. It only wants to go to 90%, leaving a ghostly outline.

Does this mean #1 is the only way to do it?


I have given you a texture called totallyclear. It will make your prim invisible.

If you need to see it later, you can by turning on Highlight Transparent on the View menu. Ctrl-Alt-T is the shortcut to that.
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
07-24-2008 10:44
llSetAlpha(0.0,ALL_SIDES);
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
07-24-2008 16:19
If you're really interested in detecting only one specific avatar and want to cut the amount of lag contribution to a minimum, there is also llCollisionFilter(). We don't tend to use it much because...well, this is probably about the only application that can reasonably make use of it. Heh.

http://www.lslwiki.net/lslwiki/wakka.php?wakka=llCollisionFilter
Trep Cosmo
Registered User
Join date: 3 Mar 2005
Posts: 101
07-24-2008 21:46
If you're doing spherical ranges you can set a slow rate sensor or a single volume detect prim that pushes object/avatar keys to a list. Then what you do is use llGetObjectDetails() to get the position. After that a simple if(llVecDist(llGetPos(), other_pos) < 10.0) will tell you if the object is within 10m, and have another if block to check for 2m range.
_____________________
"There is no 'I' in team, but there is a 'Me' if you scramble it." -- House
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
07-24-2008 22:44
True. If you know the key of the avatar you're looking for, you could simply use llGetObjectDetails() in a timer loop. That easy. If an empty list is returned, they aren't in the region (and you might increase the timer period until the target enters the region).