User:Gregory Maurer/PhantomChild: Difference between revisions

From Second Life Wiki
Jump to navigation Jump to search
Created Page
 
(No difference)

Latest revision as of 20:26, 16 May 2009

This is a very simple to use script that can be placed in any child prim that can be made flexible, to make it phantom. This is useful for making link sets where you need phantom and solid prims. It's based on the original Phantom Child, but it is a bit more advanced, drag and drop.

<lsl> list prim_type;

phantom() {

   list prim_type_params = [ PRIM_TYPE ] + prim_type;
   llSetPrimitiveParams( prim_type_params + [ PRIM_FLEXIBLE , TRUE , 0 , 0.0 , 0.0 , 0.0 , 0.0 , < 0.0 , 0.0 , 0.0 > ] + prim_type_params + [ PRIM_PHYSICS , llGetStatus( STATUS_PHYSICS ) ] );    

}

default {

   on_rez( integer start_param )
   {
       llResetScript();
   }
   
   state_entry()
   {
       prim_type = llGetPrimitiveParams( [ PRIM_TYPE ] );
       phantom();
   }
   
   changed( integer change )
   {
       if ( change & ( CHANGED_REGION | CHANGED_LINK ) ) phantom();
   }
   
   collision_start( integer num_detected )
   {
       if ( llDetectedLinkNumber( 0 ) == llGetLinkNumber() ) phantom();
   }

} </lsl>