Jump to content
Wandering Soulstar

More Collisions ...

Recommended Posts

Hi All,

This is a follow-on to the topic I started a few days back "Collision 'Face'" found HERE. After that discussion my design decision was to simply have a prim the size of the elevator, with collision_start giving me the count when someone entered the elevator and collision_end the number when someone exited. As I was cleaning up my comments and code a bit though, a doubt came to mind:

Does a seated AV raise the _start/_end events? If I have an AV seated on a prim, and that prim is moved into the detector prim, will the total_number parameter passed to the event be 2, and so I'll be able to find the AV? The wiki is not clear in my view on this. Whilst is does say:

Quote

Will not detect collisions between an avatar sitting on the task and the task itself (avatars are linked to objects they sit on so there is no collision ..)

In this case the AV is seated (linked) on a different prim from the one with the script. If it does count it, that would lead me to understand that a linkset that collided with the detector would be treated for the event as all the individual prims it is made up of?

To the contrary, i.e. the total_number passed in the suggested scenario is only 1, and that one being the prim itself, it would lead me to conclude that if the AV stepped into the detector prim (raising collision_start), and then sat on a prim that was inside said detector, then a collision_end would be raised?

Anyone?

Share this post


Link to post
Share on other sites

A seated avatar becomes a part of the object it is sitting on.

If the avatar (while seated) collides with anything, the whole object that avatar is part of is colliding.

1 event, total_number 1, llDetectedKey will return the root of the linkset the avatar is sitting on.

Share this post


Link to post
Share on other sites

hmmm ... and so therefore what happens when they stand inside the detector prim .. will another collision_start event be raised at that point? And conversely if they sit on the prim inside the detector will a collision_end be raised?

 

Share this post


Link to post
Share on other sites

Ok .. was able to get inworld to do some simple tests.

Scenario: 4x4x4 prim with the following code in it:


//######
//Functions
integer get_av_count(integer total_number)
{
    //filter out any objects .. to only get count of AVs
    integer x;
    integer numAVs = 0;
    for (x = 0; x < total_number; x++)
    {
        if (llDetectedType(x) & AGENT){numAVs++;}
    }

    return numAVs;  
  
}
//End Functions
//......


//Body
default
{
    state_entry()
    {
        //set volume detect so that prim is 'phantom'
        llVolumeDetect(TRUE);
    }

    collision_start(integer total_number)
    {
        integer numAVs = get_av_count(total_number);

        llWhisper(0, "Enter");
        llWhisper(0, "Tot: " + (string)total_number);
        llWhisper(0, "Avs: " + (string)numAVs);

        integer x;
        list names;
        for (x = 0; x < total_number; x++)
        {
            names = names + llDetectedName(x);
        }
        llWhisper(0, llList2CSV(names));
        
    }

    collision_end(integer total_number)
    {
        integer numAVs = get_av_count(total_number);

        llWhisper(0, "Exit");
        llWhisper(0, "Tot: " + (string)total_number);
        llWhisper(0, "Avs: " + (string)numAVs);

        integer x;
        list names;
        for (x = 0; x < total_number; x++)
        {
            names = names + llDetectedName(x);
        }
        llWhisper(0, llList2CSV(names));     
    }
}

... then stuck another prim inside the 4x4x4 prim

  • Walk in/out: _start/_end events fire
  • Cam in to sit: Nothing
  • Cam out to sit outside: Nothing
  • Inside 4x4x4 sit: Nothing
  • Inside 4x4x4 stand:: _start event fires
  • Move the interior (or an exterior) prim in/out with or without seated AV: Nothing
  • move the interior prim with AV standing on it: _start/_end fire
  • Log Out : Nothing
  • Log In: _start fires

Then I tried a number of TP combinations:

  • double click TP in/out: _start/_end fire
  • double click TP out from sit: Nothing
  • map click TP out: Nothing
  • LM TP out: Nothing ++ no _start event fires on re-entry, until after an _end event has fired or 5-10 mins have passed this only affect the AV in question
  • LM TP in: _start event fires

So in summary some very strange and inconsistent behavior.

 

 

Edited by Wandering Soulstar
Added some more test scenarios

Share this post


Link to post
Share on other sites

One last .. on the scenario: LM TP out: Nothing ++ no _start event fires on re-entry, .. seems to reset automatically, i.e. _start event fires after somewhere between 5 and 10 minutes

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×