LlRequestPermissions generating multiple dialog boxes
|
|
Entheogen Aeon
boing boom tschak
Join date: 25 Dec 2007
Posts: 34
|
12-30-2008 12:55
I made simple script to animate avatar: string gAnimName = "dance1"; // what animation to play? Must be same as name of some animation in this object's inventory where the script is also situated.
default { touch(integer n ) { //llSay( 0, "OMG DANCING!" ); key current_user = llDetectedKey( 0 ); llRequestPermissions( current_user, PERMISSION_TRIGGER_ANIMATION); // ask the avatar that clicked for permissions to animate. } run_time_permissions(integer perm) { if( perm == PERMISSION_TRIGGER_ANIMATION ) { llStartAnimation(gAnimName); } } }
When I click on the object running this script, it displays more than 1 dialog boxes asking for permissions instead of 1. The avatar does get animated on first time ok is pressed. What is going on here? Is this an SL bug?
|
|
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
|
12-30-2008 13:32
Try to write: touch_end(integer n ) instead of touch(integer n ) The one you used will fire as long as you keep the mouse button down 
_____________________
From Studio Dora
|
|
Pedro McMillan
SLOODLE Developer
Join date: 28 Jul 2007
Posts: 231
|
12-30-2008 13:45
I've found that even touch_start and touch_end can fire more than once for a single click. Apparently putting a llSleep in at the end of the event helps avoid it, for some reason. (Not sure why... the event queue is supposed to keep filling up while a script sleeps).
|
|
Entheogen Aeon
boing boom tschak
Join date: 25 Dec 2007
Posts: 34
|
12-30-2008 13:48
From: Pedro McMillan I've found that even touch_start and touch_end can fire more than once for a single click. Apparently putting a llSleep in at the end of the event helps avoid it, for some reason. (Not sure why... the event queue is supposed to keep filling up while a script sleeps). Jesus Christ, what is wrong with people who implemented LSL in SL? If I coded my software with such lax constraints I would be fired 
|
|
Pedro McMillan
SLOODLE Developer
Join date: 28 Jul 2007
Posts: 231
|
12-30-2008 15:57
Alas, it's called being human. We all make mistakes and errors in our programming, whether we're building a virtual world or an international banking system. By and large, LL have done a wonderful job of giving users the tools and capabilities of creating and scripting stuff in SL. A few bugs and glitches are just par for the course.
|
|
Entheogen Aeon
boing boom tschak
Join date: 25 Dec 2007
Posts: 34
|
12-30-2008 16:32
From: Pedro McMillan Alas, it's called being human. We all make mistakes and errors in our programming, whether we're building a virtual world or an international banking system. By and large, LL have done a wonderful job of giving users the tools and capabilities of creating and scripting stuff in SL. A few bugs and glitches are just par for the course. Thank god for these forums, then 
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
12-30-2008 19:49
From: Pedro McMillan I've found that even touch_start and touch_end can fire more than once for a single click. Apparently putting a llSleep in at the end of the event helps avoid it, for some reason. (Not sure why... the event queue is supposed to keep filling up while a script sleeps). because it'll only fill one entry per person clicking? if it see that person already in that event queue it silently drops the most recent touch. did some testing on this long ago. although I've never personally had it double trigger on _start or _end
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
12-30-2008 19:54
From: Entheogen Aeon Jesus Christ, what is wrong with people who implemented LSL in SL? If I coded my software with such lax constraints I would be fired  I have not had touch_start or touch_end trigger more than once on a click, unless the mouse bounced.
|