Scripting Bugs

  • Search existing bugs before submitting
  • Use support.secondlife.com for customer support issues
  • Keep posts on-topic
Triggering false clicks when two avatars have control permission (root prim and child prim).
I found a bug that causes false clicks on the avatar when there is a passenger seat with control permissions. In other words, the avatar sitting on the root prim has a script to allow controls and the avatar sitting on the prim child has another script on the prim child that also allows controls. This error can only be caught if the script depends on correctly reading button presses. When both avatars are sitting, and the root avatar holds down a key, it will fire even when it is just pressed. It takes 10 to 20 seconds for this bug to start, and if there is more load on the script it can trigger very quickly. The click receiver is defined as a "first touch" limiter, but the avatar will hold the key in the "controls section": integer start = level & edge; if(start & CONTROL_FWD) This shouldn't let any command pass without the avatar releasing the key and pressing it again, but in this bug it triggers false clicks with the key held down. I wrote a script to demonstrate this bug in practice. There are two scripts, one for root and one for child prim: Connect 2 prims for seat. Each Prim receives the respective scripts below that request control permission. Sit with both avatars. Use the main avatar in root prim: press forward, hold for up to 20 seconds and see false clicks being generated: Scripts that catch the bug: ------------------------------------------------------------ //Root Prim: integer i; default { state_entry() { llSetTimerEvent(0.2); } changed(integer change) { if(change & CHANGED_LINK) { key avatar = llAvatarOnSitTarget(); if(avatar != NULL_KEY) { llRequestPermissions(avatar, PERMISSION_TAKE_CONTROLS); } else { llReleaseControls(); llResetScript(); } } } run_time_permissions(integer perm) { if(PERMISSION_TAKE_CONTROLS & perm) { llTakeControls(CONTROL_RIGHT | CONTROL_LEFT | CONTROL_BACK | CONTROL_FWD, TRUE, 0); } } control(key id, integer level, integer edge) { integer start = level & edge; if(start & CONTROL_FWD) //Only one click at a time { i++; llSay(0,"Click = "+(string)i); } } timer() { //just to increase the use of the script in this bug test. integer read_timer; read_timer++; } } //End script 1 ------------------------------------------------------------------------ ------------------------------------------------------------------------- //Child Prim: default { changed(integer change) { if(change & CHANGED_LINK) { key avatar = llAvatarOnSitTarget(); if(avatar != NULL_KEY) { llRequestPermissions(avatar, PERMISSION_TAKE_CONTROLS); } else { llReleaseControls(); llResetScript(); } } } run_time_permissions(integer perm) { if(PERMISSION_TAKE_CONTROLS & perm) { llTakeControls(CONTROL_RIGHT | CONTROL_LEFT | CONTROL_BACK | CONTROL_FWD, TRUE, 0); } } control(key id, integer level, integer edge) { //Passenger . Nothing defined in this test. Permission only. } } //End Script 2 ------------------------------------------------------------------------- This is a translator. I would like someone from the native language to send this for greater clarity, but unfortunately the error happened to me. I hope that Linden resolves this very calmly and cautiously, as I know that fixing a bug can generate other bugs. I'm not in a hurry or urgent. At the moment I could deviate from this type of script, but I would like this to be listed as bugs to be fixed. Thanks!
10
·

tracked

Load More