Sam Nielsen
Registered User
Join date: 23 Apr 2005
Posts: 7
|
05-28-2005 03:21
Been looking around the forums for a while but I can't find if this is possible. Perhaps it's so simple it's not even mentioned!
Anyway, is there a way of getting the relative position where a prim is touched? llGetPos type functions, as far as I can see, only report the position of the prim.
Essentially I'd like to make a keyboard that would have a keyboard texture over one prim (maybe a few prims if needed). Then I could left click on a 'key' on the keyboard texture and I'd know the position touched was, for example, 4.1,6.2 which was in the area of the 'A' key. Therefore 'A' had been pressed.
I know it's possible by having a prim for every key which reports when it's been touched but that's a lot of prims for a keyboard.
Any help greatly appreciated.
|
Malachi Petunia
Gentle Miscreant
Join date: 21 Sep 2003
Posts: 3,414
|
05-28-2005 07:45
The short answer is no - there is no straight-forward way in LSL to get the coordinates from where a prim has been touched. This is an oft requested feature especially since the system seems to know where you touched by virtue of the particle stream created when you Edit a prim.
On the other hand, I've seen some clever work-arounds to this most recently in someone's Go board which I saw under development. I will see if I can find a better reference.
|
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
|
05-28-2005 16:56
Actually, you can with mouselook and cube-like prims. See here: /15/ee/38717/1.htmlIf they're still up, take a look at Huns' comments as well. That's not a perfect script, but provides a decent example of ways to go about it.
_____________________
---
|
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
|
05-29-2005 02:00
...and/or vote for it to be supported in the language! http://secondlife.com/vote/index.php?get_id=288/esc
_____________________
http://slurl.com/secondlife/Together
|
Keknehv Psaltery
Hacker
Join date: 11 Apr 2005
Posts: 1,185
|
05-30-2005 09:14
That's not quite what he asked for... We want it to get relative position on ONE face, not which face.
|
Catherine Omega
Geometry Ninja
Join date: 10 Jan 2003
Posts: 2,053
|
05-30-2005 09:41
From: Keknehv Psaltery That's not quite what he asked for... We want it to get relative position on ONE face, not which face. No, Jeffrey's solution should do that. I've seen it work in world, and it does what you're asking. It's a complete pain in the ass, but it'll do it. 
|
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
|
05-30-2005 17:27
From: Catherine Omega No, Jeffrey's solution should do that. I've seen it work in world, and it does what you're asking. It's a complete pain in the ass, but it'll do it.  Truer words never spoken, Cath. 
_____________________
---
|
Keknehv Psaltery
Hacker
Join date: 11 Apr 2005
Posts: 1,185
|
05-31-2005 10:09
Jeffrey's solution is a truly amazing hack. I salute ye.
|
Sam Nielsen
Registered User
Join date: 23 Apr 2005
Posts: 7
|
06-01-2005 11:36
Thanks for that. The ML version could be useful.
Sounds like it might be a good function for them to add in at some point. Could save on a few prims.....
|