seems I'm full of questions today. I'm just figuring the permissions system out and I am wondering if there is a difference if an avatar who sits on an object will request permissions or an avatar touches an object will request permissions. If u look at the following script and hopefully try it out, u will see that
a) the permission window occurs if the av just touches the an object
b) the permission window does not occur when the av already sits on the object
vector offset = <0.1,0.0,-1.0>;
key avatar;
key trigger;
default
{
state_entry()
{
llSitTarget(offset, ZERO_ROTATION);
}
run_time_permissions(integer perm)
{
avatar = llAvatarOnSitTarget();
if(perm & PERMISSION_TRIGGER_ANIMATION && llKey2Name(avatar) != "" && avatar == llGetPermissionsKey())
{
llOwnerSay("run_time_permission"
;trigger = avatar;
}
}
touch_start(integer tn){
avatar = llDetectedKey(0);
if(llKey2Name(avatar))
{
if(trigger != avatar)
{
llOwnerSay("trigger != avatar"
;llRequestPermissions(avatar, PERMISSION_TRIGGER_ANIMATION);
}
}
}
changed(integer change)
{
if(change & CHANGED_LINK)
{
avatar = llAvatarOnSitTarget();
if(llKey2Name(avatar))
{
if(trigger != avatar)
{
llOwnerSay("trigger != avatar"
;llRequestPermissions(avatar, PERMISSION_TRIGGER_ANIMATION);
}
}
else if(trigger)
{
llOwnerSay("trigger"
;if(trigger == llGetPermissionsKey())//right user?
if(llGetPermissions() & PERMISSION_TRIGGER_ANIMATION)//got permissions?
if(llKey2Name(trigger)) //user in the sim? modern permision system makes this last check unnecessary.
trigger = "";
}
}
}
on_rez(integer start_param){
llResetScript();
}
}
This seems kinda strange to me, as the documentation at llStartAnimation() says:
Triggers the animation anim. In order for this to work, the script must have the PERMISSION_TRIGGER_ANIMATION permission on an avatar.
But if u sit on the object it is possible to start the animation with no permission window at all. So in my opinion permissions are not granted.
Am I missing something here? Can anybody please enlighten me?
Thx and greet
A8