Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
HUD Projecter Show_peoples_profiles_on_a_HUD  

Show_peoples_profiles_on_a_HUD

Recently, Linden Labs created a website ...

Category: HUD Projecter
By : Ariane Brodie
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Show_peoples_profiles_on_a_HUD
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Show_peoples_profiles_on_a_HUD_1.lsl
1
2 // GNU General Public License for more details.
3
4 // Repairs on Aug 2010 Ferd Frederix - Lindens changed the web site
5 // ~ PROFILE PROJECTOR v5.4.3 by Debbie Trilling ~
6 // - Modified for HUD use by Ariane Brodie
7
8 // *** This script cycles through AVs from a crowd & then displays their name and
9 // profile picture as texture on a hud prim***
10
11 // Free to use as you wish by under condition that the title and this introduction remain in place,
12 // and that due credit continues to be given to Moriash Moreau, Jana Kamachi and Solar Alter, and
13 // Debbie Trilling.
14
15 // TOUCH will automatically move your camera to the persons avatar, then revert to nrmal after a few seconds
16 // As this is a private HUD, exclude list and listen commands are not needed. To disable, just unwear it.
17
18
19 //************************
20 // GENERAL PARAMETERS
21 //************************
22
23 // how often in seconds the sensor fires
24 float RepeatTime = 20.00;
25
26 // sensor range in meters. Maximum 96m but in practice 40m because of camera move limitations
27 float Range = 20.00;
28
29 // texture palette of UUID's. The one included is simply a transparent texture so the HUD is invisible when no one is in range
30 list DefaultTexturePalette = ["bd7d7770-39c2-d4c8-e371-0342ecf20921"];
31
32 // sets whether the DefaultTexturePalette will be used to texture/project when the toy is switched OFF. 'TRUE' to texture/project; 'FALSE' to have no texturing/projection when off
33 integer EmployDefaultTexture = TRUE;
34
35
36
37 //************************
38 // PRIM TEXTURE PARAMETERS
39 //************************
40
41 // set to TRUE to texture the prim with the profile picture on ALL_SIDES
42 integer TexturePrim = TRUE;
43
44 // the following 'Prim*' parameters effect the prim only if("EmployDefaultTexture = FALSE") OR ("EmployDefaultTexture = TRUE" and "TexturePrim=FALSE")
45 // if TexturePrim = TRUE then the prim is automatically set to solid blank white no shiny with full bright as this is usually the best surface to display the profile picture
46
47 // set the degree of 'shininess' to apply to the prim "0" = None, "1" = Low, "2" = medium, "3" = high
48 integer PrimShine = 2;
49
50
51 //************************
52 // FLOATING TEXT PARAMETERS
53 //************************
54 // set to TRUE for floating text above the prim; FALSE to disable the floating text
55 integer ApplyFloatingText = TRUE;
56
57 // set the text to be displayed at first. This will change to name of avatar pic being displayed.
58 string FloatingText = "";
59
60 // set the text colour
61 vector FloatingTextColour = <1.0,1.0,1.0>;
62
63 // set the text alpha
64 float FloatingTextAlpha = 1.0;
65
66
67 //************************
68 // ** DO NOT CHANGE BELOW THIS LINE **
69 //************************
70
71
72
73
74 integer Power = FALSE;
75 integer counter = 0;
76 key AVKey = "";
77 key DetectedUser = "";
78 key ObjectOwner = "";
79 key LastTexture = "";
80 string OwnerName = "";
81 vector pos;
82 rotation rot;
83 vector rotz;
84 integer permissions=FALSE;
85 vector position;
86 rotation facing;
87
88 StopCamera()
89 {
90 if(permissions&PERMISSION_CONTROL_CAMERA)
92 }
93
94 SetFloatingText()
95 {
96 if(ApplyFloatingText)
97 {
98 llSetText(FloatingText, FloatingTextColour, FloatingTextAlpha);
99 }
100 else
101 {
102 //llSetText("",<1.0,1.0,1.0>,0.0);
103 }
104 }
105
106
107 ApplyPrimSurface()
108 {
109 // putting texture on the prim, let's make sure it is solid white, blank. full bright
111 }
112
113 StartUp()
114 {
115 Power = TRUE;
116 llSensorRepeat("",NULL_KEY,AGENT,Range,PI,RepeatTime);
117 llOwnerSay("\nThe Profile Camera is now ready. Scanning for people nearby. Please wait...");
118 }
119
120 ApplyDefaultTexture()
121 {
122 ApplySelectedTexture((key)llList2String(DefaultTexturePalette, (integer)llFrand((float)llGetListLength(DefaultTexturePalette))));
123 }
124
125
126 string DeriveName(string messagecapture)
127 {
128 string DerivedName = llGetSubString(llStringTrim(messagecapture,STRING_TRIM),8,llStringLength(llStringTrim(messagecapture,STRING_TRIM)));
129 return DerivedName;
130 }
131
132
133 ApplySelectedTexture(key texture)
134 {
135 if(TexturePrim)
136 {
137 llSetTexture(texture, ALL_SIDES);
138 }
139 }
140
141 default
142 {
143
144 on_rez(integer start_param)
145 {
146 // reset script on rez
148 }
149
150 changed( integer change )
151 {
152 if(change & CHANGED_OWNER )
153 {
154 // reset script on change of owner
156 }
157 }
158
160 {
161 //initialise system
162 SetFloatingText();
163 StartUp();
164 }
165
166 touch_start(integer total_number)
167 {
169 }
170
172 permissions = perm;
175 CAMERA_ACTIVE, 1, // 1 is active, 0 is inactive
176 CAMERA_BEHINDNESS_ANGLE, 0.0, // (0 to 180) degrees
177 CAMERA_BEHINDNESS_LAG, 0.0, // (0 to 3) seconds
178 CAMERA_DISTANCE, 0.0, // ( 0.5 to 10) meters
179 CAMERA_FOCUS, pos, // region relative position
180 CAMERA_FOCUS_LAG, 0.0 , // (0 to 3) seconds
181 CAMERA_FOCUS_LOCKED, TRUE, // (TRUE or FALSE)
182 CAMERA_FOCUS_THRESHOLD, 0.0, // (0 to 4) meters
183 // PITCH" title="View Definition" class="tooltip">CAMERA_PITCH, 80.0, // (-45 to 80) degrees
184 CAMERA_POSITION, pos + rotz, // region relative position
185 CAMERA_POSITION_LAG, 0.0, // (0 to 3) seconds
186 CAMERA_POSITION_LOCKED, TRUE, // (TRUE or FALSE)
187 CAMERA_POSITION_THRESHOLD, 0.0, // (0 to 4) meters
188 CAMERA_FOCUS_OFFSET, ZERO_VECTOR // <-10,-10,-10> to <10,10,10> meters
189
190 ]);
191 }
192 }
193
194
195 sensor(integer total_number)
196 {
197 // save the AV key in case it is needed for a 'ShoutOut'
198 counter++;
199 if(counter >= total_number)
200 counter = 0;
201 integer pick = counter;
202 AVKey = llDetectedKey(pick);
203
204 string AVLanguage = llGetAgentLanguage(AVKey);
205
206 FloatingText = llDetectedName(pick) + "\n" + AVLanguage;
207 pos = llDetectedPos(pick);
208 rot = llDetectedRot(pick);
209 rotz = llRot2Fwd(rot);
210 rotz.x = rotz.x * 2;
211 rotz.y = rotz.y * 2;
212 rotz.z = 1;
213 StopCamera();
214 SetFloatingText();
215 // core code by Jana Kamachi and Solar Alter. Adapted to suit by Debbie Trilling
216 string URL_RESIDENT = "http://world.secondlife.com/resident/";
217 llHTTPRequest( URL_RESIDENT + (string)AVKey,[HTTP_METHOD,"GET"],"");
218 }
219
220
221 no_sensor()
222 {
223 FloatingText = "";
224 StopCamera();
225 SetFloatingText();
226 ApplyDefaultTexture();
227 }
228
229
230 http_response(key req,integer stat, list met, string body)
231 {
232 // core code by Jana Kamachi and Solar Alter. Adapted to suit by Debbie Trilling
233 integer s1 = 0;
234 integer s2 = 0;
235 integer s1l= 0;
236 integer s2l= -3;
237
238 s1 = llSubStringIndex(body,"<meta name=\"imageid\" content=\"") +30;
239
240
241
242 if(s1 == -1)
243 {
244 // selected AV doesn't have a profile picture, so use the default instead
245 ApplyDefaultTexture();
246 llSetText("", FloatingTextColour, FloatingTextAlpha);
247 }
248 else
249 {
250
251 //check whether this was the texture used last time, no point in refreshing if it is
252 if((key)llGetSubString(body,s1,s1+35) != NULL_KEY)
253 {
254 if((key)llGetSubString(body,s1,s1+35) != LastTexture)
255 {
256 // different profile from last time & not on ExcludeListing, so display it
257 ApplySelectedTexture((key)llGetSubString(body,s1,s1+35));
258 // save the key for comparison purposes next time tho'
259 LastTexture = (key)llGetSubString(body,s1,s1+35);
260
261 }
262 }
263 }
264 }
265
266 //default end
267 }
268

Back to the Best Free Tools in Second Life and OpenSim.