Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

control event is broken

Gigs Taggart
The Invisible Hand
Join date: 12 Feb 2006
Posts: 406
04-30-2006 21:27
The control event appears broken when trying to take control from more than one agent. Even putting two separate scripts in two separate prims, the key passed to it seems to be the key of the first person to give permissions, not the key of the person actually doing the input.

I've reported this as a bug, but does anyone know any workarounds, short of creating a prim that's not part of the same linkset to take controls from the second agent?
Gigs Taggart
The Invisible Hand
Join date: 12 Feb 2006
Posts: 406
Minimal test script to reproduce the problem
04-30-2006 21:55
Here's one potential test script that reproduces the bug, we've tried everything, but no matter what, the control event doesn't get the right keys (UUID type keys).

Put this in a prim and have two people touch it and then trigger some control inputs.

CODE

default
{
touch_start(integer num)
{
llRequestPermissions(llDetectedKey(0), PERMISSION_TAKE_CONTROLS);
}

run_time_permissions(integer perm)
{
if(perm & PERMISSION_TAKE_CONTROLS)
{
// take all of the user controls
llTakeControls(CONTROL_UP | CONTROL_DOWN |
CONTROL_FWD | CONTROL_BACK |
CONTROL_LEFT | CONTROL_RIGHT |
CONTROL_ROT_LEFT | CONTROL_ROT_RIGHT |
CONTROL_ML_LBUTTON | CONTROL_LBUTTON, TRUE, FALSE);

}
else
if(perm == 0)
{
llReleaseControls();
}
}

control(key id, integer held, integer change)
{
llSay(0,(string)llKey2Name(id));
}
}
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
04-30-2006 22:49
Gigs, its broke and has been for a while.

The only solutioon I've ever found was to only get control permission in child prims and send infor about the results via link messages.

If the root prim has 'em, it gets all the control messages, exclusively, and mis-identifies them as comming from whomever gave the root prim script permissions.
_____________________
Kyrah Abattoir
cruelty delight
Join date: 4 Jun 2004
Posts: 2,786
04-30-2006 22:51
what about using the returned "key" to filter?
_____________________

tired of XStreetSL? try those!
apez http://tinyurl.com/yfm9d5b
metalife http://tinyurl.com/yzm3yvw
metaverse exchange http://tinyurl.com/yzh7j4a
slapt http://tinyurl.com/yfqah9u
Gigs Taggart
The Invisible Hand
Join date: 12 Feb 2006
Posts: 406
05-01-2006 10:16
Jillian,

Thanks, that's one thing I hadn't tried, not having the root prim involved at all. Our tests were 1st av parent, 2nd av child. I'll try that and see how it goes.

Kyrah,

The key passed to the event gives you the wrong key! That's the problem I'm talking about here.