From Second Life Wiki
Revision as of 00:01, 15 January 2011 by Dale Innis (Talk | contribs)

Jump to: navigation, search


The Second Life grid, especially the mainland parts, is organized into interesting and aesthetically-pleasing continents, with a variety of landforms and connectivities and geographies. The continents have their own histories, their own interesting places. But because so many people just teleport everywhere (kids these days, I tell ya), all too many people aren't aware of which continent they're on, or where they are relative to the continents, much of the time. This script is a simple example of how one might determine this, and thereby become more Geographically Aware, and therefore more fun at parties.


To use this script, stick it into the root prim of pretty much any object, and wear that object somewhere on your person. Whenever you teleport, or touch the object, it will tell you your global coordinates, and also what continent or other area of the grid you are on.

Limitations and Notes

In fact this script is mostly just a demonstration of llGetRegionCorner(). The division of the world into continents and other sections is strictly unofficial and approximate, the result of using the map to zip around the grid and see roughly where things seemed to start and stop. It's relatively easy to change what's there, or to add your own areas and divisions. (Is the old Teen Grid still around somewhere? If anyone knows the coordinates, it'd be fun to add them also.)

The reason the script should be put into the root prim of an object is that only root prims get the CHANGED_TELEPORT event.

The Code

You may do anything you like with this code, without limitation. Well, without limitation in the sense of me suing you, that is. If you do illegal things with it, you might get in trouble, for instance. And you can't do impossible things with it.

<lsl> // Each set of five list elements represents a grid-aligned rectangle, in the form xmin,xmax,ymin,ymax,name. // The code returns the FIRST one that it finds, so its okay if the rectangles overlap, as long as you put // the right one first.

list map = [

252928.0,254464.0,256000.0,257280.0,"Bay City",
290048.0,290816.0,268288.0,269824.0,"Western Blake Sea",
291072.0,294400.0,266496.0,272128.0,"Blake Sea",
291840.0,294144.0,284672.0,289280.0,"Gaeta I",
296960.0,304384.0,276736.0,281344.0,"Gaeta V",

// and then for places outside the bounds of mainland continents, some random names...

     0.0,250000.0,     0.0,999999.0,"the Western Ocean",  
250000.0,265000.0,     0.0,999999.0,"the West",        
265000.0,280000.0,     0.0,999999.0,"the Center Longitudes",         
280000.0,310000.0,     0.0,999999.0,"the East",          
310000.0,450000.0,     0.0,999999.0,"the Gap Longitudes",           
450000.0,500000.0,     0.0,999999.0,"the Zindra Longitudes",            
500000.0,999999.0,     0.0,999999.0,"the Far East"


string get_continent_name(vector gc) {

   integer count = llGetListLength(map);
   integer i;
   for (i=0;i<count;i+=5) {
       if ((gc.x>=llList2Float( map,i )) &&
           (gc.x<=llList2Float( map,i+1 )) &&        
           (gc.y>=llList2Float( map,i+2 )) &&                                
           (gc.y<=llList2Float( map,i+3 )) ) return llList2String( map,i+4 );
   return "";


say_location() {

   vector gc = llGetRegionCorner()+llGetPos();
   llOwnerSay("Coordinates: "+(string)gc.x+","+(string)gc.y);
   string s = get_continent_name(gc);
   if (s!="") {
       llOwnerSay("You are in "+s);
   } else {
       llOwnerSay("You are not in any known area.");


default {

   changed(integer change) {
       if (change & CHANGED_TELEPORT) say_location();
   touch_start(integer total_number) {

} </lsl>

See Also


llGetRegionCorner - to find out the global coordinates of the southwest corner of this sim

llOwnerSay - to tell you about it


CHANGED_TELEPORT - to see if we've teleported


Linden Department of Public Works Roads - shows the major continents and their Linden roads

History of Second Life - includes some discussion of the geography

Lalo Telling's history page - has his very nice geohistory of the early grid