Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

name of adjacent sim

Anya Ristow
Vengeance Studio
Join date: 21 Sep 2006
Posts: 1,243
12-19-2008 17:48
Is there a way to get the name of an adjacent sim?
_____________________
The Vengeance Studio Gadget Store is closed!

Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
12-19-2008 18:05
You could have an object (try to, who knows with parcel settings) cross the boundary, then shout or travel back to your current sim.
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
12-19-2008 20:12
This seems like it will return the grid coordinates of the sim {Region Name}

https://cap.secondlife.com/cap/0/d661249b-2b5a-4436-966a-3d3b8d7a574f?var=foo&sim_name={REGION-NAME}

This seems like it will produce the name of a sim given the grid coordinates

https://cap.secondlife.com/cap/0/b713fe80-283b-4585-af4d-a3b7d9a32492?var=x&grid_x={X}&grid_y={Y}

Replacing {Region Name} in the first sample with Sandbox Goguen , no quotes or escapes, and putting that in the address bar of a browser produces a web page that shows

var foo = {'x' : 998, 'y' : 997 };

Replacing {X} and {Y} with 998 and 997 in the second sample and putting that in the browser's address bar produces a web page that shows

var x='Sandbox Goguen';

Changing that to 997 997 yields Sandbox Newcomb

999 997 produces Sandbox Cordova

So I suppose maybe you can

1. do llGetRegionName to get the region name, then

2 an llHttpRequest with something like the first sample to get the coordinates, then

3. add and subtract appropriately to those coordinates to produce the coordinates of the neighboring sims, and then do

4. an llHttpRequest with something like the second sample and the neighbor coordinates to get the name.

This assumes you can use those urls from within a script.
_____________________
-

So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.

I can be found on the web by searching for "SuezanneC Baskerville", or go to

http://www.google.com/profiles/suezanne

-

http://lindenlab.tribe.net/ created on 11/19/03.

Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard,
Robin, and Ryan

-
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
12-19-2008 21:24
From: SuezanneC Baskerville
This seems like it will return the grid coordinates of the sim {Region Name}

https://cap.secondlife.com/cap/0/d661249b-2b5a-4436-966a-3d3b8d7a574f?var=foo&sim_name={REGION-NAME}

This seems like it will produce the name of a sim given the grid coordinates

https://cap.secondlife.com/cap/0/b713fe80-283b-4585-af4d-a3b7d9a32492?var=x&grid_x={X}&grid_y={Y}

Holy moley! Where did you find that? Is it documented somewhere?

(EDIT: Hmm. From the viewer code perhaps? I should've thought to dig there for map services I guess....)
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
12-19-2008 22:09
I put

second life region name coordinate

into Google. Took the first link. Then fiddled a bit in the browser address bar. The LSL stuff I didn't try at all.

That first link was to http://hublog.hubmed.org/archives/001776.html .
_____________________
-

So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.

I can be found on the web by searching for "SuezanneC Baskerville", or go to

http://www.google.com/profiles/suezanne

-

http://lindenlab.tribe.net/ created on 11/19/03.

Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard,
Robin, and Ryan

-
Anya Ristow
Vengeance Studio
Join date: 21 Sep 2006
Posts: 1,243
12-19-2008 23:20
Thanks, Suzanne! It does work within LSL. Here's a script that prints the name of the sim one region west of the object...

key http_region_request;

default
{
touch_start(integer total_number)
{
vector globalPos = llGetRegionCorner() + llGetPos();
integer x = (integer) ( globalPos.x / 256.) - 1; // one region west of here
integer y = (integer) ( globalPos.y / 256.);

llOwnerSay( (string) globalPos + " x=" + (string) x + " y=" + (string) y);
http_region_request = llHTTPRequest( "https://cap.secondlife.com/cap/0/b713fe80-283b-4585-af4d-a3b7d9a32492?var=x&grid_x=" + (string) x + "&grid_y=" + (string) y, [ HTTP_VERIFY_CERT, FALSE ], "";);
}

http_response( key request_id, integer status, list metadata, string body)
{
if ( request_id == http_region_request)
{
llOwnerSay( "body=>" + body + "<";);
integer start = llSubStringIndex( body, "var x='";);
if ( start >= 0)
{
integer end = llSubStringIndex( llGetSubString( body, start + 7, -1), "';";);
if ( end >= 0)
{
llOwnerSay( llGetSubString( body, start + 7, start + 6 + end));
}
}
}
}
}
_____________________
The Vengeance Studio Gadget Store is closed!

Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
12-20-2008 00:48
Hmm. I believe this to be the source from which the above referenced article got its API info: http://slurl.com/_scripts/slmapapi.js