secondlife / jira-archive

2 stars 0 forks source link

[BUG-226640] collision_start events repeatedly firing #5132

Open sl-service-account opened 5 years ago

sl-service-account commented 5 years ago

What just happened?

Inserted this script into a flattened cube:


default
{
    state_entry()
    {
    }
    collision_start(integer total_number)
    {
        integer i;
        for (i=0;i<total_number;++i)
           llSay(0,llDetectedName(i));
    }
}

Now I'd expect it to be triggered once when I walk on it. It repeats every 1-2 seconds. However it doesn't happen with alts (only once).

Tried removing all attachments & still happens but just for my AV.

What were you doing when it happened?

Walking on a scripted flattened cube.

What were you expecting to happen instead?

One event unless I move whilst on the plain.

Other information

Seems to be just me not my alts (even if they create the plain). When I walk on their plain there's repeated events. When they walk on it there is only one. Tested on main & beta grid and same happens. Could it be something to do with premium vs. non-premium accounts? That & payment info is the only difference I see between me & my alts.

Original Jira Fields | Field | Value | | ------------- | ------------- | | Issue | BUG-226640 | | Summary | collision_start events repeatedly firing | | Type | Bug | | Priority | Unset | | Status | Accepted | | Resolution | Accepted | | Reporter | Mars Tamale (mars.tamale) | | Created at | 2019-04-01T14:56:55Z | | Updated at | 2019-04-04T18:20:08Z | ``` { 'Build Id': 'unset', 'Business Unit': ['Platform'], 'Date of First Response': '2019-04-02T15:17:05.573-0500', "Is there anything you'd like to add?": "Seems to be just me not my alts (even if they create the plain). When I walk on their plain there's repeated events. When they walk on it there is only one. Tested on main & beta grid and same happens. \r\nCould it be something to do with premium vs. non-premium accounts? That & payment info is the only difference I see between me & my alts.", 'ReOpened Count': 0.0, 'Severity': 'Unset', 'System': 'SL Simulator', 'Target Viewer Version': 'viewer-development', 'What just happened?': "Inserted this script into a flattened cube:\r\ndefault\r\n{\r\n state_entry()\r\n {\r\n }\r\n collision_start(integer total_number)\r\n {\r\n integer i;\r\n for (i=0;i
sl-service-account commented 5 years ago

Dyna Mole commented at 2019-04-02T20:17:06Z, updated at 2019-04-03T23:58:35Z

That's not uncommon behavior for collision_start.  The way to get around it is to maintain a global list of avatars who have recently collided with your object, then use that list to ignore future collisions.  Clear the list after a reasonable time.  A very simple example might look like this:

collision_start (integer num) {      if ( !~llListFIndList( lAllAvs, [ llDetectedKey(0) ]) )      {         

          llSetTimerEvent( 20.0 ) // Timer triggers 20 seconds after the most recent collision with a new arrival         

           lAllAvs += [ llDetectedKey(0) ];

            llSay( 0, llDetectedName(0) );    

     }

}

timer()

{

      lAllAvs = [ ]; // Clear the list }

}

You can be more elegant, but that basic approach ignores extra spurious collisions within a short time. ( Formatting scripts in the JIRA is impossible. Sorry. )

sl-service-account commented 5 years ago

Whirly Fizzle commented at 2019-04-03T23:25:52Z

Formatting scripts in the JIRA is impossible. Sorry.


Do it like this...
{code}
Script stuff
{code}

https://jira.secondlife.com/secure/WikiRendererHelpAction.jspa?section=advanced

sl-service-account commented 5 years ago

Dyna Mole commented at 2019-04-03T23:59:06Z

Hah

sl-service-account commented 5 years ago

Whirly Fizzle commented at 2019-04-04T00:12:05Z

Like this lol

https://prnt.sc/n76b1v

sl-service-account commented 5 years ago

Mars Tamale commented at 2019-04-04T11:50:33Z

I understand the trivial workaround but the concern I have is that it is taking sim resources repeatedly & unnecessarily raising events.