Change font size
It is currently Tue Aug 20, 2019 7:53 pm

Forum rules


{L_IMAGE}



Post a new topicPost a reply Page 1 of 1   [ 4 posts ]
Author Message
 Post subject: Map on a prim
PostPosted: Thu Jan 25, 2018 8:17 am 

Joined: Fri Jun 14, 2013 2:17 am
Posts: 33
Hi All,
I'm trying to learn some scripting and something I'd find useful for my regions is a map on a prim - Just the image from the main OSGrid map for a given region as a texture on a prim. I know I can screen-grab and save the texture, but I'd like to make it more dynamic so it updates once a day or whatever.
Where is the best place to start with this? I have searched the forum for similar scripts but can't find anything.

Thanks,
Scoobs X


Top
 Profile  
 
 Post subject: Re: Map on a prim
PostPosted: Fri Jan 26, 2018 3:55 am 

Joined: Fri Jun 14, 2013 2:17 am
Posts: 33
I found this example online so I have been playing about with it, firstly swapping the URL for the OSGrid one:-


integer time = 86400; //update every 24 hours
key httpRequestId;
string mapTexture;
string URL = "http://www.subnova.com/secondlife/api/map.php";

default
{
   on_rez( integer sparam )
   {
       llResetScript();
   }
   
   state_entry()
   {
       llSetTimerEvent(time);
       httpRequestId = llHTTPRequest(URL + "?" + "sim" + "=" + llEscapeURL(llGetRegionName()),[], "");
   }
   
   http_response(key request_id, integer status, list metadata, string body)
   {
       if (request_id == httpRequestId)
       {
           mapTexture = body;
           llSetTexture(mapTexture, ALL_SIDES); //you can replace ALL_SIDES with a side number instead
       }
   }
   
   timer()
   {
       httpRequestId = llHTTPRequest(URL + "?" + "sim" + "=" + llEscapeURL(llGetRegionName()),[], "");
   }
}



But the process seems to grind to a halt at "if (request_id == httpRequestId) "

Scoobs X


Top
 Profile  
 
 Post subject: Re: Map on a prim
PostPosted: Fri Jan 26, 2018 4:39 am 
Furious Typer
User avatar

Joined: Fri Mar 26, 2010 12:11 pm
Posts: 226
Location: Belgium / Brussels
Try this or this :)

_________________
Webmaster @ digitalconcepts.free.fr & digigrids.free.fr


Top
 Profile  
 
 Post subject: Re: Map on a prim
PostPosted: Fri Jan 26, 2018 2:23 pm 

Joined: Fri Jun 14, 2013 2:17 am
Posts: 33
Omg I can't believe I didn't find those googling... I can't believe my noobpidity!

Thank you very much Phil!

Ta,
Scoobs X


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 4 posts ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
610nm Style by Daniel St. Jules of Gamexe.net