Jump to content

More Collisions ...


Wandering Soulstar
 Share

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

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

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?

Link to comment
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
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1967 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...