These forums are CLOSED. Please visit the new forums HERE
Profile Picture on prim |
|
|
Ilayda Reina
Registered User
Join date: 21 Nov 2007
Posts: 31
|
09-18-2008 09:28
How can I set owner's profile picture on a prim ? I tried but end up with nothing.
|
|
Pedro McMillan
SLOODLE Developer
Join date: 28 Jul 2007
Posts: 231
|
09-18-2008 10:10
If you want to do it in script (rather than manually applying a texture) then the best way would be to find out the UUID of the texture (since you have to upload an image as a texture into SL before you can use it as a profile picture), and then apply it using llSetTexture.
If you have the texture yourself, you can right-click it in your inventory to copy the UUID to your clipboard. All you need to do then is plug it into the llSetTexture function, and that's it. |
|
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
|
09-18-2008 10:15
Check out this thread: /54/1b/225692/1.html
That shows the picture via particles but once you have the UUID, you could just pass that to llSetTexture to put it on a prim instead. _____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224 - If you see "if you were logged in.." on the left, click it and log in - Click the "Vote for it" link on the left |
|
Ilayda Reina
Registered User
Join date: 21 Nov 2007
Posts: 31
|
09-18-2008 18:31
Thanks a lot for the replies. Here is my code, it works but maybe it can be better , any thoughs ?
string RESIDENT_URL = "http://world.secondlife.com/resident/"; key WHITE_DEFAULT_TEXTURE = "5748decc-f629-461c-9a36-a35a221fe21f"; key nameKey; default { state_entry() { llSetTexture(WHITE_DEFAULT_TEXTURE, 0); nameKey = llGetOwner(); llHTTPRequest( RESIDENT_URL + (string)nameKey,[HTTP_METHOD,"GET"],"" ;} on_rez(integer start_param) { llSetTexture(WHITE_DEFAULT_TEXTURE, 0); llResetScript(); } http_response(key request_id,integer status, list metadata, string body) { if (llSubStringIndex(body, "blank.jpg" == -1){ integer start_of_UUID = llSubStringIndex(body,"<img alt=\"profile image\" src=\"http://secondlife.com/app/image/" + llStringLength("<img alt=\"profile image\" src=\"http://secondlife.com/app/image/" ;integer end_of_UUID = llSubStringIndex(body,"\" class=\"parcelimg\" />" - 3;string profile_pic = llGetSubString(body, start_of_UUID, end_of_UUID); llSetTexture((key)profile_pic, 0); } else { llWhisper(0, "You have no profile picture" ;llSetTexture(WHITE_DEFAULT_TEXTURE, 0); } } } |
|
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
|
09-18-2008 20:18
Can you get picks in a similar way?
_____________________
-
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 - |
|
Pedro McMillan
SLOODLE Developer
Join date: 28 Jul 2007
Posts: 231
|
09-19-2008 01:02
Yep, see this recent thread:
/54/29/277418/1.html EDIT: should've guessed you could scrape those profile pages for image info too. I think the Lindens should consider restricting that ability, or providing a dedicated service for the data... all this scraping must be putting a fair old load on their webserver! |