Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Sim Map

Ravanne Sullivan
Pole Dancer Extraordinair
Join date: 10 Dec 2005
Posts: 674
04-18-2009 14:55
Does anyone know how to retrieve the sim map for use as a texture? I want to do this programatically so as to be able to pull and use the map for whatvever sim I am in.
_____________________
Ravanne's Dance Poles and Animations

Available at my Superstore and Showroom on Insula de Somni
http://slurl.com/secondlife/Insula de Somni/94/194/27/
Lazink Maeterlinck
Registered User
Join date: 8 Nov 2005
Posts: 332
04-18-2009 15:27
I'm not sure there is a way to do it via LSL. There might be a way to use an http_request call, but I'm not an expert at that at all. The only way I can think of doing it is to capture a screen shot and crop, then upload as a texture.
Ravanne Sullivan
Pole Dancer Extraordinair
Join date: 10 Dec 2005
Posts: 674
04-18-2009 15:31
I've seen items in which it is done dynamically. If it requires an http_request or even an outside PHP script I can do that just need enough information to be able to make it happen.
_____________________
Ravanne's Dance Poles and Animations

Available at my Superstore and Showroom on Insula de Somni
http://slurl.com/secondlife/Insula de Somni/94/194/27/
Lazink Maeterlinck
Registered User
Join date: 8 Nov 2005
Posts: 332
04-18-2009 15:39
If you've seen it done, it most likely comes form the slurl page on secondlife.com. I'd assume it would work like grabbing a profile picture, but that's just a guess. :)
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
04-18-2009 16:09
Try this .... It grabs the map for the current sim and drops it on a prim, also reads from a notecard in the object's inventory. The notecard should consist of pairs of lines, the first one describing a potential LM in the sim and the second line consisting of a URL in the form secondlife:///app/teleport/MySim/105/122/34/. The lines are read into chat, where the URLs appear as direct TP links.

I put it together as a friendly map/TP system for an orientation area. Obviously, you can strip out the notecard stuff to get just the sim map that you're asking about. ;)

CODE

// SIM3 --- A Direct TP system --- Rolig Loon, February 2009
//
//
key http_request_id;
string URL = "http://www.subnova.com/secondlife/api/map.php";
string SIM_NAME;
integer iLine = 0;
integer CHANNEL = 1000;
integer gNotecardLine;
key avatar = NULL_KEY;
string gName;
key gQueryID = NULL_KEY;
default
{
on_rez(integer n)
{
llResetScript();
}
state_entry()
{
vector temp;
list temp_name;
integer i=0;
string name = llGetRegionName();
temp = llGetScale();
http_request_id = llHTTPRequest(URL + "?" + "sim" + "=", [], "");
iLine = 0;
temp_name = llParseString2List(name,[],[" "]);
for (i = 0; i < llGetListLength(temp_name); i++)
{
if (llList2String(temp_name,i) == " ")
{
temp_name = llListReplaceList(temp_name,["_"],i,i);
}
}
SIM_NAME = llDumpList2String(temp_name,"");
llSetText("Click this map for Direct TP links to sites of interest on " + SIM_NAME, <1,0,0>, 2); // Remove or modify this line to change hover text
llSetObjectName (SIM_NAME + " Direct TP system");
http_request_id = llHTTPRequest(URL + "?" + "sim" + "=" + SIM_NAME, [], "");
}
touch_start(integer number)
{
gNotecardLine = 0;
avatar = llDetectedKey(0);
gName = llGetInventoryName(INVENTORY_NOTECARD, 0);
gQueryID = llGetNotecardLine(gName, gNotecardLine);
string dummy = llGetObjectName();
llSetObjectName ("");
llSay(0, "/me ");
llSetObjectName(dummy);
}
dataserver(key query_id, string data)
{
string DirectSLURL;
string Spot;
if (query_id == gQueryID)
{
if (data != EOF)
{
if (gNotecardLine%2 == 0)
{
Spot = data;
string dummy = llGetObjectName();
llSetObjectName("");
llSay(0, "/me Click this message in your chat window for an instant TP to " + Spot );
llSetObjectName(dummy);
++gNotecardLine;
gQueryID = llGetNotecardLine(gName, gNotecardLine);
}
else if (gNotecardLine%2 == 1)
{
DirectSLURL = data;
string dummy = llGetObjectName();
llSetObjectName("");
llSay(0, "/me " + Spot + " " + DirectSLURL);
llSetObjectName(dummy);
++gNotecardLine;
gQueryID = llGetNotecardLine(gName, gNotecardLine);
}
}
}
}
http_response(key request_id, integer status, list metadata, string body)
{
if (request_id == http_request_id)
{
llSetTexture(body, 4);
}
}
}
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
04-18-2009 16:55
Or the sim map particle projector that is on my user page. All you have to do is strip the particle stuff out.

CODE

key httpRequestId;
float mapSize = 3.0;
float mapHeight = 3.0;
string mapTexture;
string URL = "http://www.subnova.com/secondlife/api/map.php";

mapParticle()
{
llParticleSystem([
PSYS_PART_FLAGS, 0,
PSYS_SRC_PATTERN, 4,
PSYS_PART_START_ALPHA, 0.50,
PSYS_PART_END_ALPHA, 0.50,
PSYS_PART_START_COLOR, <1.0,1.0,1.0>,
PSYS_PART_END_COLOR, <1.0,1.0,1.0>,
PSYS_PART_START_SCALE, <mapSize,mapSize,0.00>,
PSYS_PART_END_SCALE, <mapSize,mapSize,0.00>,
PSYS_PART_MAX_AGE, 1.20,
PSYS_SRC_MAX_AGE, 0.00,
PSYS_SRC_ACCEL, <0.0,0.0,0.0>,
PSYS_SRC_ANGLE_BEGIN, 0.00,
PSYS_SRC_ANGLE_END, 0.00,
PSYS_SRC_BURST_PART_COUNT, 8,
PSYS_SRC_BURST_RADIUS, mapHeight,
PSYS_SRC_BURST_RATE, 0.10,
PSYS_SRC_BURST_SPEED_MIN, 0.00,
PSYS_SRC_BURST_SPEED_MAX, 0.00,
PSYS_SRC_OMEGA, <0.00,0.00,0.00>,
PSYS_SRC_TEXTURE, mapTexture]);
}

default {
state_entry() {
httpRequestId = llHTTPRequest(URL + "?" + "sim" + "=" + llEscapeURL(llGetRegionName()),[], "");
}
http_response(key request_id, integer status, list metadata, string body) {
if (request_id == httpRequestId) {
mapTexture = body;
mapParticle();
}
}
}


Which leaves you with :
CODE

key httpRequestId;
string URL = "http://www.subnova.com/secondlife/api/map.php";

default {
touch_start(integer n) {
httpRequestId = llHTTPRequest(URL + "?" + "sim" + "=" + llEscapeURL(llGetRegionName()),[], "");
}
http_response(key request_id, integer status, list metadata, string body) {
if (request_id == httpRequestId) {
llOwnerSay("Sim texture uuid = " + body);
}
}
}
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Ravanne Sullivan
Pole Dancer Extraordinair
Join date: 10 Dec 2005
Posts: 674
04-18-2009 17:09
Thank you, that worked perfectly.
_____________________
Ravanne's Dance Poles and Animations

Available at my Superstore and Showroom on Insula de Somni
http://slurl.com/secondlife/Insula de Somni/94/194/27/
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
04-18-2009 19:40
FYI, you may want to read comments by Philip & James Linden in this thread:
/352/51/303761/1.html

from Philip Linden (post #96)
From: someone
We had never contemplated the idea of someone hacking the viewer to get access to the UUID's for the map tile. So, the problem is that the existing system isn't scalable - essentially LL is covering the bill to inject new UUID's every few days into our asset system. We are expanding our own storage system to hold the map tile data, and of course greatly increasing the update frequency (which is good for all SL users) then would cost us even more if we keep this system going.
and James Linden (post #127):
From: someone
We might change that in the future to only use JPG tiles. I would like to. We have never provided an official mechanism to access the UUIDs of these images. The fact that these images display on in-world objects is, in my opinion, a hack. It's a cool hack, and one I wish I thought of, but they're not images a user uploaded and I cannot promise they will always work.
Viktoria Dovgal
Join date: 29 Jul 2007
Posts: 3,593
04-20-2009 18:26
Philip Linden's latest project is the "more open than the regular viewer" viewer which includes the long-awaited ability to fetch textures visa straight HTTP. There is a really aggressive schedule to turn this thing into a release, freeze is supposed to be in a few weeks. So, if and when in-world map tiles go away, there should be a replacement out there.

Meanwhile, in-world map tiles aren't on the schedule to go away now, because all the currently released viewers still need them to display the map. the in-world map can't be changed over until Philip's texture project is completed and integrated into all viewers.

Soooo, at some point those map scripts will probably break, but not before there is a way to fix them.