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
Phantom Phantom_Child  

Phantom_Child

Phantom Child

This easy to use code when put into a child prim of a linkset will make that child and only that child phantom, even when taken into inventory and re-rezzed. You can use multiple copies of this script to make multiple children of a linkset phantom.

This code relies on a bug in Second Life and may not function in later versions (Currently working in server 1.36). This script was created in part by Aeron Kohime and documents this useful bug (which like invis-prims, has countless applications).

You may use the following script in any manner you like, excluding claiming you made it and individually reselling it without change in function (its on the Wiki silly). Otherwise you can sell it as part of a product, modify it, remove my comments, etc etc.

It needs to be reset on sim restarts. A reliable solution is included in all these scripts. Checking llGetTime and a timer could be used but, is a more "expensive" method.

Category: Phantom
By : Aeron Kohime
Created: 2010-12-27 Edited: 2010-12-27
Worlds: Second Life

the Zip file

Download all files for Phantom_Child
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Phantom_Child_1.lsl
Get file # 2. Phantom_Child_2.lsl
Get file # 3. Phantom_Child_3.lsl
1 // Basic
2 //Phantom Child Script by Aeron Kohime
3 //WARNING: When used on the root prim it makes the entire object phantom, it
4 // also does not function correctly on tortured prims. (Sorry.)
5 //Reset on Sim restart added by Void Singer
6 //Strife Onizuka was here doing simplification
7 //Reset on collision added by Taff Nouvelle (my stairs kept reverting)
8 //Psi Merlin updated CHANGED_REGION_START (live as of Server 1.27)
9
10 default {
11 state_entry() {
13 0, <0,1,0>, 0, <0,0,0>, <1,1,0>, <0,0,0>,
14 PRIM_FLEXIBLE, TRUE, 0, 0, 0, 0, 0, <0,0,0>,
16 }
17
18 on_rez(integer s) {
20 }
21
22 //-- This event/test will reset the script on sim restart.
23 changed (integer vBitChanges){
24 if(CHANGED_REGION_START & vBitChanges){
26 }
27 }
28 collision_start(integer num_detected){
30
31 }
32 }

Phantom_Child

Switchable

Addition to the above script, a switchable version that could be useful for a phantom door.

Category: Phantom
By : Aeron Kohime
Created: 2010-12-27 Edited: 2010-12-27
Worlds: Second Life

1 //Phantom Child Script by Aeron Kohime
2 //WARNING: When used on the root prim it makes the entire object phantom, it
3 // also does not function correctly on tortured prims. (Sorry.)
4 //Reset on Sim restart added by Void Singer
5 //Strife Onizuka was here doing simplification
6 //Phantom door idea added by Taff Nouvelle
7 //Psi Merlin updated CHANGED_REGION_START (live as of Server 1.27)
8
9 integer a = 1;
10
11 default
12 {
14 {
15 }
16 touch_start(integer total_number)
17 {
18 a*=-1;
19 if(a == 1)
20 {
22 0, <0,1,0>, 0, <0,0,0>, <1,1,0>, <0,0,0>,
23 PRIM_FLEXIBLE, TRUE, 0, 0, 0, 0, 0, <0,0,0>,
25 llOwnerSay("Phantom");
26 }
27 else
28 {
30 llOwnerSay("Solid");
31 }
32 }
33 on_rez(integer s) {
35 }
36 changed (integer vBitChanges){
37 if(CHANGED_REGION_START & vBitChanges){
39 }
40 }
41 }

Phantom_Child

Advanced

Unlike the versions above, this version will work with ANY prim type (torus, tube, box, sculpt etc.) with ANY shaping parameters (twist, hollow, taper, slice, dimple etc.) and ANY texturing applied (glow, texture, fullbright, color etc.) without changing those parameters. In other words... This version works in ALL cases without error (At least I'm pretty sure it does). The downside being a greater memory use and slower run time (Although this is negligible) for complex (tortured) prims. Should only be used on child prims.

Category: Phantom
By : Aeron Kohime
Created: 2010-12-27 Edited: 2010-12-27
Worlds: Second Life

1 list PRIM_PHANTOM_HACK = [
2 PRIM_FLEXIBLE, 1, 0, 0.0, 0.0, 0.0, 0.0, <0,0,0>,
3 PRIM_FLEXIBLE, 0, 0, 0.0, 0.0, 0.0, 0.0, <0,0,0>];
4
5 list Params()
6 {
7 list result = [];
8 integer i = 0;
9 integer face = 0;
11 integer len = llGetListLength(src);
12 do
13 {
14 result += [PRIM_TEXTURE, face] + llList2List(src, i, (i + 3));
15 face++;
16 i += 4;
17 }
18 while(i < len);
19
20 i = 0;
21 face = 0;
23 len = llGetListLength(src);
24 do
25 {
26 result += [PRIM_COLOR, face] + llList2List(src, i, (i + 1));
27 face++;
28 i += 2;
29 }
30 while(i < len);
31
32 i = 0;
33 face = 0;
35 len = llGetListLength(src);
36 do
37 {
38 result += [PRIM_BUMP_SHINY, face] + llList2List(src, i, (i + 1));
39 face++;
40 i += 2;
41 }
42 while(i < len);
43
44 i = 0;
45 face = 0;
47 len = llGetListLength(src);
48 do
49 {
50 result += [PRIM_FULLBRIGHT, face] + llList2List(src, i, i);
51 face++;
52 i++;
53 }
54 while(i < len);
55 i = 0;
56 face = 0;
58 len = llGetListLength(src);
59 do
60 {
61 result += [PRIM_TEXGEN, face] + llList2List(src, i, i);
62 face++;
63 i++;
64 }
65 while(i < len);
66
67 i = 0;
68 face = 0;
70 len = llGetListLength(src);
71 do
72 {
73 result += [PRIM_GLOW, face] + llList2List(src, i, i);
74 face++;
75 i++;
76 }
77 while(i < len);
78
79 return result;
80 }
81
82 default
83 {
85 {
86 list type_params = llGetPrimitiveParams([PRIM_TYPE]);
87 integer type = llList2Integer(type_params, 0);
88 if(type > PRIM_TYPE_PRISM)
89 {
90 // After prism comes sphere, torus, tube, ring and sculpt.
91 if(type != PRIM_TYPE_SCULPT)
92 type_params += Params();
93
94 llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_BOX, PRIM_HOLE_DEFAULT, <0,1,0>, 0, <0,0,0>, <1,1,0>, <0,0,0>]
95 + PRIM_PHANTOM_HACK
96 + [PRIM_TYPE] + type_params);
97 }
98 else
99 {
101 }
102 }
103 changed(integer change)
104 {
105 if(change & CHANGED_REGION_START)
107 }
108 on_rez(integer param)
109 {
111 }
113 {
115 }
116 }

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