Kurt Zidane
Just Human
Join date: 1 Apr 2004
Posts: 636
|
11-15-2004 02:00
Can a script have multiple permissions at the same time? I know a script can't have two permissions of the same type, but what about say the permission to attach, and the permission to animate? And if so, how do you detect specific permissions, if the script uses multiple permissions?
Sorry to ask, but the example offered by ll is kind of vague. And I've lost track of wiki. I hope it comes back up some time soon.
|
Till Stirling
Crazy Inventor
Join date: 31 Jul 2004
Posts: 124
|
11-15-2004 03:37
In my Experience one script can hold one permission of each kind and avatar. That is also the reason why dancemachines / -bracelets need to have one script per dancer they control. Communication between scripts is best done using linkmessage.
Till Stirling
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
11-15-2004 06:08
From: Kurt Zidane Can a script have multiple permissions at the same time? I know a script can't have two permissions of the same type, but what about say the permission to attach, and the permission to animate? And if so, how do you detect specific permissions, if the script uses multiple permissions?
Yes you can. You or '|' the permission requests together and it will give you a multi-line request when you try to attach/animate/etc. using the item. I use another if statement of the form: if(perm & PERMISSION_ATTACH = PERMISSION_ATTACH) { } and then do whatever I need inside. Perm is defined elsewhere as integer perm = llGetPermissions(); Obviously you can do this for your other permissions too. Sorry if there are minor errors in here, I am away from a machine where I can see SL or any LSL examples I might have downloaded, but something more or less like this should work.
|
Zuzi Martinez
goth dachshund
Join date: 4 Sep 2004
Posts: 1,860
|
11-15-2004 12:55
i could be way off but i'd say it's more like one attachment can have each kind of permission. well that's not very clear. for example, i got an attachment with multiple scripts and two of them ask for control permissions. they can both have it and it works fine but when one script releases controls the other does too. so i guess if you're talking about scripts in the same object, more than one script can have the same permission but if one releases they all will. seems like that anyway.
|
Kurt Zidane
Just Human
Join date: 1 Apr 2004
Posts: 636
|
11-15-2004 14:18
Interesting, Zuzi Martinez do you mind if I ask you how do you release permissions? I don't remember seeing any thing about that in sls' help file. Or is that only for taking control of input.
So to get two permissions at the same time. Both permissions have to be called at the same time?
if I included the two lines of command listed bellow, would I end up with PERMISSION_TRIGGER_ANIMATION or PERMISSION_TRIGGER_ANIMATION and PERMISSION_ATTACH ? commands : llRequestPermissions( id, PERMISSION_TRIGGER_ANIMATION || PERMISSION_ATTACH ); llRequestPermissions( id, PERMISSION_TRIGGER_ANIMATION );
About "&", I don't under stand exactly what & is doing. And compares numbers on a binary level right? if ( ( llGetPermissions() & PERMISSION_ATTACH ) == PERMISSION_ATTACH )
I hope I am not asking to many questions. I'm just rather curious about the part of permissions, and I would really like to know.
|
Zuzi Martinez
goth dachshund
Join date: 4 Sep 2004
Posts: 1,860
|
11-15-2004 14:40
i release the controls in the one script with plain old llReleaseControls() but the controls release in the other script too when that happens.
as far as i can tell with multiple permissions in one script, it doesn't work to ask for the permissions separately like....
llRequestPermissions(id, PERMISSION_ATTACH); llRequestPermissions(id, PERMISSION_TRIGGER_ANIMATION);
i can only get it to work right by doing....
llRequestPermissions(id, PERMISSION_TRIGGER_ANIMATION || PERMISSION_ATTACH);
i can't remember off the top of my head if doing them separately made only the first or only the last one work.
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
11-17-2004 03:18
LSL Wiki, before its disappearance, made it clear that if you ask for permissions in different places (i.e. have several llRequestPermissions(); statements) then each one overwrites the previous permissions. This can be useful of course, but for most things you want several permissions at once, so you have to 'or' - the pipe | command them together.
|