Jump to content

sitting avatars and their attachments


clarashymonkey
 Share

You are about to reply to a thread that has been inactive for 1709 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I think my brain has turned to mush.

I have an avatar A, wearing an attachment B, who sits on an object C. In practice, A could be any one of a number of avatars, each with their own copy of the attachment B.

I am trying to decide the most efficient way to have B and C exchange information in a one-off, one-way conversation — either B-to-C or C-to-B; both would do the job.

Thoughts anyone? 

 

Link to comment
Share on other sites

It may help to remember that anything seat C says (via llRegionSayTo) to avatar A is received by A's attachments (B). And seated avatar A will be llAvatarOnSitTarget() for C or if not using sit targets, A will be the last element in C's linkset, so A is easy for a script in C to find at llGetLinkKey(llGetNumberOfPrims()).

Or going the other direction, a script in B can find the sat-upon object with llGetObjectDetails(A, [OBJECT_ROOT]) and then llRegionSayTo() that object.

A script in C will get a handy CHANGED_LINK event when there might be an A seated on it; I'm not thinking of any comparable event in an attachment so a script in B might need to poll to see if A is sitting on anything.

  • Like 2
Link to comment
Share on other sites

Thank you so much. For some reason it was totally doing my head in. 

Getting the seat-object C to recognise the avatar was easy enough and I have even got it reading the data stored in the avatar's attachment but, in terms of the two talking to each other, that was as far as I got.

I hadn't realised llRegionSayTo  messages sent to an avatar would simultaneously message the avatar's attachments. Must remember that one!

 I wonder though, would the same apply if I was to use llMessageLinked? I mean taking advantage of the fact that the seated avatar becomes part of the seat-object's link-set, would those messages also be picked up by the avatar's attachments?

llRegionSayTo just struck me as a bit of a sledgehammer to crack a nut when I first considered it.

Edited by clarashymonkey
Link to comment
Share on other sites

Yeah, I'm afraid there's no way to use llMessageLinked to communicate between a seat and an attachment. llRegionSayTo is a bit ugly but it's more efficient than one might expect: it avoids the whole proximity calculation that old llSay, llWhisper, or llShout has to do, instead directly targeting a single recipient and their attachments.

  • Like 1
Link to comment
Share on other sites

You're right, llLinkedMessage doesn't work. :(

So llRegionSayTo it is then, it seems.  And, as I now have to go that route, now I know that it speaks to an avatar's attachments as well as to the avatar itself …  I think you have also just solved another little problem I could see heading my way in relation to a future part of the overall project I am working on. It all looked so simple as a flow-chart lol.

Thank you again, anyway. I shall now put away the headache pills!

 

Edited by clarashymonkey
typo (now putting specs on)
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1709 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...