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
Invisibility Prims_Visible_When_Running  

Prims_Visible_When_Running

Prims_Visible_When_Running

Category: Invisibility
By : mangowylder
Created: 2011-04-18 Edited: 2011-04-18
Worlds: Second Life

the Zip file

Download all files for Prims_Visible_When_Running
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Prims_Visible_When_Running_1.lsl
1 // Script to turn linked prims visible when running and invisible otherwise.
2 //
3 // The object will be invisible when you wear it so if you need to see it
4 // while not running, toggle CTRL-ALT-T
5 //
6 // hex values per http://wiki.secondlife.com/wiki/LlGetAgentInfo
7 // The above wiki shows AGENT_WALKING as 0x0080 (128)
8 // My testing shows that AGENT_WALKING is 0x0086 (134)
9 // Running a modified version of llGetAgentInfo test script returns 134 for AGENT_WALKING
10 // I just added an LLOwnerSay to the AGENT_WALKING (after line 74) part to snag the value.
12 // I took off everything except my shape, skin, eyes and Phoenix #LSL<->Client Bridge v0.12
13 // S.Count on myself shows one script running which would be the Phoenix #LSL<->Client Bridge v0.12
14 // I wonder if that could cause the discrepency?
15 // the llGetAgentInfo test script can be found at...
16 // http://wiki.secondlife.com/wiki/LlGetAgentInfo_Test
17 //
18 // I'd credit the original author but I don't know who it is.
19 //
20 // Comments by Mango Wylder
21
22 integer runningstate;
23
24 default
25 {
27 {
29 }
30 on_rez(integer sparam){
32 }
33
34 timer()
35 {
37 // Need the && here because buf will be equal to AGENT_ALWAYS_RUN 0x1000(4096) and
38 // AGENT_WALKING 0x0080 (128)
39 // I was expecting to see buf = 4224 (4096 + 128)
40 // but buf equals 4230 = 4096 + 134 (128 + 6) see above
41 // So this works as well
42 // Do not hard code values like this. It's just for testing purposes.
43 // if(buf == 4230) runningstate=TRUE; else runningstate=FALSE;
44 if(buf & AGENT_ALWAYS_RUN && buf & AGENT_WALKING) runningstate=TRUE; else runningstate=FALSE;
45 // Be careful about uncommenting out the line below as it well be VERY SPAMMY!!!
46 // llOwnerSay((string) buf);
47 //True = 1 so 100% visible. False = 0 so 100% invisible
48 llSetLinkAlpha(LINK_SET,runningstate,ALL_SIDES);
49 }
50 }

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