Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Which one touched it?

Bartiloux Desmoulins
Think Kink? Think Bart!
Join date: 27 Sep 2005
Posts: 121
08-05-2007 09:56
I've been going over this certain scenario in my head and I'm having trouble sorting things out so I thought I'd take it to the experts here in the Forum.

Let's say you have six chairs sitting side by side, numbered 1 through 6. Each chair has a pose ball on it so you can look cool while you're sitting. What I'm trying to figure out is this. There is an object positioned several meters in front of the row of chairs. The avies sitting in the chairs are asked to touch the object in front of them. I want the object being "touched" to tell me in which chair the person doing the touching is sitting in. I don't want to know the avie's name. I want to know the chair number.

Can this be done and, if so, how would you go about doing it?

Thanking you in advance for your replies...

Bartiloux Desmoulins
Bartiloux's Den of Sadistic Madness
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
08-05-2007 10:23
Here's one way

1) Person A sits in chair 1, Person B in chair 2, etc.
2) Upon sitting, any chair announces its number and the key of the avatar sitting on it on a private channel.
3) The object to be touched listens on said private channel and puts the chair numbers avatar keys in some list or combination of lists.
4) When a Person touches the object, it gets their key from llDetectedKey(), and uses llListFindList() to figure out which chair Person is sitting in.

Voila!
Bartiloux Desmoulins
Think Kink? Think Bart!
Join date: 27 Sep 2005
Posts: 121
08-05-2007 10:26
Very cool! Thank you very much.

Bartiloux