Difference between revisions of "LlCollisionFilter"

From Second Life Wiki
Jump to: navigation, search
(This is a prime example of a BAD example. 1) The code has bugs, 2) Whitespace inconsistency detrimental to readability, 3) Bad grammar & spelling in comments. fix removes llCollisionFilter from code)
Line 17: Line 17:
Filter out all collisions:
Filter out all collisions:
<lsl>llCollisionFilter("", NULL_KEY, FALSE);</lsl>
<lsl>llCollisionFilter("", NULL_KEY, FALSE);</lsl>
== Complete script whit llcollisionfilter ==
//The stair sound script. Make a sculpted oe prim stair make sound when an avatar go up on down on It.
//MathieuBC Noel scripter and freebie maker. Don't erase that part when you use this script
key    id  ; 
    collision_start(integer total_number)  //It's write colision start to notofy the computer that     
                                            //the next command line are going to work when the       
                                            //object detect an colision.
        if (AGENT)                          //The computer star to read the command line when It's
                                            //an avatar colide on this.
          llGetAgentInfo( id );            //Agent key is get by the object.
          llCollisionFilter("", id, TRUE);  //You have an colision only whit an agant whit the key                 
                                            //taken by the object.
          llSensorRepeat( "", id, AGENT, 3, PI,.7 ); //The sensor is sctivate each .7 second
              state off ;                    //If It's not an AGENT colision the computer must use   
                                              //the state off command line well below in the script
              collision_end(integer total_number)
          llSensorRemove();                    //When the object did not detect an colision, the
                                                //sensor is remove
            sensor(integer  total_number)      //This is the sensor action when It's activate whit
                                                //the above command line in the begin of this sheet.
        if(AGENT_WALKING)                      //If the sensor detect in his radius an Agent
                                                //walking and running please dothe command line
            llPlaySound("steps_on_wooden_stairs", 1.0);  //Play the sound name I put in the
                                                        //inventory object. You can also copy and 
                                                        //past the UUID of the soung between the two
                                                        //" .
        else                                            //Otherwise (else), if the agent do nothing
                                                        //read orther command line.
            llStopSound();                              //Stop sound
          land_collision_start(vector pos)              //If the object have an land colision follow
                                                        //the lines below.
{      llStopSound();                       
        llSensorRemove();                                //Remove the repeat sensor.
      state off                                        //This is the state off apear in the beginig 
                                                        //of the script.                                 
    llStopSound();                                      //Stop sound                 
    llCollisionFilter("", id, FALSE);                    //Stop the filtering of collision identity 
                                                        //and UIID detection to choose to have and 
                                                        //colision whit It.
state default ;                                              //Retun to the begening of the script                                               

Revision as of 15:27, 27 August 2009


Function: llCollisionFilter( string name, key id, integer accept );

Sets the collision filter, exclusively or inclusively.

• string name
• key id
• integer accept

if accept == TRUE, only accept collisions with objects name and id (either is optional), otherwise with objects not name or id


Stop filtering: <lsl>llCollisionFilter("", NULL_KEY, TRUE);</lsl> Filter out all collisions:

<lsl>llCollisionFilter("", NULL_KEY, FALSE);</lsl>

See Also


•  collision_start
•  collision
•  collision_end


•  llPassCollisions
•  llVolumeDetect

Deep Notes

Search JIRA for related Issues


function void llCollisionFilter( string name, key id, integer accept );