Jump to content

Can someone p lease explain llPassCollisions?


Altier Verwood
 Share

You are about to reply to a thread that has been inactive for 945 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hey there  peoples, would you please  help explain  the  llpasscollision  command? the wiki is SO BAD  at  explaining  it.

http://wiki.secondlife.com/wiki/LlPassCollisions

it doesn't tell where t his is used.

I have a script in the root prim that is waiting for collision by various objects, but if  it  hits another prim it won't pass the collision.

Link to comment
Share on other sites

You only use this command in scripts that are not in the root prim. Don't use this command in scripts that are in the root prim.
You generically use this command if you want certain non-root prim's not to send the collision to your root script (by adding a script with this command to the prim).

To filter for a specific collision prim i recommend you use llDetectedLinkNumber(0); inside the collision function. Or in more words, you kind of never need this command.

Link to comment
Share on other sites

33 minutes ago, Altier Verwood said:

 example o f how the pass command is used?

example of how this works

link two prims. Put script (1) in the root prim, and script (2) in the link prim. Then bump the prims with your avatar

// root prim : script (1)

default
{    
    collision_start(integer num_detected)
    {
        llOwnerSay("bump root");
    }
}
// link prim : script (2)

default
{
    state_entry()
    {
        llPassCollisions(TRUE); // TRUE: collision with link prim is passed to root prim script (1)
        // script (2) will say "bump link"
        // and script (1) will say "bump root"
        
        // llPassCollisions(FALSE); // FALSE: collision with link prim is not passed to root prim script (1)
        // script (2) will say "bump link"
        // script (1) will say nothing    
    }   
     
    collision_start(integer num_detected)
    {
        llOwnerSay("bump link");
    }
    
    /*
       when there is no collision event in script (2) then
       collisions with link prim are always passed to root prim script (1)
       and llPassCollisions(FALSE) has no effect       
}

 

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Ideally you would pass the collision using a link message and do some pre-filtering in that script.

If the script in the child prim doesn't contain a collision event then by default it will get passed to the root. Kind of my point why you never need this command.
Anyways all you need to do is:

default
{
    state_entry()
    {
        llPassCollisions(PASS_ALWAYS);
    }
}

To clarify, when you have the collision function in a root script it applies to the entire object.

  • Thanks 1
Link to comment
Share on other sites

16 minutes ago, Altier Verwood said:

I tried this t hough  I have  a collision  function  in the root prim, strikes to t he child prim does n ot p ass the collision  to it, I suppose I will have to try with link message.

suggest that you try the test scripts (1) and (2) first

when the test works as expected and your scripts don't then your scripts are not working as expected

is often best to troubleshoot on more than one region, as sometimes the server can be borky

another thing is that sometimes the compiler can corrupt scripts when the server is wonky.  In this case then we usually have to fix it by copypaste our script into an external text editor (like Windows Notepad) then create a new LSL script and copypaste our script text and do Save. Which gives us a fresh compile of a whole new script

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 945 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...