Jump to content

How to make a SLURL from Global Coordinates?


primerib1
 Share

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

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

Recommended Posts

Via the official Map API, yes. You could make an http request to a utility URL specifying the global coordinates and the response (after some formatting) would be the region name. See https://wiki.secondlife.com/wiki/Linden_Lab_Official:Map_API_Reference#Utility_URLs

Note you would need to divide the value returned by llGetRegionCorner by 256 to get the proper region offset.

Once you have the region name, you can construct a SLURL or a clickable chat link with the Viewer URI formatting.

Edit: Played around inworld and I think it's quite doable. Here's the basic idea:

  1. given any arbitrary global coordinate, use the map api to get the region name.
  2. find the region's region corner (can use the other utility url, or llRequestSimulatorData with "DATA_SIM_POS".
  3. subtract the region corner from the arbitrary global coordinate to get the local position within the region.
  4. use the discovered (escaped) region name and the discovered local XYZ position to create the URI link.
Edited by Fenix Eldritch
  • Like 3
  • Thanks 1
Link to comment
Share on other sites

I'm too lazy/busy to re-examine this, but here's a script I keep misplacing which converts all landmarks in object inventory into a useable SLURLs after fetching global coordinates:

I think the main trick is

llHTTPRequest(
   "https://cap.secondlife.com/cap/0/b713fe80-283b-4585-af4d-a3b7d9a32492?"
   + "var=name&grid_x=" + (string)llFloor(grid.x)
   + "&grid_y=" + (string)llFloor(grid.y), [], "");
        

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

On 11/28/2022 at 8:44 PM, Fenix Eldritch said:

Via the official Map API, yes. You could make an http request to a utility URL specifying the global coordinates and the response (after some formatting) would be the region name. See https://wiki.secondlife.com/wiki/Linden_Lab_Official:Map_API_Reference#Utility_URLs

Note you would need to divide the value returned by llGetRegionCorner by 256 to get the proper region offset.

Once you have the region name, you can construct a SLURL or a clickable chat link with the Viewer URI formatting.

Edit: Played around inworld and I think it's quite doable. Here's the basic idea:

  1. given any arbitrary global coordinate, use the map api to get the region name.
  2. find the region's region corner (can use the other utility url, or llRequestSimulatorData with "DATA_SIM_POS".
  3. subtract the region corner from the arbitrary global coordinate to get the local position within the region.
  4. use the discovered (escaped) region name and the discovered local XYZ position to create the URI link.

Wow, thanks! That's really helpful.

After getting the Region Name, I can easily build a SLURL with the local coordinates as (coord % 256.0)

Again, thank you!

Link to comment
Share on other sites

On 11/29/2022 at 12:06 AM, Quistess Alpha said:

I'm too lazy/busy to re-examine this, but here's a script I keep misplacing which converts all landmarks in object inventory into a useable SLURLs after fetching global coordinates:

I think the main trick is

llHTTPRequest(
   "https://cap.secondlife.com/cap/0/b713fe80-283b-4585-af4d-a3b7d9a32492?"
   + "var=name&grid_x=" + (string)llFloor(grid.x)
   + "&grid_y=" + (string)llFloor(grid.y), [], "");
        

 

Wow awesome script thanks!

I can see much use for this 😉

Link to comment
Share on other sites

  • 10 months later...
  • 5 weeks later...
You are about to reply to a thread that has been inactive for 143 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...