|
Catherine Dollinger
Registered User
Join date: 11 May 2007
Posts: 26
|
05-31-2007 04:12
Hi everybody, I've got an "other way round" problem: I intend to build an attachment that is to react when an avatar is sitting on a specific object (the sit object cannot be changed anymore). So I would like to test, whether the avatar wearing my attachment is currently sitting on the object. I found functions which might act _from_ the object, but none to determine what I'm currently sitting on. So I need something like the reverse function for llAvatarOnSitTarget(). Is this possible to script anyhow? All help is welcome  ) Greetings Catherine
|
|
Anti Antonelli
Deranged Toymaker
Join date: 25 Apr 2006
Posts: 1,091
|
05-31-2007 04:25
I don't think you can get that information directly, but one way to approach the problem might be to poll llGetAgentInfo(llGetOwner()) on a timer, and check to see if the avatar is sitting - then if he or she is, run a llSensor for the name of your object on a very limited range, like 1 meter. So your action takes place only if the avatar is sitting AND is sitting less than one meter from your object. Depending on the specifics of your usage, that might be a fairly reliable hack.
|
|
Noctua Janus
Registered User
Join date: 22 Mar 2007
Posts: 29
|
05-31-2007 04:49
This is just a wild guess and I'm far away from the client - so no chance to test it:
As far as I know an attachment is considered "linked to the avatar" and sitting on an objekt links my avatar to that object, so the moment you sit down the both objekts should be in the same link set ?!?
|
|
Catherine Dollinger
Registered User
Join date: 11 May 2007
Posts: 26
|
Not quite, but worked for me...
06-01-2007 09:20
Thanks for the help, it got me on the right trail. The solution with llGetAgentInfo(llGetOwner()) does not work for the object I'm sitting on, as the sensor does not find the thing I'm sitting on. It is found as long as I stand next to it, but it vanishes from the sensor as soon as I sit down. But no real problem for me - the object's setup consists of two parts, so I simply search for the other one  So the second approach seems to be better, but I don't know (yet) how to determine the objects in the same link set. As soon as I find out (maybe some hint here, ladies & gents?), I'll be happy to post a code fragment for the basic idea to provide a solution for those searching here 
|
|
Milambus Oh
Registered User
Join date: 6 Apr 2007
Posts: 224
|
06-01-2007 09:43
From: Catherine Dollinger So the second approach seems to be better, but I don't know (yet) how to determine the objects in the same link set. As soon as I find out (maybe some hint here, ladies & gents?), I'll be happy to post a code fragment for the basic idea to provide a solution for those searching here  Not possible. 1. Objects are -attached- to the avatar, not linked. Each attachment exists within its own link space separate from the avatar itself and any other attachments they are wearing. 2. Even if they were in the same linked set, there does not seem to be anyway to access determine which item the avatar is linked to (sat upon). Here are all of the functions that deal with linked objects: http://lslwiki.net/lslwiki/wakka.php?wakka=link
|