Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Sim Map coords

mrbarcode Aeon
Registered User
Join date: 4 Aug 2008
Posts: 11
11-30-2008 15:56
I'm making a sim wide map and need the ability to click anywhere on the map and create a point, then get the region coords of that location and store that into a vector for later use. is this possible to do? Maybe I can set on edge of the prim to 0,0 (No Z value), to 256, 256 and somehow get the mathamagical value?
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
11-30-2008 17:51
You'll want to use the new detect-touch-position function...

...which will declare the position touched as between 0.0 and 1.0

then figure out your value between 0 - 255 on that for both x and y.

Not sure how to pull a z-value out of a prim-map though.
_____________________
--AeonVox--

Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music.
mrbarcode Aeon
Registered User
Join date: 4 Aug 2008
Posts: 11
11-30-2008 19:27
Dont need z value with what I'm doing. But you gave me a good idea. Thanks
EDIT: Wait I'm confused. Can you give me a wiki link? I can only find proposed functions like llDetectedTouchST which sounds like what I want...but doesnt exist.
Tyken Hightower
Automagical
Join date: 15 Feb 2006
Posts: 472
11-30-2008 19:49
From: mrbarcode Aeon
Dont need z value with what I'm doing. But you gave me a good idea. Thanks
EDIT: Wait I'm confused. Can you give me a wiki link? I can only find proposed functions like llDetectedTouchST which sounds like what I want...but doesnt exist.

Actually, llDetectedTouchST does exist, and is the one you should use.
_____________________
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
11-30-2008 21:36
Link to llDetectedTouchST

You need to be using the 1.21 client or above for the touch-position to be detected.
_____________________
--AeonVox--

Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music.
mrbarcode Aeon
Registered User
Join date: 4 Aug 2008
Posts: 11
12-02-2008 09:21
Ok cool. I got the new client and an playing with the DetectedTouchST now. Really cool. However how would I get my 0 - 255 XY coords from this? I'm not that great at math so sorry if it's starting me in the face and I cant see it. Any ideas?
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
12-02-2008 23:52
From: mrbarcode Aeon
However how would I get my 0 - 255 XY coords from this? I'm not that great at math so sorry if it's starting me in the face and I cant see it. Any ideas?

The vector returned is in values from 0.0 - 1.0. So multiply that vector by 256 to cover the sim. Make sure the map is such that the lower-left touch corner is the SW corner of the sim.
Ee Maculate
Owner of Fourmile Castle
Join date: 11 Jan 2007
Posts: 919
12-03-2008 03:22
This thread might be a good place to start....

/54/f1/281263/1.html
mrbarcode Aeon
Registered User
Join date: 4 Aug 2008
Posts: 11
12-03-2008 14:17
From: DoteDote Edison
The vector returned is in values from 0.0 - 1.0. So multiply that vector by 256 to cover the sim. Make sure the map is such that the lower-left touch corner is the SW corner of the sim.

Friend told me to do that last night actually and it works great.