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

llRezObjectWithParams flag REZ_FLAG_NO_COLLIDE_FAMILY causes first instance of rezzed object to receive no collision_start events at all
Using the flag REZ_FLAG_NO_COLLIDE_FAMILY with llRezObjectWithParams() causes the first object rezzed not to receive any collision_start events at all no matter how many collisions it has. All subsequent rezzes of the same object do receive collision_start events as expected. This problem seems to be subject to a "caching effect" such that it only happens the first time the object is rezzed on a given sim. It has been difficult to characterize the behavior exactly since it only happens once per sim per some very long time (sim seems to "remember" the object and not have the issue for some number of hours). However, it does seem like the "memory" works across different owners' instances of the same rezzed object, e.g. agent A uses laucher to rez projectile, which exhibits the failure, then agent B uses same launcher the same way and does not experience the issue. I also did not attempt to investigate collision and collision_end events, but I strongly suspect these have the same issue. I have created a minimal example to replicate the issue. You can use these scripts to reproduce it, or contact me in world and I will give you my example object. Launcher script default { touch_start(integer num_detected) { rotation my_rot = llGetRot(); vector rez_pos = llGetPos() + <5.0, 0.0, 0.0> * my_rot; vector velocity = llRot2Fwd(my_rot) * 200.0; list params = [ REZ_FLAGS, REZ_FLAG_TEMP | REZ_FLAG_PHYSICAL | REZ_FLAG_NO_COLLIDE_FAMILY, REZ_LOCK_AXES, <1.0, 1.0, 1.0>, REZ_POS, rez_pos, FALSE, FALSE, REZ_ROT, my_rot, FALSE, REZ_VEL, velocity, FALSE, FALSE ]; llRezObjectWithParams("projectile", params); } } Projectile script default { on_rez(integer param) { llOwnerSay("on_rez param="+(string)param); } collision_start(integer num_detected) { llOwnerSay("Collided with: "+llDetectedName(0)); llSetTimerEvent(4.0); } timer() { llDie(); } } You can see a video of the behavior here: https://gyazo.com/41bf8753ec3d82243109df5db86a8acc Notice in the lower left chat text how the first projectile reports only its on_rez event, then the second one reports on_rez and collision_start. In fact, if you look closely you can see both projectiles bounce back and forth a few times hitting an object out of frame to the left. The first one gets none of the collision_start events while the second gets them all.
6
·

tracked

Load More