Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Agent detection problem/error

Phil Deakins
Prim Savers = low prims
Join date: 17 Jan 2007
Posts: 9,537
02-27-2008 07:48
I'm using llSensorRepeat in a security system. It detects agents within a set range, and deals with them after several warnings - the usual thing. It uses llOverMyLand to ensure that it doesn't warn or eject wrongly. It works fine unless the range crosses a sim boundary, when it detects *and deals with* agents who are in range, regardless of whose land they are on.

In tests, I've found that the error occurs only when the agent is opposite the land, and not when it is within range but not opposite the land.

Is there a way of dealing with this? Perhaps a way of knowing which sims the object and the agent are in?
_____________________
Prim Savers - almost 1000 items of superbly crafted, top quality, very low prim furniture, and all at amazingly low prices.

http://slurl.com/secondlife/Seymour/213/120/251/
Atashi Toshihiko
Frequently Befuddled
Join date: 7 Dec 2006
Posts: 1,423
02-27-2008 14:45
There is a bug with llSensorRepeat and a bug with llOverMyLand which come together to give you this problem. I ran into it about a year ago when I was working on a security bot.

You need to sort of double-check that the 'target' is in the same sim, so that you can trust the 'over my land' reading. Use one of the functions that gives you info on the agent, that only work if they are in the same sim. I used llGetAgentInfo as this will return a zero if the agent is not in the same simulator.

-Atashi
_____________________
Visit Atashi's Art and Oddities Store and the Waikiti Motor Works at beautiful Waikiti.
Phil Deakins
Prim Savers = low prims
Join date: 17 Jan 2007
Posts: 9,537
02-27-2008 15:21
Thank you, Atashi. It's appreciated.
_____________________
Prim Savers - almost 1000 items of superbly crafted, top quality, very low prim furniture, and all at amazingly low prices.

http://slurl.com/secondlife/Seymour/213/120/251/
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
02-27-2008 20:32
You can also use llGetPos() and llDetectedPos() to test whether: 1.) the detected avatar is in the object's sim (x, y, and z components of its location are between 0.0 and 256.0) and possibly 2.) double-check the distance using something like llVecDist() since sensors (maybe only repeated ones?) can sometimes return targets outside their detection range.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
02-28-2008 01:37
an alternative is to run llSensor through the timer event, instead of using llSensorRepeat, which should avoid getting results from off the sim
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -