Starmand Stygian
Junior Member
Join date: 12 May 2004
Posts: 8
|
07-13-2004 13:12
Let me begin by saying my scripting knowledge does go very deep yet, so don't laugh at this newb question  I have an object that, when a player clicks on it, asks permission to animate. If they accept, then, they can continue to click on it, and with each click will play a new animation, all of which can be stopped by saying quit. It's a basic script and it works; however, my intention is to have multiple players click on the same object, and my expectation is to have the script treat each player individually. What's happening is that if I'm the first one to touch it after I rez it, anyone else who touches it afterwards causes the script to send all of it's functions to me. I'm using the llGetOwner function, but I'm confused it's referring to the owner of the object, or does llGetOwner mean that the person who touches the object is the new owner? I have a second question (Sorry for the long post). When I touch the object the first time after rezzing it, the permission message pops up, which is fine. But if I don't choose 'yes' or 'no', and instead, click on the object again, multiple permission messages pop up. In my script, I need the player to give me permission to animate them, but it also appears that I still need permission to stop animating them, as well. So here's what's happening. I click the object twice to bring up two permission messages, I click 'yes' on the first one, and I begin to animate myself. Then while I'm animating, I click 'no' on the second permission window, which voids getpermission. Now if the player says 'quit', it calls a function that stops animating them, but since I selected 'no' on the second permission window, I get errors when it tries to stopanimation. It doesn't break anything, it's just annoying. Newb questions, indeed, but I'm proud to be a part of a community where I know my problem will be solved. (Sorry again for the long post).
|
Starmand Stygian
Junior Member
Join date: 12 May 2004
Posts: 8
|
07-13-2004 13:13
my scripting knowledge DOESN'T go very deep, in fact 
|
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
|
07-13-2004 13:30
The problem your having is related to an internal limitation of the permissions system. The permissions (PERMISSION_TRIGGER_ANIMATION, for example) can only be requested from one agent and one agent only. If another agent grant permissions to the script, the previous agent's permissions are erased. Basicly, a script can get permissions from one agent at a time. What you need, is either multiple scripts for each agent you wish to request permissions from, or multiple objects each with scripts in them. We've asked for the ability to hold permissions from multiple avatars, here's the Feature Suggestions thread related to it: /13/1a/16293/1.htmlHere's an example of a touch_start function that says outloud the keys of the people who touch it: touch_start(integer numTouchers) { integer i; for(i = 0; i < numTouchers; i++) { llSay(0, (string) llDetectedKey(i)); } }
The agent holding permissions on the object can be accessed using llGetPermissionsKey, the permissions the object actually has can be accessed using llGetPermissions. Here's an example of how to use llGetPermissions: touch_start(integer numTouchers) { integer myPerms = llGetPermissions(); // If I have PERMISSION_TRIGGER_ANIMATION if (myPerms & PERMISSION_TRIGGER_ANIMATION) { //... } else { // I dont have pemermission to animate. } }
|
Garth FairChang
~ Mr FairChang ~
Join date: 24 Jun 2003
Posts: 275
|
07-13-2004 13:39
key toucher = llDetectedKey(total_number - 1);
will store the key of the player that clicked in a key variable called toucher and will work with multi players clicks. Place this in the touch event instead of llGetOwner.
Second part of your question has no real fix
Hope this helps
----------------- Just read your reply, we replied at same time.
Very true, best fix is to have a prim for each player to click on. Maybe a little advanced for a beginer at scripting
_____________________
Garth FairChang ~Cheeky Brit~ ' Have a nice day  ' http://www.fairchang.com
|
Starmand Stygian
Junior Member
Join date: 12 May 2004
Posts: 8
|
07-13-2004 17:45
Thanks for the help guys 
|